X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fjs%2Fcore2.js;fp=site%2Fswingjs%2Fjs%2Fcore2.js;h=af02f330744ee4f747a39033f9e68d17e8770b88;hp=c9f36242d38a89711698f4bdae3f0a2caf2a996b;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/js/core2.js b/site/swingjs/js/core2.js index c9f3624..af02f33 100644 --- a/site/swingjs/js/core2.js +++ b/site/swingjs/js/core2.js @@ -1,52822 +1,52822 @@ -// JSmolJavaExt.js - - -// This library will be wrapped by an additional anonymous function using ANT in -// build_03_tojs.xml. This task will also modify variable names. References -// to Clazz._ will not be changed, but other Clazz_xxx will be changed to -// (local scope) Clazz_xxx, allowing them to be further compressed using -// Google Closure Compiler in that same ANT task. - -// BH 5/31/2015 5:53:04 PM Number.compareTo added -// BH 5/21/2015 5:46:30 PM Number("0xFFFFFFFF") is not -1 -// BH 4/23/2015 9:08:59 AM xx.getComponentType() is nonfunctional. Array.newInstance now defines a wrapper for .getClass().getComponentType() that works -// BH 4/12/2015 1:37:44 PM adding Math.rint = Math.round -// BH 1/16/2015 10:09:38 AM Chrome failure jqGrig due to new String("x").toString() not being a simple string -// BH 8/14/2014 6:49:22 PM Character class efficiencies -// BH 7/24/2014 9:02:18 AM most browsers do not support String.codePointAt() -// BH 7/11/2014 4:17:22 PM fix for Boolean.valueOf("false") not being false -// BH 5/27/2014 6:29:59 AM ensure floats and doubles have decimal point in toString -// BH 4/1/2014 12:23:41 PM Encoding moved to Clazz._Encoding; -// BH 4/1/2014 7:51:46 AM removing java.lang.B00lean -// BH 3/7/2014 9:17:10 AM removing Array.toString; moving that code here from j2sJmol.js -// BH 1/30/2014 9:04:25 AM adding Throwable.getStackTrace() as a STRING -// BH 12/4/2013 9:20:44 PM fix for reassigning Date.prototype.toString() -// BH 12/3/2013 11:43:10 AM bizarre Safari bug in reassigning Boolean (OK, I admit, we shouldn't have done that...) -// BH 12/1/2013 6:50:16 AM evit Number.prototype.toString assignment removed! -// BH 11/30/2013 1:46:31 PM fixing Byte, Short, Long, Integer, Float, Double to reflect proper bounds and error conditions -// BH 11/29/2013 8:58:49 PM removing Boolean.toString(boolean) -// BH 11/4/2013 7:34:26 AM changing "var nativeClazz" to "var nativeClass" to avoid ANT replacement of "nativeClazz_" to "nativeClazz_" -// BH 10/19/2013 1:29:27 PM fixed String.$replace() -// BH 10/18/2013 6:09:23 PM fixed (Double|Float).valueOf(NaN).valueOf(), which should return NaN, not throw an error -// BH 10/12/2013 11:18:44 AM fixed bug in Double(String) and Float(String) that was returning typeof "string" -// BH 10/10/2013 2:40:20 PM added Math.log10 -// BH 7/23/2013 7:24:01 AM fixing Number.shortValue() and Number.byteValue() for negative values -// BH 6/16/2013 1:31:30 PM adding /| in String.replace -- thank you David Koes -// BH 3/13/2013 12:49:23 PM setting Boolean.valueOf() "@" -// BH 3/2/2013 10:46:45 PM removed Double.valueOf(String) -// BH 11/6/2012 8:26:33 PM added instanceof Int32Array in String.instantialize -// BH 10/13/2012 11:38:07 PM corrected Integer.parseInt to allow only +-0123456789; created Integer.parseIntRadix -// BH 11/1/2012 added Short -// BH 9/10/2012 6:27:21 AM added java.net.URL... classes -// BH 1/7/2013 7:40:06 AM added Clazz_dateToString - -;(function(Clazz) { - -// moved here from package.js -// these classes will be created as objects prior to any others -// and are then available immediately - - Clazz._Loader.registerPackages("java", [ "io", "lang", "lang.reflect", "util" ]); - - var sJU = "java.util"; - - //var sJU = "JU"; - //Clazz._Loader.registerPackages (sJU, ["regex", "zip"]); - //var javautil = JU; - - var javautil = java.util; - - Clazz._Loader.ignore([ - "net.sf.j2s.ajax.HttpRequest", - sJU + ".MapEntry.Type", - //"java.net.UnknownServiceException", - "java.lang.Runtime", - "java.security.AccessController", - "java.security.PrivilegedExceptionAction", - "java.io.File", - "java.io.FileInputStream", - "java.io.FileWriter", - "java.io.OutputStreamWriter", -// sJU + ".Calendar", // bypassed in ModelCollection -// "java.text.SimpleDateFormat", // not used -// "java.text.DateFormat", // not used - sJU + ".concurrent.Executors" - ]) - -Math.rint = Math.round; - -Math.log10||(Math.log10=function(a){return Math.log(a)/2.302585092994046}); - -if(Clazz._supportsNativeObject){ - // Number and Array are special -- do not override prototype.toString -- "length - 2" here - for(var i=0;i 0 ? x - 0x10000 : x); -}); - -Clazz_defineMethod(Number,"byteValue", -function(){ -var x = Math.round(this)&0xff; -return (this < 0 && x > 0 ? x - 0x100 : x); -}); - -Clazz_defineMethod(Number,"intValue", -function(){ -return Math.round(this)&0xffffffff; -}); - -Clazz_defineMethod(Number,"longValue", -function(){ -return Math.round(this); -}); - -Clazz_defineMethod(Number,"floatValue", -function(){ -return this.valueOf(); -}); -Clazz_defineMethod(Number,"doubleValue", -function(){ -return parseFloat(this.valueOf()); -}); - -Clazz_overrideMethod(Number,"hashCode", -function(){ -return this.valueOf(); -}); - -java.lang.Integer=Integer=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Integer,"Integer",Number,Comparable,null,true); -Integer.prototype.valueOf=function(){return 0;}; -Integer.toString=Integer.prototype.toString=function(){ -if(arguments.length!=0){ -return""+arguments[0]; -} else if(this===Integer){ -return"class java.lang.Integer"; -} -return""+this.valueOf(); -}; - -/* - -Clazz_makeConstructor(Integer, -function(){ -this.valueOf=function(){ -return 0; -}; -}); -*/ - - -Clazz_overrideConstructor(Integer, function(v){ - v == null && (v = 0); - if (typeof v != "number") - v = Integer.parseIntRadix(v, 10); - this.valueOf=function(){return v;}; -}); //BH -/* -Clazz_makeConstructor(Integer, -function(s){ -var value=Integer.parseInt(s,10); -this.valueOf=function(){ -return value; -}; -},"String"); -*/ -Integer.MIN_VALUE=Integer.prototype.MIN_VALUE=-0x80000000; -Integer.MAX_VALUE=Integer.prototype.MAX_VALUE=0x7fffffff; -Integer.TYPE=Integer.prototype.TYPE=Integer; - - -Clazz_defineMethod(Integer,"bitCount", -function(i) { - i = i - ((i >>> 1) & 0x55555555); - i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); - i = (i + (i >>> 4)) & 0x0f0f0f0f; - i = i + (i >>> 8); - i = i + (i >>> 16); - return i & 0x3f; -},"Number"); -Integer.bitCount=Integer.prototype.bitCount; - -Clazz_defineMethod(Integer,"numberOfLeadingZeros", -function(i) { - if (i == 0) return 32; - var n = 1; - if (i >>> 16 == 0) { n += 16; i <<= 16; } - if (i >>> 24 == 0) { n += 8; i <<= 8; } - if (i >>> 28 == 0) { n += 4; i <<= 4; } - if (i >>> 30 == 0) { n += 2; i <<= 2; } - n -= i >>> 31; - return n; -},"Number"); -Integer.numberOfLeadingZeros=Integer.prototype.numberOfLeadingZeros; - -Clazz_defineMethod(Integer,"numberOfTrailingZeros", -function(i) { - if (i == 0) return 32; - var n = 31; - var y = i <<16; if (y != 0) { n = n -16; i = y; } - y = i << 8; if (y != 0) { n = n - 8; i = y; } - y = i << 4; if (y != 0) { n = n - 4; i = y; } - y = i << 2; if (y != 0) { n = n - 2; i = y; } - return n - ((i << 1) >>> 31); -},"Number"); -Integer.numberOfTrailingZeros=Integer.prototype.numberOfTrailingZeros; - -Clazz_defineMethod(Integer,"parseIntRadix", -function(s,radix){ -if(s==null){ -throw new NumberFormatException("null"); -}if(radix<2){ -throw new NumberFormatException("radix "+radix+" less than Character.MIN_RADIX"); -}if(radix>36){ -throw new NumberFormatException("radix "+radix+" greater than Character.MAX_RADIX"); -} -if (radix == 10) { - for (var i = s.length; --i >= 0;) { - var c = s.charCodeAt(i); - if (c >= 48 && c <= 57) continue; - if (i > 0 || c != 43 && c != 45) - throw new NumberFormatException("Not a Number : "+s); - - } -} -var i=parseInt(s,radix); -if(isNaN(i)){ -throw new NumberFormatException("Not a Number : "+s); -} -return i; -},"String, Number"); -Integer.parseIntRadix=Integer.prototype.parseIntRadix; - -Clazz_defineMethod(Integer,"parseInt", -function(s){ -return Integer.parseIntRadix(s,10); -},"String"); -Integer.parseInt=Integer.prototype.parseInt; - -/* -Clazz_defineMethod(Integer,"$valueOf", -function(s){ -return new Integer(Integer.parseIntRadix(s,10)); -},"String"); -*/ - -Clazz_overrideMethod(Integer,"$valueOf", -function(s){ -return new Integer(s); -}); - -/* -Clazz_defineMethod(Integer,"$valueOf", -function(s,r){ -return new Integer(Integer.parseIntRadix(s,r)); -},"String, Number"); -*/ - -Integer.$valueOf=Integer.prototype.$valueOf; - - -Clazz_overrideMethod(Integer,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Integer)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); -Integer.toHexString=Integer.prototype.toHexString=function(d){ -if(d.valueOf)d=d.valueOf(); -if (d < 0) { -var b = d & 0xFFFFFF; -var c = ((d>>24)&0xFF); -return c._numberToString(16) + (b = "000000" + b._numberToString(16)).substring(b.length - 6); -} -return d._numberToString(16);}; -Integer.toOctalString=Integer.prototype.toOctalString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(8);}; -Integer.toBinaryString=Integer.prototype.toBinaryString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(2);}; - -Integer.decodeRaw=Clazz_defineMethod(Integer,"decodeRaw", function(n){ -if (n.indexOf(".") >= 0)n = ""; -var i = (n.startsWith("-") ? 1 : 0); -n = n.replace(/\#/, "0x").toLowerCase(); -var radix=(n.startsWith("0x", i) ? 16 : n.startsWith("0", i) ? 8 : 10); -// The general problem with parseInt is that is not strict -- ParseInt("10whatever") == 10. -// Number is strict, but Number("055") does not work, though ParseInt("055", 8) does. -// need to make sure negative numbers are negative -n = Number(n) & 0xFFFFFFFF; -return (radix == 8 ? parseInt(n, 8) : n); -},"~S"); - -Integer.decode=Clazz_defineMethod(Integer,"decode", function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n) || n < Integer.MIN_VALUE|| n > Integer.MAX_VALUE) - throw new NumberFormatException("Invalid Integer"); - return new Integer(n); -},"~S"); - -Clazz_overrideMethod(Integer,"hashCode", -function(){ -return this.valueOf(); -}); - -// Note that Long is problematic in JavaScript - -java.lang.Long=Long=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Long,"Long",Number,Comparable,null,true); -Long.prototype.valueOf=function(){return 0;}; -Long.toString=Long.prototype.toString=function(){ -if(arguments.length!=0){ -return""+arguments[0]; -}else if(this===Long){ -return"class java.lang.Long"; -} -return""+this.valueOf(); -}; - -Clazz_overrideConstructor(Long, function(v){ - v == null && (v = 0); - v = (typeof v == "number" ? Math.round(v) : Integer.parseIntRadix(v, 10)); -this.valueOf=function(){return v;}; -}); - -//Long.MIN_VALUE=Long.prototype.MIN_VALUE=-0x8000000000000000; -//Long.MAX_VALUE=Long.prototype.MAX_VALUE=0x7fffffffffffffff; -Long.TYPE=Long.prototype.TYPE=Long; - -Clazz_defineMethod(Long,"parseLong", -function(s,radix){ - return Integer.parseInt(s, radix || 10); -}); - -Long.parseLong=Long.prototype.parseLong; - -Clazz_overrideMethod(Long,"$valueOf", -function(s){ -return new Long(s); -}); -/* -Clazz_defineMethod(Long,"$valueOf", -function(s){ -return new Long(s); -},"Number"); - -Clazz_defineMethod(Long,"$valueOf", -function(s,r){ -return new Long(Long.parseLong(s,r)); -},"String, Number"); -*/ -Long.$valueOf=Long.prototype.$valueOf; -Clazz_overrideMethod(Long,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Long)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); -Long.toHexString=Long.prototype.toHexString=function(i){ -return i.toString(16); -}; -Long.toOctalString=Long.prototype.toOctalString=function(i){ -return i.toString(8); -}; -Long.toBinaryString=Long.prototype.toBinaryString=function(i){ -return i.toString(2); -}; - - -Long.decode=Clazz_defineMethod(Long,"decode", -function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n)) - throw new NumberFormatException("Invalid Long"); - return new Long(n); -},"~S"); - -java.lang.Short = Short = function () { -Clazz_instantialize (this, arguments); -}; -Clazz_decorateAsType (Short, "Short", Number, Comparable, null, true); -Short.prototype.valueOf = function () { return 0; }; -Short.toString = Short.prototype.toString = function () { - if (arguments.length != 0) { - return "" + arguments[0]; - } else if (this === Short) { - return "class java.lang.Short"; // Short.class.toString - } - return "" + this.valueOf (); -}; - -Clazz_overrideConstructor(Short, -function (v) { - v == null && (v = 0); - if (typeof v != "number") - v = Integer.parseIntRadix(v, 10); - v = v.shortValue(); - this.valueOf = function () {return v;}; -}); - - -Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768; -Short.MAX_VALUE = Short.prototype.MAX_VALUE = 32767; -Short.TYPE = Short.prototype.TYPE = Short; - -Clazz_defineMethod(Short, "parseShortRadix", -function (s, radix) { -return Integer.parseIntRadix(s, radix).shortValue(); -}, "String, Number"); -Short.parseShortRadix = Short.prototype.parseShortRadix; - -Clazz_defineMethod(Short, "parseShort", -function (s) { -return Short.parseShortRadix (s, 10); -}, "String"); - -Short.parseShort = Short.prototype.parseShort; - -/* -Clazz_defineMethod(Short, "$valueOf", -function (s) { -return new Short(Short.parseShort (s, 10)); -}, "String"); - */ - -Clazz_overrideMethod(Short, "$valueOf", -function (s) { -return new Short(s); -}); - -/* -Clazz_defineMethod(Short, "$valueOf", -function (s, r) { -return new Short(Short.parseShort (s, r)); -}, "String, Number"); - */ - -Short.$valueOf = Short.prototype.$valueOf; -Clazz_overrideMethod(Short, "equals", -function (s) { -if(s == null || !Clazz_instanceOf(s, Short) ){ - return false; -} -return s.valueOf() == this.valueOf(); -}, "Object"); -Short.toHexString = Short.prototype.toHexString = function (i) { - return i.toString (16); -}; -Short.toOctalString = Short.prototype.toOctalString = function (i) { - return i.toString (8); -}; -Short.toBinaryString = Short.prototype.toBinaryString = function (i) { - return i.toString (2); -}; -Short.decode = Clazz_defineMethod(Short, "decode", -function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n) || n < -32768|| n > 32767) - throw new NumberFormatException("Invalid Short"); - return new Short(n); -}, "~S"); - -java.lang.Byte=Byte=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Byte,"Byte",Number,Comparable,null,true); -Byte.prototype.valueOf=function(){return 0;}; -Byte.toString=Byte.prototype.toString=function(){ -if(arguments.length!=0){ -return""+arguments[0]; -}else if(this===Byte){ -return"class java.lang.Byte"; -} -return""+this.valueOf(); -}; -Clazz_makeConstructor(Byte, -function(v){ - if (typeof v != "number") - v = Integer.parseIntRadix(v, 10); - v = v.byteValue(); -this.valueOf=function(){ -return v; -}; -}); - -Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828; -Byte.MIN_VALUE=Byte.prototype.MIN_VALUE=-128; -Byte.MAX_VALUE=Byte.prototype.MAX_VALUE=127; -Byte.SIZE=Byte.prototype.SIZE=8; -Byte.TYPE=Byte.prototype.TYPE=Byte; - -Clazz_defineMethod(Byte,"parseByteRadix", -function(s,radix){ - return Integer.parseIntRadix(s, radix).byteValue(); -},"String, Number"); -Byte.parseByteRadix=Byte.prototype.parseByteRadix; - -Clazz_defineMethod(Byte,"parseByte", -function(s){ -return Byte.parseByte(s,10); -},"String"); - -Byte.parseByte=Byte.prototype.parseByte; - -Clazz_overrideMethod(Byte, "$valueOf", -function (s) { -return new Byte(s); -}); - -Byte.$valueOf=Byte.prototype.$valueOf; -Clazz_overrideMethod(Byte,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Byte)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); -Byte.toHexString=Byte.prototype.toHexString=function(i){ -return i.toString(16); -}; -Byte.toOctalString=Byte.prototype.toOctalString=function(i){ -return i.toString(8); -}; -Byte.toBinaryString=Byte.prototype.toBinaryString=function(i){ -return i.toString(2); -}; -Byte.decode=Clazz_defineMethod(Byte,"decode", -function(n){ - n = Integer.decodeRaw(n); - if (isNaN(n) || n < -128|| n > 127) - throw new NumberFormatException("Invalid Byte"); -return new Byte(n); -},"~S"); - -Clazz._floatToString = function(f) { - var s = ""+f - if (s.indexOf(".") < 0 && s.indexOf("e") < 0) - s += ".0"; - return s; -} - -java.lang.Float=Float=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Float,"Float",Number,Comparable,null,true); -Float.prototype.valueOf=function(){return 0;}; -Float.toString=Float.prototype.toString=function(){ -if(arguments.length!=0){ -return Clazz._floatToString(arguments[0]); -}else if(this===Float){ -return"class java.lang.Float"; -} -return Clazz._floatToString(this.valueOf()); -}; - -Clazz_overrideConstructor(Float, function(v){ - v == null && (v = 0); - if (typeof v != "number") - v = Number(v); - this.valueOf=function(){return v;} -}); - -Float.serialVersionUID=Float.prototype.serialVersionUID=-2671257302660747028; -Float.MIN_VALUE=Float.prototype.MIN_VALUE=3.4028235e+38; -Float.MAX_VALUE=Float.prototype.MAX_VALUE=1.4e-45; -Float.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; -Float.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; -Float.NaN=Number.NaN; -Float.TYPE=Float.prototype.TYPE=Float; - -Clazz_defineMethod(Float,"parseFloat", -function(s){ -if(s==null){ -throw new NumberFormatException("null"); -} -if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here -var floatVal=Number(s); -if(isNaN(floatVal)){ -throw new NumberFormatException("Not a Number : "+s); -} -return floatVal; -},"String"); -Float.parseFloat=Float.prototype.parseFloat; - -Clazz_overrideMethod(Float,"$valueOf", -function(s){ -return new Float(s); -}); - -Float.$valueOf=Float.prototype.$valueOf; - -Clazz_defineMethod(Float,"isNaN", -function(num){ -return isNaN(num); -},"Number"); -Float.isNaN=Float.prototype.isNaN; -Clazz_defineMethod(Float,"isInfinite", -function(num){ -return!isFinite(num); -},"Number"); -Float.isInfinite=Float.prototype.isInfinite; - -Clazz_overrideMethod(Float,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Float)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); - -java.lang.Double=Double=function(){ -Clazz_instantialize(this,arguments); -}; -Clazz_decorateAsType(Double,"Double",Number,Comparable,null,true); -Double.prototype.valueOf=function(){return 0;}; -Double.toString=Double.prototype.toString=function(){ -if(arguments.length!=0){ -return Clazz._floatToString(arguments[0]); -}else if(this===Double){ -return"class java.lang.Double"; -} -return Clazz._floatToString(this.valueOf()); -}; - -Clazz_overrideConstructor(Double, function(v){ - v == null && (v = 0); - if (typeof v != "number") - v = Double.parseDouble(v); - this.valueOf=function(){return v;}; -}); // BH - -Double.serialVersionUID=Double.prototype.serialVersionUID=-9172774392245257468; -Double.MIN_VALUE=Double.prototype.MIN_VALUE=4.9e-324; -Double.MAX_VALUE=Double.prototype.MAX_VALUE=1.7976931348623157e+308; -Double.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; -Double.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; -Double.NaN=Number.NaN; -Double.TYPE=Double.prototype.TYPE=Double; - -Clazz_defineMethod(Double,"isNaN", -function(num){ -return isNaN(num); -},"Number"); -Double.isNaN=Double.prototype.isNaN; -Clazz_defineMethod(Double,"isInfinite", -function(num){ -return!isFinite(num); -},"Number"); -Double.isInfinite=Double.prototype.isInfinite; - -Clazz_defineMethod(Double,"parseDouble", -function(s){ -if(s==null){ -throw new NumberFormatException("null"); -} -if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here -var doubleVal=Number(s); -if(isNaN(doubleVal)){ -throw new NumberFormatException("Not a Number : "+s); -} -return doubleVal; -},"String"); -Double.parseDouble=Double.prototype.parseDouble; - -/* -Clazz_defineMethod(Double,"$valueOf", -function(s){ -return new Double(this.parseDouble(s)); -},"String"); -*/ - -Clazz_defineMethod(Double,"$valueOf", -function(v){ -return new Double(v); -},"Number"); - -Double.$valueOf=Double.prototype.$valueOf; - -Clazz_overrideMethod(Double,"equals", -function(s){ -if(s==null||!Clazz_instanceOf(s,Double)){ -return false; -} -return s.valueOf()==this.valueOf(); -},"Object"); - - -//java.lang.B00lean = Boolean; ?? BH why this? -Boolean = java.lang.Boolean = Boolean || function () {Clazz_instantialize (this, arguments);}; -if (Clazz._supportsNativeObject) { - for (var i = 0; i < Clazz._extendedObjectMethods.length; i++) { - var p = Clazz._extendedObjectMethods[i]; - Boolean.prototype[p] = Clazz._O.prototype[p]; - } -} -Boolean.__CLASS_NAME__="Boolean"; -Clazz_implementOf(Boolean,[java.io.Serializable,java.lang.Comparable]); -Boolean.equals=Clazz._innerFunctions.equals; -Boolean.getName=Clazz._innerFunctions.getName; -Boolean.serialVersionUID=Boolean.prototype.serialVersionUID=-3665804199014368530; - -//Clazz_makeConstructor(Boolean, -//function(value){ -//this.valueOf=function(){ -//return value; -//}; -//},"~B"); - -Clazz_overrideConstructor(Boolean, -function(s){ - var b = ((typeof s == "string" ? Boolean.toBoolean(s) : s) ? true : false); - this.valueOf=function(){return b;}; -},"~O"); - -Boolean.parseBoolean=Clazz_defineMethod(Boolean,"parseBoolean", -function(s){ -return Boolean.toBoolean(s); -},"~S"); -Clazz_defineMethod(Boolean,"booleanValue", -function(){ -return this.valueOf(); -}); -Boolean.$valueOf=Clazz_overrideMethod(Boolean,"$valueOf", -function(b){ -return((typeof b == "string"? "true".equalsIgnoreCase(b) : b)?Boolean.TRUE:Boolean.FALSE); -}); - -/* -Boolean.toString=Clazz_defineMethod(Boolean,"toString", -function(b){ -return b?"true":"false"; -},"~B"); -*/ - -Clazz_overrideMethod(Boolean,"toString", -function(){ -return this.valueOf()?"true":"false"; -}); -Clazz_overrideMethod(Boolean,"hashCode", -function(){ -return this.valueOf()?1231:1237; -}); -Clazz_overrideMethod(Boolean,"equals", -function(obj){ -if(Clazz_instanceOf(obj,Boolean)){ -return this.booleanValue()==obj.booleanValue(); -}return false; -},"~O"); -Boolean.getBoolean=Clazz_defineMethod(Boolean,"getBoolean", -function(name){ -var result=false; -try{ -result=Boolean.toBoolean(System.getProperty(name)); -}catch(e){ -if(Clazz_instanceOf(e,IllegalArgumentException)){ -}else if(Clazz_instanceOf(e,NullPointerException)){ -}else{ -throw e; -} -} -return result; -},"~S"); -Clazz_overrideMethod(Boolean,"compareTo", -function(b){ -return(b.value==this.value?0:(this.value?1:-1)); -},"Boolean"); -Boolean.toBoolean=Clazz_defineMethod(Boolean,"toBoolean", -($fz=function(name){ -return((name!=null)&&name.equalsIgnoreCase("true")); -},$fz.isPrivate=true,$fz),"~S"); -Boolean.TRUE=Boolean.prototype.TRUE=new Boolean(true); -Boolean.FALSE=Boolean.prototype.FALSE=new Boolean(false); -Boolean.TYPE=Boolean.prototype.TYPE=Boolean; - - -Clazz._Encoding=new Object(); - -(function(Encoding) { - -Encoding.UTF8="utf-8"; -Encoding.UTF16="utf-16"; -Encoding.ASCII="ascii"; - - -Encoding.guessEncoding=function(str){ -if(str.charCodeAt(0)==0xEF&&str.charCodeAt(1)==0xBB&&str.charCodeAt(2)==0xBF){ -return Encoding.UTF8; -}else if(str.charCodeAt(0)==0xFF&&str.charCodeAt(1)==0xFE){ -return Encoding.UTF16; -}else{ -return Encoding.ASCII; -} -}; - -Encoding.readUTF8=function(str){ -var encoding=this.guessEncoding(str); -var startIdx=0; -if(encoding==Encoding.UTF8){ -startIdx=3; -}else if(encoding==Encoding.UTF16){ -startIdx=2; -} -var arrs=new Array(); -for(var i=startIdx;i0xc0&&charCode<0xe0){ -var c1=charCode&0x1f; -i++; -var c2=str.charCodeAt(i)&0x3f; -var c=(c1<<6)+c2; -arrs[arrs.length]=String.fromCharCode(c); -}else if(charCode>=0xe0){ -var c1=charCode&0x0f; -i++; -var c2=str.charCodeAt(i)&0x3f; -i++; -var c3=str.charCodeAt(i)&0x3f; -var c=(c1<<12)+(c2<<6)+c3; -arrs[arrs.length]=String.fromCharCode(c); -} -} -return arrs.join(''); -}; - -Encoding.convert2UTF8=function(str){ -var encoding=this.guessEncoding(str); -var startIdx=0; -if(encoding==Encoding.UTF8){ -return str; -}else if(encoding==Encoding.UTF16){ -startIdx=2; -} - -var offset=0; -var arrs=new Array(offset+str.length-startIdx); - -for(var i=startIdx;i>6); -var c2=0x80+(charCode&0x003f); -arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2); -}else{ -var c1=0xe0+((charCode&0xf000)>>12); -var c2=0x80+((charCode&0x0fc0)>>6); -var c3=0x80+(charCode&0x003f); -arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2)+String.fromCharCode(c3); -} -} -return arrs.join(''); -}; -Encoding.base64Chars=new Array( -'A','B','C','D','E','F','G','H', -'I','J','K','L','M','N','O','P', -'Q','R','S','T','U','V','W','X', -'Y','Z','a','b','c','d','e','f', -'g','h','i','j','k','l','m','n', -'o','p','q','r','s','t','u','v', -'w','x','y','z','0','1','2','3', -'4','5','6','7','8','9','+','/' -); -Encoding.encodeBase64=function(str){ -if(str==null||str.length==0)return str; -var b64=Encoding.base64Chars; -var length=str.length; -var index=0; -var buf=[]; -var c0,c1,c2; -while(index>2]; -if(index>4)]; -if(index>6)]; -buf[buf.length]=b64[c2&0x3F]; -}else{ -buf[buf.length]=b64[((c1<<2)&0x3c)]; -buf[buf.length]='='; -} -}else{ -buf[buf.length]=b64[(c0<<4)&0x30]; -buf[buf.length]='='; -buf[buf.length]='='; -} -} -return buf.join(''); -}; -Encoding.decodeBase64=function(str){ -if(str==null||str.length==0)return str; -var b64=Encoding.base64Chars; -var xb64=Encoding.xBase64Chars; -if(Encoding.xBase64Chars==null){ -xb64=new Object(); -for(var i=0;i>4); -if(c2!=null){ -buf[buf.length]=String.fromCharCode(((c1<<4)&0xff)|c2>>2); -if(c3!=null){ -buf[buf.length]=String.fromCharCode(((c2<<6)&0xff)|c3); -} -} -} -return buf.join(''); -}; - -if(String.prototype.$replace==null){ -java.lang.String=String; -if(Clazz._supportsNativeObject){ -for(var i=0;i= 0) c1 = "\\" + c1; - } else { - c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return"\\"+$1;}); - } - return this.replace(new RegExp(c1,"gm"),c2); -}; -sp.$generateExpFunction=function(str){ -var arr=[]; -var orders=[]; -var idx=0; -arr[0]=""; -var i=0; -for(;ithis.length-len)|| -(ooffset>other.length-len)){ -return false; -} -var s1=this.substring(toffset,toffset+len); -var s2=other.substring(ooffset,ooffset+len); -if(ignoreCase){ -s1=s1.toLowerCase(); -s2=s2.toLowerCase(); -} -return s1==s2; -}; - - - -sp.$plit=function(regex,limit){ -if (!limit && regex == " ") - return this.split(regex); - -if(limit!=null&&limit>0){ -if(limit==1){ -return this; -} -var regExp=new RegExp("("+regex+")","gm"); -var count=1; -var s=this.replace(regExp,function($0,$1){ -count++; -if(count==limit){ -return"@@_@@"; -}else if(count>limit){ -return $0; -}else{ -return $0; -} -}); -regExp=new RegExp(regex,"gm"); -var arr=this.split(regExp); -if(arr.length>limit){ -arr[limit-1]=s.substring(s.indexOf("@@_@@")+5); -arr.length=limit; -} -return arr; -}else{ -var regExp=new RegExp(regex,"gm"); -return this.split(regExp); -} -}; -/* -sp.trim=function(){ -var len=this.length; -var st=0; - -while((st0)||(lens.length-pc)){ -return false; -} -while(--pc>=0){ -if(s.charAt(to++)!=prefix.charAt(po++)){ -return false; -} -} -return true; -}; - -sp.startsWith=function(prefix){ -if(arguments.length==1){ -return sn(this,arguments[0],0); -}else if(arguments.length==2){ -return sn(this,arguments[0],arguments[1]); -}else{ -return false; -} -}; - -sp.endsWith=function(suffix){ -return sn(this, suffix,this.length-suffix.length); -}; - -} - -sp.equals=function(anObject){ -return this.valueOf()==anObject; -}; - -sp.equalsIgnoreCase=function(anotherString){ -return(anotherString==null)?false:(this==anotherString -||this.toLowerCase()==anotherString.toLowerCase()); -}; - - -sp.hash=0; - -sp.hashCode=function(){ -var h=this.hash; -if(h==0){ -var off=0; -var len=this.length; -for(var i=0;i255){ -arrs[ii]=0x1a; -arrs[ii+1]=c&0xff; -arrs[ii+2]=(c&0xff00)>>8; -ii+=2; -}else{ -arrs[ii]=c; -} -ii++; -} -return arrs; -}; - -/* -sp.compareTo=function(anotherString){ -if(anotherString==null){ -throw new java.lang.NullPointerException(); -} -var len1=this.length; -var len2=anotherString.length; -var n=Math.min(len1,len2); -var k=0; -while(k= 0} // bh added -sp.compareTo = function(a){return this > a ? 1 : this < a ? -1 : 0} // bh added - - - -sp.toCharArray=function(){ -var result=new Array(this.length); -for(var i=0;is2){ -return 1; -}else{ -return-1; -} -} -}; - -sp.contentEquals=function(sb){ -if(this.length!=sb.length()){ -return false; -} -var v=sb.getValue(); -var i=0; -var j=0; -var n=this.length; -while(n--!=0){ -if(this.charCodeAt(i++)!=v[j++]){ -return false; -} -} -return true; -}; - -sp.getChars=function(srcBegin,srcEnd,dst,dstBegin){ -if(srcBegin<0){ -throw new StringIndexOutOfBoundsException(srcBegin); -} -if(srcEnd>this.length){ -throw new StringIndexOutOfBoundsException(srcEnd); -} -if(srcBegin>srcEnd){ -throw new StringIndexOutOfBoundsException(srcEnd-srcBegin); -} -if(dst==null){ -throw new NullPointerException(); -} -for(var i=0;i=sourceCount){ -return(targetCount==0?sourceCount:-1); -} -if(fromIndex<0){ -fromIndex=0; -} -if(targetCount==0){ -return fromIndex; -} - -var first=target[targetOffset]; -var i=sourceOffset+fromIndex; -var max=sourceOffset+(sourceCount-targetCount); - -startSearchForFirstChar: -while(true){ - -while(i<=max&&source[i]!=first){ -i++; -} -if(i>max){ -return-1; -} - - -var j=i+1; -var end=j+targetCount-1; -var k=targetOffset+1; -while(j0&&typeof x[0]=="number"){ -var arr=new Array(x.length); -for(var i=0;ibytes.length){ -throw new IndexOutOfBoundsException(); -} -if(length>0){ -var isChar=(bytes[offset].length!=null); -if(isChar){ -for(var i=0;i0;){ -value[i]=String.fromCharCode(bytes[i+offset]&0xff); -} -}else{ -hibyte<<=8; -for(var i=count;i-->0;){ -value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); -} -} -return value.join(''); -} -}else{ -var s=""; -for(var i=0;ibytes.length){ - throw new IndexOutOfBoundsException(); - } - if(length>0){ - var isChar=(bytes[offset].length!=null); - if(isChar){ - for(var i=0;i0;){ - value[i]=String.fromCharCode(bytes[i+offset]&0xff); - } - }else{ - hibyte<<=8; - for(var i=count;i-->0;){ - value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); - } - } - return value.join(''); -default: - var s=""; - for(var i=0;i= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd || c == 0x1680 - || c >= 0x2000 && c != 0x2007 && (c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000)); -},"~N"); -c$.isLetter=Clazz_defineMethod(c$,"isLetter", -function(c){ -c = c.charCodeAt(0); -return (65 <= c && c <= 90 || 97 <= c && c <= 122); -},"~N"); -c$.isLetterOrDigit=Clazz_defineMethod(c$,"isLetterOrDigit", -function(c){ -c = c.charCodeAt(0); -return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57); -},"~N"); -c$.isSpaceChar=Clazz_defineMethod(c$,"isSpaceChar", -function(c){ - var i = c.charCodeAt(0); -if(i==0x20||i==0xa0||i==0x1680)return true; -if(i<0x2000)return false; -return i<=0x200b||i==0x2028||i==0x2029||i==0x202f||i==0x3000; -},"~N"); -c$.digit=Clazz_defineMethod(c$,"digit", -function(c,radix){ -var i = c.charCodeAt(0); -if(radix >= 2 && radix <= 36){ - if(i < 128){ - var result = -1; - if(48 <= i && i <= 57){ - result = i - 48; - }else if(97 <= i && i <= 122){ - result = i - 87; - }else if(65 <= i && i <= 90){ - result=i-(55); - } - return (result < radix ? result : -1); - } -} -return -1; -},"~N,~N"); -Clazz_overrideMethod(c$,"toString", -function(){ -var buf=[this.value]; -return String.valueOf(buf); -}); -c$.toString=Clazz_overrideMethod(c$,"toString", -function(c){ -{ -if(this===Character){ -return"class java.lang.Character"; -} -}return String.valueOf(c); -},"~N"); -Clazz_defineStatics(c$, -"MIN_VALUE",'\u0000', -"MAX_VALUE",'\uffff', -"MIN_RADIX",2, -"MAX_RADIX",36, -"TYPE",null); - -java.lang.Character.TYPE=java.lang.Character.prototype.TYPE=java.lang.Character; - - - -Clazz._ArrayWrapper = function(a, type) { - return { - a: a, - __CLASS_NAME__:"Array", - superClazz: Array, - getComponentType: function() {return type}, - instanceOf: function(o) { return Clazz_instanceOf(type, o) }, - getName: function() { return this.__CLASS_NAME__ } - }; -} -c$=Clazz_declareType(java.lang.reflect,"Array"); -c$.newInstance=Clazz_defineMethod(c$,"newInstance", -function(componentType,size){ -var a = Clazz_newArray(size); - a.getClass = function() { return new Clazz._ArrayWrapper(this, componentType);}; -return a; -},"Class,~N"); - -javautil.Date=Date; -Date.TYPE="javautil.Date"; -Date.__CLASS_NAME__="Date"; -Clazz_implementOf(Date,[java.io.Serializable,java.lang.Comparable]); - -Clazz_defineMethod(javautil.Date,"clone", -function(){ -return new Date(this.getTime()); -}); - -Clazz_defineMethod(javautil.Date,"before", -function(when){ -return this.getTime()when.getTime(); -},"javautil.Date"); -Clazz_defineMethod(javautil.Date,"equals", -function(obj){ -return Clazz_instanceOf(obj,javautil.Date)&&this.getTime()==(obj).getTime(); -},"Object"); -Clazz_defineMethod(javautil.Date,"compareTo", -function(anotherDate){ -var thisTime=this.getTime(); -var anotherTime=anotherDate.getTime(); -return(thisTime>32)); -}); - -c$=Clazz_decorateAsClass(function(){ -this.source=null; -Clazz_instantialize(this,arguments); -},javautil,"EventObject",null,java.io.Serializable); -Clazz_makeConstructor(c$, -function(source){ -if(source!=null)this.source=source; -else throw new IllegalArgumentException(); -},"~O"); -Clazz_defineMethod(c$,"getSource", -function(){ -return this.source; -}); -Clazz_overrideMethod(c$,"toString", -function(){ -return this.getClass().getName()+"[source="+String.valueOf(this.source)+']'; -}); -Clazz_declareInterface(javautil,"EventListener"); - -c$=Clazz_decorateAsClass(function(){ -this.listener=null; -Clazz_instantialize(this,arguments); -},javautil,"EventListenerProxy",null,javautil.EventListener); -Clazz_makeConstructor(c$, -function(listener){ -this.listener=listener; -},"javautil.EventListener"); -Clazz_defineMethod(c$,"getListener", -function(){ -return this.listener; -}); -Clazz_declareInterface(javautil,"Iterator"); - -Clazz_declareInterface(javautil,"ListIterator",javautil.Iterator); -Clazz_declareInterface(javautil,"Enumeration"); -Clazz_declareInterface(javautil,"Collection",Iterable); - -Clazz_declareInterface(javautil,"Set",javautil.Collection); -Clazz_declareInterface(javautil,"Map"); -Clazz_declareInterface(javautil.Map,"Entry"); - -Clazz_declareInterface(javautil,"List",javautil.Collection); - -Clazz_declareInterface(javautil,"Queue",javautil.Collection); -Clazz_declareInterface(javautil,"RandomAccess"); -c$=Clazz_decorateAsClass(function(){ -this.detailMessage=null; -this.cause=null; -this.stackTrace=null; -Clazz_instantialize(this,arguments); -},java.lang,"Throwable",null,java.io.Serializable); -Clazz_prepareFields(c$,function(){ -this.cause=this; -//alert("e0 "+ arguments.callee.caller.caller.caller.caller.caller) -}); -Clazz_makeConstructor(c$, -function(){ -this.fillInStackTrace(); -}); -Clazz_makeConstructor(c$, -function(message){ -this.fillInStackTrace(); -this.detailMessage=message; -},"~S"); -Clazz_makeConstructor(c$, -function(message,cause){ -this.fillInStackTrace(); -this.detailMessage=message; -this.cause=cause; -},"~S,Throwable"); -Clazz_makeConstructor(c$, -function(cause){ -this.fillInStackTrace(); -this.detailMessage=(cause==null?null:cause.toString()); -this.cause=cause; -},"Throwable"); -Clazz_defineMethod(c$,"getMessage", -function(){ -return (this.message || this.detailMessage || this.toString()); -}); -Clazz_defineMethod(c$,"getLocalizedMessage", -function(){ -return this.getMessage(); -}); -Clazz_defineMethod(c$,"getCause", -function(){ -return(this.cause===this?null:this.cause); -}); -Clazz_defineMethod(c$,"initCause", -function(cause){ -if(this.cause!==this)throw new IllegalStateException("Can't overwrite cause"); -if(cause===this)throw new IllegalArgumentException("Self-causation not permitted"); -this.cause=cause; -return this; -},"Throwable"); -Clazz_overrideMethod(c$,"toString", -function(){ -var s=this.getClass().getName(); -var message=this.message || this.detailMessage; -return(message ? s+": "+message : s); -}); -Clazz_defineMethod(c$,"printStackTrace", -function(){ -System.err.println(this.getStackTrace ? this.getStackTrace() : this.message + " " + Clazz_getStackTrace()); -}); - -Clazz_defineMethod(c$,"getStackTrace", -function(){ -var s = "" + this + "\n"; -for(var i=0;i-1||caller!=null){ -var clazzName=null; -var nativeClass=null; -if(!noLooping||caller==Clazz_tryToSearchAndExecute||caller==Clazz_superCall||caller==null){ -if(index<0){ -break; -} -noLooping=true; -superCaller=Clazz._callingStackTraces[index].caller; -nativeClass=Clazz._callingStackTraces[index].owner; -index--; -}else{ -superCaller=caller; -if(superCaller.claxxOwner!=null){ -nativeClass=superCaller.claxxOwner; -}else if(superCaller.exClazz!=null){ -nativeClass=superCaller.exClazz; -} -} -var st=new StackTraceElement( -((nativeClass!=null&&nativeClass.__CLASS_NAME__.length!=0)? -nativeClass.__CLASS_NAME__:"anonymous"), -((superCaller.exName==null)?"anonymous":superCaller.exName) -+" ("+Clazz_getParamsType(superCaller.arguments)+")", -null,-1); -st.nativeClazz=nativeClass; -this.stackTrace[this.stackTrace.length]=st; -for(var i=0;i":this.declaringClass; -}); -Clazz_defineMethod(c$,"getFileName", -function(){ -return this.fileName; -}); -Clazz_defineMethod(c$,"getLineNumber", -function(){ -return this.lineNumber; -}); -Clazz_defineMethod(c$,"getMethodName", -function(){ -return(this.methodName==null)?"":this.methodName; -}); -Clazz_overrideMethod(c$,"hashCode", -function(){ -if(this.methodName==null){ -return 0; -}return this.methodName.hashCode()^this.declaringClass.hashCode(); -}); -Clazz_defineMethod(c$,"isNativeMethod", -function(){ -return this.lineNumber==-2; -}); -Clazz_overrideMethod(c$,"toString", -function(){ -var buf=new StringBuilder(80); -buf.append(this.getClassName()); -buf.append('.'); -buf.append(this.getMethodName()); -if(this.isNativeMethod()){ -buf.append("(Native Method)"); -}else{ -var fName=this.getFileName(); -if(fName==null){ -buf.append("(Unknown Source)"); -}else{ -var lineNum=this.getLineNumber(); -buf.append('('); -buf.append(fName); -if(lineNum>=0){ -buf.append(':'); -buf.append(lineNum); -}buf.append(')'); -}}return buf.toString(); -}); -TypeError.prototype.getMessage || (TypeError.prototype.getMessage = function(){ return (this.message || this.toString()) + (this.getStackTrace ? this.getStackTrace() : Clazz_getStackTrace())}); -c$=Clazz_declareType(java.lang,"Error",Throwable); - -c$=Clazz_declareType(java.lang,"LinkageError",Error); - -c$=Clazz_declareType(java.lang,"IncompatibleClassChangeError",LinkageError); - -c$=Clazz_declareType(java.lang,"AbstractMethodError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"AssertionError",Error); -Clazz_makeConstructor(c$, -function(detailMessage){ -Clazz_superConstructor(this,AssertionError,[String.valueOf(detailMessage),(Clazz_instanceOf(detailMessage,Throwable)?detailMessage:null)]); -},"~O"); -Clazz_makeConstructor(c$, -function(detailMessage){ -this.construct("" + detailMessage); -},"~B"); -Clazz_makeConstructor(c$, -function(detailMessage){ -this.construct("" + detailMessage); -},"~N"); - -c$=Clazz_declareType(java.lang,"ClassCircularityError",LinkageError); - -c$=Clazz_declareType(java.lang,"ClassFormatError",LinkageError); - -c$=Clazz_decorateAsClass(function(){ -this.exception=null; -Clazz_instantialize(this,arguments); -},java.lang,"ExceptionInInitializerError",LinkageError); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,ExceptionInInitializerError); -this.initCause(null); -}); -Clazz_makeConstructor(c$, -function(detailMessage){ -Clazz_superConstructor(this,ExceptionInInitializerError,[detailMessage]); -this.initCause(null); -},"~S"); -Clazz_makeConstructor(c$, -function(exception){ -Clazz_superConstructor(this,ExceptionInInitializerError); -this.exception=exception; -this.initCause(exception); -},"Throwable"); -Clazz_defineMethod(c$,"getException", -function(){ -return this.exception; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.exception; -}); - -c$=Clazz_declareType(java.lang,"IllegalAccessError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"InstantiationError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"VirtualMachineError",Error); - -c$=Clazz_declareType(java.lang,"InternalError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"NoClassDefFoundError",LinkageError); - -c$=Clazz_declareType(java.lang,"NoSuchFieldError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"NoSuchMethodError",IncompatibleClassChangeError); - -c$=Clazz_declareType(java.lang,"OutOfMemoryError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"StackOverflowError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"UnknownError",VirtualMachineError); - -c$=Clazz_declareType(java.lang,"UnsatisfiedLinkError",LinkageError); - -c$=Clazz_declareType(java.lang,"UnsupportedClassVersionError",ClassFormatError); - -c$=Clazz_declareType(java.lang,"VerifyError",LinkageError); - -c$=Clazz_declareType(java.lang,"ThreadDeath",Error); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,ThreadDeath,[]); -}); - -c$=Clazz_declareType(java.lang,"Exception",Throwable); - -c$=Clazz_declareType(java.lang,"RuntimeException",Exception); - -c$=Clazz_declareType(java.lang,"ArithmeticException",RuntimeException); - -c$=Clazz_declareType(java.lang,"IndexOutOfBoundsException",RuntimeException); - -c$=Clazz_declareType(java.lang,"ArrayIndexOutOfBoundsException",IndexOutOfBoundsException); -Clazz_makeConstructor(c$, -function(index){ -Clazz_superConstructor(this,ArrayIndexOutOfBoundsException,["Array index out of range: "+index]); -},"~N"); - -c$=Clazz_declareType(java.lang,"ArrayStoreException",RuntimeException); - -c$=Clazz_declareType(java.lang,"ClassCastException",RuntimeException); - -c$=Clazz_decorateAsClass(function(){ -this.ex=null; -Clazz_instantialize(this,arguments); -},java.lang,"ClassNotFoundException",Exception); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,ClassNotFoundException,[Clazz_castNullAs("Throwable")]); -}); -Clazz_makeConstructor(c$, -function(detailMessage){ -Clazz_superConstructor(this,ClassNotFoundException,[detailMessage,null]); -},"~S"); -Clazz_makeConstructor(c$, -function(detailMessage,exception){ -Clazz_superConstructor(this,ClassNotFoundException,[detailMessage]); -this.ex=exception; -},"~S,Throwable"); -Clazz_defineMethod(c$,"getException", -function(){ -return this.ex; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.ex; -}); - -c$=Clazz_declareType(java.lang,"CloneNotSupportedException",Exception); - -c$=Clazz_declareType(java.lang,"IllegalAccessException",Exception); - -c$=Clazz_declareType(java.lang,"IllegalArgumentException",RuntimeException); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,IllegalArgumentException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_declareType(java.lang,"IllegalMonitorStateException",RuntimeException); - -c$=Clazz_declareType(java.lang,"IllegalStateException",RuntimeException); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,IllegalStateException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_declareType(java.lang,"IllegalThreadStateException",IllegalArgumentException); - -c$=Clazz_declareType(java.lang,"InstantiationException",Exception); - -c$=Clazz_declareType(java.lang,"InterruptedException",Exception); - -c$=Clazz_declareType(java.lang,"NegativeArraySizeException",RuntimeException); - -c$=Clazz_declareType(java.lang,"NoSuchFieldException",Exception); - -c$=Clazz_declareType(java.lang,"NoSuchMethodException",Exception); - -c$=Clazz_declareType(java.lang,"NullPointerException",RuntimeException); - -c$=Clazz_declareType(java.lang,"NumberFormatException",IllegalArgumentException); - -c$=Clazz_declareType(java.lang,"SecurityException",RuntimeException); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,SecurityException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_declareType(java.lang,"StringIndexOutOfBoundsException",IndexOutOfBoundsException); -Clazz_makeConstructor(c$, -function(index){ -Clazz_superConstructor(this,StringIndexOutOfBoundsException,["String index out of range: "+index]); -},"~N"); - -c$=Clazz_declareType(java.lang,"UnsupportedOperationException",RuntimeException); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,UnsupportedOperationException,[]); -}); -Clazz_makeConstructor(c$, -function(cause){ -Clazz_superConstructor(this,UnsupportedOperationException,[(cause==null?null:cause.toString()),cause]); -},"Throwable"); - -c$=Clazz_decorateAsClass(function(){ -this.target=null; -Clazz_instantialize(this,arguments); -},java.lang.reflect,"InvocationTargetException",Exception); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[Clazz_castNullAs("Throwable")]); -}); -Clazz_makeConstructor(c$, -function(exception){ -Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[null,exception]); -this.target=exception; -},"Throwable"); -Clazz_makeConstructor(c$, -function(exception,detailMessage){ -Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[detailMessage,exception]); -this.target=exception; -},"Throwable,~S"); -Clazz_defineMethod(c$,"getTargetException", -function(){ -return this.target; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.target; -}); - -c$=Clazz_decorateAsClass(function(){ -this.undeclaredThrowable=null; -Clazz_instantialize(this,arguments); -},java.lang.reflect,"UndeclaredThrowableException",RuntimeException); -Clazz_makeConstructor(c$, -function(exception){ -Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException); -this.undeclaredThrowable=exception; -this.initCause(exception); -},"Throwable"); -Clazz_makeConstructor(c$, -function(exception,detailMessage){ -Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException,[detailMessage]); -this.undeclaredThrowable=exception; -this.initCause(exception); -},"Throwable,~S"); -Clazz_defineMethod(c$,"getUndeclaredThrowable", -function(){ -return this.undeclaredThrowable; -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.undeclaredThrowable; -}); - -c$=Clazz_declareType(java.io,"IOException",Exception); - - -c$=Clazz_declareType(java.io,"CharConversionException",java.io.IOException); - -c$=Clazz_declareType(java.io,"EOFException",java.io.IOException); - -c$=Clazz_declareType(java.io,"FileNotFoundException",java.io.IOException); - -c$=Clazz_decorateAsClass(function(){ -this.bytesTransferred=0; -Clazz_instantialize(this,arguments); -},java.io,"InterruptedIOException",java.io.IOException); - -c$=Clazz_declareType(java.io,"ObjectStreamException",java.io.IOException); - -c$=Clazz_decorateAsClass(function(){ -this.classname=null; -Clazz_instantialize(this,arguments); -},java.io,"InvalidClassException",java.io.ObjectStreamException); -Clazz_makeConstructor(c$, -function(className,detailMessage){ -Clazz_superConstructor(this,java.io.InvalidClassException,[detailMessage]); -this.classname=className; -},"~S,~S"); -Clazz_defineMethod(c$,"getMessage", -function(){ -var msg=Clazz_superCall(this,java.io.InvalidClassException,"getMessage",[]); -if(this.classname!=null){ -msg=this.classname+';' + ' '+msg; -}return msg; -}); - -c$=Clazz_declareType(java.io,"InvalidObjectException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"NotActiveException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"NotSerializableException",java.io.ObjectStreamException); - -c$=Clazz_decorateAsClass(function(){ -this.eof=false; -this.length=0; -Clazz_instantialize(this,arguments); -},java.io,"OptionalDataException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"StreamCorruptedException",java.io.ObjectStreamException); - -c$=Clazz_declareType(java.io,"SyncFailedException",java.io.IOException); - -c$=Clazz_declareType(java.io,"UnsupportedEncodingException",java.io.IOException); - -c$=Clazz_declareType(java.io,"UTFDataFormatException",java.io.IOException); - -c$=Clazz_decorateAsClass(function(){ -this.detail=null; -Clazz_instantialize(this,arguments); -},java.io,"WriteAbortedException",java.io.ObjectStreamException); -Clazz_makeConstructor(c$, -function(detailMessage,rootCause){ -Clazz_superConstructor(this,java.io.WriteAbortedException,[detailMessage]); -this.detail=rootCause; -this.initCause(rootCause); -},"~S,Exception"); -Clazz_defineMethod(c$,"getMessage", -function(){ -var msg=Clazz_superCall(this,java.io.WriteAbortedException,"getMessage",[]); -return (this.detail ? msg + "; "+this.detail.toString() : msg); -}); -Clazz_overrideMethod(c$,"getCause", -function(){ -return this.detail; -}); - -c$=Clazz_declareType(javautil,"ConcurrentModificationException",RuntimeException); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,javautil.ConcurrentModificationException,[]); -}); - -c$=Clazz_declareType(javautil,"EmptyStackException",RuntimeException); - -c$=Clazz_decorateAsClass(function(){ -this.className=null; -this.key=null; -Clazz_instantialize(this,arguments); -},javautil,"MissingResourceException",RuntimeException); -Clazz_makeConstructor(c$, -function(detailMessage,className,resourceName){ -Clazz_superConstructor(this,javautil.MissingResourceException,[detailMessage]); -this.className=className; -this.key=resourceName; -},"~S,~S,~S"); -Clazz_defineMethod(c$,"getClassName", -function(){ -return this.className; -}); -Clazz_defineMethod(c$,"getKey", -function(){ -return this.key; -}); - -c$=Clazz_declareType(javautil,"NoSuchElementException",RuntimeException); - -c$=Clazz_declareType(javautil,"TooManyListenersException",Exception); - -c$=Clazz_declareType(java.lang,"Void"); -Clazz_defineStatics(c$, -"TYPE",null); -{ -java.lang.Void.TYPE=java.lang.Void; -}Clazz_declareInterface(java.lang.reflect,"GenericDeclaration"); -Clazz_declareInterface(java.lang.reflect,"AnnotatedElement"); - -c$=Clazz_declareType(java.lang.reflect,"AccessibleObject",null,java.lang.reflect.AnnotatedElement); -Clazz_makeConstructor(c$, -function(){ -}); -Clazz_defineMethod(c$,"isAccessible", -function(){ -return false; -}); -c$.setAccessible=Clazz_defineMethod(c$,"setAccessible", -function(objects,flag){ -return; -},"~A,~B"); -Clazz_defineMethod(c$,"setAccessible", -function(flag){ -return; -},"~B"); -Clazz_overrideMethod(c$,"isAnnotationPresent", -function(annotationType){ -return false; -},"Class"); -Clazz_overrideMethod(c$,"getDeclaredAnnotations", -function(){ -return new Array(0); -}); -Clazz_overrideMethod(c$,"getAnnotations", -function(){ -return new Array(0); -}); -Clazz_overrideMethod(c$,"getAnnotation", -function(annotationType){ -return null; -},"Class"); -c$.marshallArguments=Clazz_defineMethod(c$,"marshallArguments", -function(parameterTypes,args){ -return null; -},"~A,~A"); -Clazz_defineMethod(c$,"invokeV", -function(receiver,args){ -return; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeL", -function(receiver,args){ -return null; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeI", -function(receiver,args){ -return 0; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeJ", -function(receiver,args){ -return 0; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeF", -function(receiver,args){ -return 0.0; -},"~O,~A"); -Clazz_defineMethod(c$,"invokeD", -function(receiver,args){ -return 0.0; -},"~O,~A"); -c$.emptyArgs=c$.prototype.emptyArgs=new Array(0); -Clazz_declareInterface(java.lang.reflect,"InvocationHandler"); -c$=Clazz_declareInterface(java.lang.reflect,"Member"); -Clazz_defineStatics(c$, -"PUBLIC",0, -"DECLARED",1); - -c$=Clazz_declareType(java.lang.reflect,"Modifier"); -Clazz_makeConstructor(c$, -function(){ -}); -c$.isAbstract=Clazz_defineMethod(c$,"isAbstract", -function(modifiers){ -return((modifiers&1024)!=0); -},"~N"); -c$.isFinal=Clazz_defineMethod(c$,"isFinal", -function(modifiers){ -return((modifiers&16)!=0); -},"~N"); -c$.isInterface=Clazz_defineMethod(c$,"isInterface", -function(modifiers){ -return((modifiers&512)!=0); -},"~N"); -c$.isNative=Clazz_defineMethod(c$,"isNative", -function(modifiers){ -return((modifiers&256)!=0); -},"~N"); -c$.isPrivate=Clazz_defineMethod(c$,"isPrivate", -function(modifiers){ -return((modifiers&2)!=0); -},"~N"); -c$.isProtected=Clazz_defineMethod(c$,"isProtected", -function(modifiers){ -return((modifiers&4)!=0); -},"~N"); -c$.isPublic=Clazz_defineMethod(c$,"isPublic", -function(modifiers){ -return((modifiers&1)!=0); -},"~N"); -c$.isStatic=Clazz_defineMethod(c$,"isStatic", -function(modifiers){ -return((modifiers&8)!=0); -},"~N"); -c$.isStrict=Clazz_defineMethod(c$,"isStrict", -function(modifiers){ -return((modifiers&2048)!=0); -},"~N"); -c$.isSynchronized=Clazz_defineMethod(c$,"isSynchronized", -function(modifiers){ -return((modifiers&32)!=0); -},"~N"); -c$.isTransient=Clazz_defineMethod(c$,"isTransient", -function(modifiers){ -return((modifiers&128)!=0); -},"~N"); -c$.isVolatile=Clazz_defineMethod(c$,"isVolatile", -function(modifiers){ -return((modifiers&64)!=0); -},"~N"); -c$.toString=Clazz_defineMethod(c$,"toString", -function(modifiers){ -var sb=new Array(0); -if(java.lang.reflect.Modifier.isPublic(modifiers))sb[sb.length]="public"; -if(java.lang.reflect.Modifier.isProtected(modifiers))sb[sb.length]="protected"; -if(java.lang.reflect.Modifier.isPrivate(modifiers))sb[sb.length]="private"; -if(java.lang.reflect.Modifier.isAbstract(modifiers))sb[sb.length]="abstract"; -if(java.lang.reflect.Modifier.isStatic(modifiers))sb[sb.length]="static"; -if(java.lang.reflect.Modifier.isFinal(modifiers))sb[sb.length]="final"; -if(java.lang.reflect.Modifier.isTransient(modifiers))sb[sb.length]="transient"; -if(java.lang.reflect.Modifier.isVolatile(modifiers))sb[sb.length]="volatile"; -if(java.lang.reflect.Modifier.isSynchronized(modifiers))sb[sb.length]="synchronized"; -if(java.lang.reflect.Modifier.isNative(modifiers))sb[sb.length]="native"; -if(java.lang.reflect.Modifier.isStrict(modifiers))sb[sb.length]="strictfp"; -if(java.lang.reflect.Modifier.isInterface(modifiers))sb[sb.length]="interface"; -if(sb.length>0){ -return sb.join(" "); -}return""; -},"~N"); -Clazz_defineStatics(c$, -"PUBLIC",0x1, -"PRIVATE",0x2, -"PROTECTED",0x4, -"STATIC",0x8, -"FINAL",0x10, -"SYNCHRONIZED",0x20, -"VOLATILE",0x40, -"TRANSIENT",0x80, -"NATIVE",0x100, -"INTERFACE",0x200, -"ABSTRACT",0x400, -"STRICT",0x800, -"BRIDGE",0x40, -"VARARGS",0x80, -"SYNTHETIC",0x1000, -"ANNOTATION",0x2000, -"ENUM",0x4000); - -c$=Clazz_decorateAsClass(function(){ -this.clazz=null; -this.parameterTypes=null; -this.exceptionTypes=null; -this.modifiers=0; -Clazz_instantialize(this,arguments); -},java.lang.reflect,"Constructor",java.lang.reflect.AccessibleObject,[java.lang.reflect.GenericDeclaration,java.lang.reflect.Member]); -Clazz_makeConstructor(c$, -function(declaringClass,parameterTypes,checkedExceptions,modifiers){ -Clazz_superConstructor(this,java.lang.reflect.Constructor,[]); -this.clazz=declaringClass; -this.parameterTypes=parameterTypes; -this.exceptionTypes=checkedExceptions; -this.modifiers=modifiers; -},"Class,~A,~A,~N"); -Clazz_overrideMethod(c$,"getTypeParameters", -function(){ -return null; -}); -Clazz_defineMethod(c$,"toGenericString", -function(){ -return null; -}); -Clazz_defineMethod(c$,"getGenericParameterTypes", -function(){ -return null; -}); -Clazz_defineMethod(c$,"getGenericExceptionTypes", -function(){ -return null; -}); -Clazz_defineMethod(c$,"getParameterAnnotations", -function(){ -return null; -}); -Clazz_defineMethod(c$,"isVarArgs", -function(){ -return false; -}); -Clazz_overrideMethod(c$,"isSynthetic", -function(){ -return false; -}); -Clazz_overrideMethod(c$,"equals", -function(object){ -if(object!=null&&Clazz_instanceOf(object,java.lang.reflect.Constructor)){ -var other=object; -if(this.getDeclaringClass()===other.getDeclaringClass()){ -var params1=this.parameterTypes; -var params2=other.parameterTypes; -if(params1.length==params2.length){ -for(var i=0;i 0.0) { -allzero = false; -} else if (d < 0.0) { -throw new IllegalArgumentException ("negative dash length"); -}} -if (allzero) { -throw new IllegalArgumentException ("dash lengths all zero"); -}}this.width = width; -this.cap = cap; -this.join = join; -this.miterlimit = miterlimit; -if (dash != null) { -this.dash = dash.clone (); -}this.dash_phase = dash_phase; -}, "~N,~N,~N,~N,~A,~N"); -Clazz_makeConstructor (c$, -function (width, cap, join, miterlimit) { -this.construct (width, cap, join, miterlimit, null, 0.0); -}, "~N,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (width, cap, join) { -this.construct (width, cap, join, 10.0, null, 0.0); -}, "~N,~N,~N"); -Clazz_makeConstructor (c$, -function (width) { -this.construct (width, 2, 0, 10.0, null, 0.0); -}, "~N"); -Clazz_makeConstructor (c$, -function () { -this.construct (1.0, 2, 0, 10.0, null, 0.0); -}); -Clazz_overrideMethod (c$, "createStrokedShape", -function (s) { -return s; -}, "java.awt.Shape"); -Clazz_defineMethod (c$, "getLineWidth", -function () { -return this.width; -}); -Clazz_defineMethod (c$, "getEndCap", -function () { -return this.cap; -}); -Clazz_defineMethod (c$, "getLineJoin", -function () { -return this.join; -}); -Clazz_defineMethod (c$, "getMiterLimit", -function () { -return this.miterlimit; -}); -Clazz_defineMethod (c$, "getDashArray", -function () { -if (this.dash == null) { -return null; -}return this.dash.clone (); -}); -Clazz_defineMethod (c$, "getDashPhase", -function () { -return this.dash_phase; -}); -Clazz_overrideMethod (c$, "hashCode", -function () { -var hash = Float.floatToIntBits (this.width); -hash = hash * 31 + this.join; -hash = hash * 31 + this.cap; -hash = hash * 31 + Float.floatToIntBits (this.miterlimit); -if (this.dash != null) { -hash = hash * 31 + Float.floatToIntBits (this.dash_phase); -for (var i = 0; i < this.dash.length; i++) { -hash = hash * 31 + Float.floatToIntBits (this.dash[i]); -} -}return hash; -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (!(Clazz_instanceOf (obj, java.awt.BasicStroke))) { -return false; -}var bs = obj; -if (this.width != bs.width) { -return false; -}if (this.join != bs.join) { -return false; -}if (this.cap != bs.cap) { -return false; -}if (this.miterlimit != bs.miterlimit) { -return false; -}if (this.dash != null) { -if (this.dash_phase != bs.dash_phase) { -return false; -}if (!java.util.Arrays.equals (this.dash, bs.dash)) { -return false; -}} else if (bs.dash != null) { -return false; -}return true; -}, "~O"); -Clazz_defineStatics (c$, -"JOIN_MITER", 0, -"JOIN_ROUND", 1, -"JOIN_BEVEL", 2, -"CAP_BUTT", 0, -"CAP_ROUND", 1, -"CAP_SQUARE", 2); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "Stroke"); -Clazz_declarePackage ("java.util"); -Clazz_load (["java.util.HashMap"], "java.util.Locale", ["java.lang.InternalError", "$.NullPointerException", "$.StringBuilder"], function () { -c$ = Clazz_decorateAsClass (function () { -this.language = null; -this.country = null; -this.variant = null; -this.hashCodeValue = 0; -Clazz_instantialize (this, arguments); -}, java.util, "Locale", null, [Cloneable, java.io.Serializable]); -Clazz_makeConstructor (c$, -function (language, country, variant) { -this.language = language.intern (); -this.country = country.intern (); -this.variant = variant.intern (); -}, "~S,~S,~S"); -Clazz_makeConstructor (c$, -function (language, country) { -this.construct (language, country, ""); -}, "~S,~S"); -Clazz_makeConstructor (c$, -function (language) { -this.construct (language, "", ""); -}, "~S"); -Clazz_makeConstructor (c$, - function (language, country, flag) { -this.language = language; -this.country = country; -this.variant = ""; -}, "~S,~S,~B"); -c$.createSingleton = Clazz_defineMethod (c$, "createSingleton", - function (key, language, country) { -var locale = new java.util.Locale (language, country, false); -java.util.Locale.cache.put (key, locale); -return locale; -}, "~S,~S,~S"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function (language, country, variant) { -if (language == null || country == null || variant == null) { -throw new NullPointerException (); -}var sb = new StringBuilder (); -sb.append (language).append ('_').append (country).append ('_').append (variant); -var key = sb.toString (); -var locale = java.util.Locale.cache.get (key); -if (locale == null) { -locale = new java.util.Locale (language, country, variant); -var l = java.util.Locale.cache.put (key, locale); -if (l != null) { -locale = l; -}}return locale; -}, "~S,~S,~S"); -c$.getDefault = Clazz_defineMethod (c$, "getDefault", -function () { -if (java.util.Locale.defaultLocale == null) { -var language; -var country; -var variant; -language = "en"; -country = ""; -variant = ""; -java.util.Locale.defaultLocale = java.util.Locale.getInstance (language, country, variant); -}return java.util.Locale.defaultLocale; -}); -c$.setDefault = Clazz_defineMethod (c$, "setDefault", -function (newLocale) { -if (newLocale == null) throw new NullPointerException ("Can't set default locale to NULL"); -java.util.Locale.defaultLocale = newLocale; -}, "java.util.Locale"); -Clazz_defineMethod (c$, "getLanguage", -function () { -return this.language; -}); -Clazz_defineMethod (c$, "getCountry", -function () { -return this.country; -}); -Clazz_defineMethod (c$, "getVariant", -function () { -return this.variant; -}); -Clazz_overrideMethod (c$, "toString", -function () { -var l = this.language.length != 0; -var c = this.country.length != 0; -var v = this.variant.length != 0; -var result = new StringBuilder (this.language); -if (c || (l && v)) { -result.append ('_').append (this.country); -}if (v && (l || c)) { -result.append ('_').append (this.variant); -}return result.toString (); -}); -Clazz_defineMethod (c$, "getDisplayLanguage", -function () { -return this.getDisplayLanguage (java.util.Locale.getDefault ()); -}); -Clazz_defineMethod (c$, "getDisplayLanguage", -function (inLocale) { -return this.getDisplayString (this.language, inLocale, 0); -}, "java.util.Locale"); -Clazz_defineMethod (c$, "getDisplayCountry", -function () { -return this.getDisplayCountry (java.util.Locale.getDefault ()); -}); -Clazz_defineMethod (c$, "getDisplayCountry", -function (inLocale) { -return this.getDisplayString (this.country, inLocale, 1); -}, "java.util.Locale"); -Clazz_defineMethod (c$, "getDisplayString", - function (code, inLocale, type) { -if (code.length == 0) { -return ""; -}if (inLocale == null) { -throw new NullPointerException (); -}return inLocale.toString (); -}, "~S,java.util.Locale,~N"); -Clazz_defineMethod (c$, "getDisplayVariant", -function () { -return this.getDisplayVariant (java.util.Locale.getDefault ()); -}); -Clazz_defineMethod (c$, "getDisplayVariant", -function (inLocale) { -if (this.variant.length == 0) return ""; -return this.variant; -}, "java.util.Locale"); -Clazz_defineMethod (c$, "getDisplayName", -function () { -return this.getDisplayName (java.util.Locale.getDefault ()); -}); -Clazz_defineMethod (c$, "getDisplayName", -function (inLocale) { -return inLocale.toString (); -}, "java.util.Locale"); -Clazz_defineMethod (c$, "clone", -function () { -try { -var that = Clazz_superCall (this, java.util.Locale, "clone", []); -return that; -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_overrideMethod (c$, "hashCode", -function () { -var hc = this.hashCodeValue; -if (hc == 0) { -hc = (this.language.hashCode () << 8) ^ this.country.hashCode () ^ (this.variant.hashCode () << 4); -this.hashCodeValue = hc; -}return hc; -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (this === obj) return true; -if (!(Clazz_instanceOf (obj, java.util.Locale))) return false; -var other = obj; -return this.language === other.language && this.country === other.country && this.variant === other.variant; -}, "~O"); -c$.cache = c$.prototype.cache = new java.util.HashMap (32); -c$.ENGLISH = c$.prototype.ENGLISH = java.util.Locale.createSingleton ("en__", "en", ""); -c$.ROOT = c$.prototype.ROOT = java.util.Locale.createSingleton ("__", "", ""); -Clazz_defineStatics (c$, -"DISPLAY_LANGUAGE", 0, -"DISPLAY_COUNTRY", 1, -"defaultLocale", null); -}); -Clazz_declarePackage ("java.util"); -Clazz_load (["java.util.Arrays", "$.Collections", "$.HashMap"], "java.util.ResourceBundle", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "java.lang.ClassNotFoundException", "$.IllegalArgumentException", "$.InternalError", "$.InterruptedException", "$.NullPointerException", "$.StringBuilder", "$.Thread", "java.util.ArrayList", "$.HashSet", "java.util.Locale", "$.MissingResourceException", "swingjs.JSToolkit", "swingjs.api.Interface"], function () { -c$ = Clazz_decorateAsClass (function () { -this.parent = null; -this.locale = null; -this.expired = false; -this.$keySet = null; -Clazz_instantialize (this, arguments); -}, java.util, "ResourceBundle"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "getString", -function (key) { -return this.getObject (key); -}, "~S"); -Clazz_defineMethod (c$, "getStringArray", -function (key) { -return this.getObject (key); -}, "~S"); -Clazz_defineMethod (c$, "getObject", -function (key) { -var obj = this.handleGetObject (key); -if (obj == null) { -if (this.parent != null) { -obj = this.parent.getObject (key); -}if (obj == null) throw new java.util.MissingResourceException ("Can't find resource for bundle " + this.getClass ().getName () + ", key " + key, this.getClass ().getName (), key); -}return obj; -}, "~S"); -Clazz_defineMethod (c$, "getLocale", -function () { -return this.locale; -}); -Clazz_defineMethod (c$, "setParent", -function (parent) { -this.parent = parent; -}, "java.util.ResourceBundle"); -c$.getBundle = Clazz_defineMethod (c$, "getBundle", -function (baseName, targetLocale, loader, control) { -var n = 4; -{ -n = arguments.length; -}switch (n) { -case 2: -if ((Clazz_instanceOf (targetLocale, java.util.ResourceBundle.Control))) { -control = targetLocale; -targetLocale = null; -}break; -case 3: -if ((Clazz_instanceOf (loader, java.util.ResourceBundle.Control))) { -control = loader; -loader = null; -}break; -} -if (targetLocale == null) targetLocale = java.util.Locale.getDefault (); -if (control == null) control = java.util.ResourceBundle.Control.getControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); -return java.util.ResourceBundle.getBundleImpl (baseName, targetLocale, loader, control); -}, "~S,~O,~O,java.util.ResourceBundle.Control"); -c$.getBundleImpl = Clazz_defineMethod (c$, "getBundleImpl", - function (baseName, locale, loader, control) { -if (control == null) { -throw new NullPointerException ("ResourceBundle locale or control is null"); -}var cacheKey = new java.util.ResourceBundle.CacheKey (baseName, locale, loader); -var bundle = null; -var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); -if (bundleRef != null) { -bundle = bundleRef; -bundleRef = null; -}if (java.util.ResourceBundle.isValidBundle (bundle)) { -return bundle; -}var formats = control.getFormats (baseName); -var baseBundle = null; -for (var targetLocale = locale; targetLocale != null; targetLocale = control.getFallbackLocale (baseName, targetLocale)) { -var candidateLocales = control.getCandidateLocales (baseName, targetLocale); -bundle = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, 0, control, baseBundle); -if (java.util.ResourceBundle.isValidBundle (bundle)) { -var isBaseBundle = java.util.Locale.ROOT.equals (bundle.locale); -if (!isBaseBundle || bundle.locale.equals (locale) || (candidateLocales.size () == 1 && bundle.locale.equals (candidateLocales.get (0)))) { -break; -}if (isBaseBundle && baseBundle == null) { -baseBundle = bundle; -}}} -if (bundle == null) { -if (baseBundle == null) { -java.util.ResourceBundle.throwMissingResourceException (baseName, locale, cacheKey.getCause ()); -}bundle = baseBundle; -}return bundle; -}, "~S,java.util.Locale,~O,java.util.ResourceBundle.Control"); -c$.findBundle = Clazz_defineMethod (c$, "findBundle", - function (cacheKey, candidateLocales, formats, index, control, baseBundle) { -var targetLocale = candidateLocales.get (index); -var parent = null; -if (index != candidateLocales.size () - 1) { -parent = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, index + 1, control, baseBundle); -} else if (baseBundle != null && java.util.Locale.ROOT.equals (targetLocale)) { -return baseBundle; -}var expiredBundle = false; -cacheKey.setLocale (targetLocale); -var bundle = java.util.ResourceBundle.findBundleInCache (cacheKey, control); -if (java.util.ResourceBundle.isValidBundle (bundle)) { -expiredBundle = bundle.expired; -if (!expiredBundle) { -if (bundle.parent === parent) { -return bundle; -}var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); -if (bundleRef != null && bundleRef === bundle) { -java.util.ResourceBundle.cacheList.remove (cacheKey); -}}}if (bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE) { -var constKey = cacheKey.clone (); -try { -try { -bundle = java.util.ResourceBundle.loadBundle (cacheKey, formats, control, expiredBundle); -if (bundle != null) { -if (bundle.parent == null) { -bundle.setParent (parent); -}bundle.locale = targetLocale; -bundle = java.util.ResourceBundle.putBundleInCache (cacheKey, bundle, control); -return bundle; -}java.util.ResourceBundle.putBundleInCache (cacheKey, java.util.ResourceBundle.NONEXISTENT_BUNDLE, control); -} finally { -} -} finally { -if (Clazz_instanceOf (constKey.getCause (), InterruptedException)) { -Thread.currentThread ().interrupt (); -}} -}return parent; -}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.List,~N,java.util.ResourceBundle.Control,java.util.ResourceBundle"); -c$.loadBundle = Clazz_defineMethod (c$, "loadBundle", - function (cacheKey, formats, control, reload) { -var targetLocale = cacheKey.getLocale (); -var bundle = null; -var size = formats.size (); -for (var i = 0; i < size; i++) { -var format = formats.get (i); -try { -bundle = control.newBundle (cacheKey.getName (), targetLocale, format, null, reload); -} catch (e$$) { -if (Clazz_exceptionOf (e$$, LinkageError)) { -var error = e$$; -{ -cacheKey.setCause (error); -} -} else if (Clazz_exceptionOf (e$$, Exception)) { -var cause = e$$; -{ -cacheKey.setCause (cause); -} -} else { -throw e$$; -} -} -if (bundle != null) { -cacheKey.setFormat (format); -bundle.locale = targetLocale; -bundle.expired = false; -break; -}} -return bundle; -}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.ResourceBundle.Control,~B"); -c$.isValidBundle = Clazz_defineMethod (c$, "isValidBundle", - function (bundle) { -return bundle != null && bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE; -}, "java.util.ResourceBundle"); -c$.throwMissingResourceException = Clazz_defineMethod (c$, "throwMissingResourceException", - function (baseName, locale, cause) { -if (Clazz_instanceOf (cause, java.util.MissingResourceException)) { -cause = null; -}throw new java.util.MissingResourceException ("Can't find bundle for base name " + baseName + ", locale " + locale, baseName + "_" + locale, "", cause); -}, "~S,java.util.Locale,Throwable"); -c$.findBundleInCache = Clazz_defineMethod (c$, "findBundleInCache", - function (cacheKey, control) { -var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); -if (bundleRef == null) { -return null; -}var bundle = bundleRef; -return bundle; -}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle.Control"); -c$.putBundleInCache = Clazz_defineMethod (c$, "putBundleInCache", - function (cacheKey, bundle, control) { -var key = cacheKey.clone (); -java.util.ResourceBundle.cacheList.put (key, bundle); -return bundle; -}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle,java.util.ResourceBundle.Control"); -c$.clearCache = Clazz_defineMethod (c$, "clearCache", -function () { -java.util.ResourceBundle.cacheList.clear (); -}); -Clazz_defineMethod (c$, "containsKey", -function (key) { -if (key == null) { -throw new NullPointerException (); -}for (var rb = this; rb != null; rb = rb.parent) { -if (rb.handleKeySet ().contains (key)) { -return true; -}} -return false; -}, "~S"); -Clazz_defineMethod (c$, "keySet", -function () { -var keys = new java.util.HashSet (); -for (var rb = this; rb != null; rb = rb.parent) { -keys.addAll (rb.handleKeySet ()); -} -return keys; -}); -Clazz_defineMethod (c$, "handleKeySet", -function () { -if (this.$keySet == null) { -{ -if (this.$keySet == null) { -var keys = new java.util.HashSet (); -var enumKeys = this.getKeys (); -while (enumKeys.hasMoreElements ()) { -var key = enumKeys.nextElement (); -if (this.handleGetObject (key) != null) { -keys.add (key); -}} -this.$keySet = keys; -}}}return this.$keySet; -}); -c$.$ResourceBundle$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (java.util, "ResourceBundle$1", java.util.ResourceBundle); -Clazz_defineMethod (c$, "getKeys", -function () { -return null; -}); -Clazz_defineMethod (c$, "handleGetObject", -function (key) { -return null; -}, "~S"); -Clazz_overrideMethod (c$, "toString", -function () { -return "NONEXISTENT_BUNDLE"; -}); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.name = null; -this.locale = null; -this.format = null; -this.cause = null; -this.hashCodeCache = 0; -Clazz_instantialize (this, arguments); -}, java.util.ResourceBundle, "CacheKey", null, Cloneable); -Clazz_makeConstructor (c$, -function (a, b, c) { -this.name = a; -this.locale = b; -if (this.name != null) this.calculateHashCode (); -}, "~S,java.util.Locale,~O"); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getLocale", -function () { -return this.locale; -}); -Clazz_defineMethod (c$, "setLocale", -function (a) { -if (!this.locale.equals (a)) { -this.locale = a; -this.calculateHashCode (); -}return this; -}, "java.util.Locale"); -Clazz_overrideMethod (c$, "equals", -function (a) { -if (this === a) { -return true; -}try { -var b = a; -if (this.hashCodeCache != b.hashCodeCache) { -return false; -}if (!this.name.equals (b.name)) { -return false; -}if (!this.locale.equals (b.locale)) { -return false; -}return true; -} catch (e$$) { -if (Clazz_exceptionOf (e$$, NullPointerException)) { -var e = e$$; -{ -} -} else if (Clazz_exceptionOf (e$$, ClassCastException)) { -var e = e$$; -{ -} -} else { -throw e$$; -} -} -return false; -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -return this.hashCodeCache; -}); -Clazz_defineMethod (c$, "calculateHashCode", - function () { -this.hashCodeCache = this.name.hashCode () << 3; -this.hashCodeCache ^= this.locale.hashCode (); -}); -Clazz_defineMethod (c$, "clone", -function () { -try { -var a = Clazz_superCall (this, java.util.ResourceBundle.CacheKey, "clone", []); -a.cause = null; -return a; -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_defineMethod (c$, "setFormat", -function (a) { -this.format = a; -}, "~S"); -Clazz_defineMethod (c$, "setCause", - function (a) { -if (this.cause == null) { -this.cause = a; -} else { -if (Clazz_instanceOf (this.cause, ClassNotFoundException)) { -this.cause = a; -}}}, "Throwable"); -Clazz_defineMethod (c$, "getCause", - function () { -return this.cause; -}); -Clazz_overrideMethod (c$, "toString", -function () { -var a = this.locale.toString (); -if (a.length == 0) { -if (this.locale.getVariant ().length != 0) { -a = "__" + this.locale.getVariant (); -} else { -a = "\"\""; -}}return "CacheKey[" + this.name + ", lc=" + a + "(format=" + this.format + ")]"; -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.util.ResourceBundle, "Control"); -Clazz_makeConstructor (c$, -function () { -}); -c$.getControl = Clazz_defineMethod (c$, "getControl", -function (a) { -if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { -return java.util.ResourceBundle.SingleFormatControl.PROPERTIES_ONLY; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { -return java.util.ResourceBundle.SingleFormatControl.CLASS_ONLY; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { -return java.util.ResourceBundle.Control.INSTANCE; -}throw new IllegalArgumentException (); -}, "java.util.List"); -c$.getNoFallbackControl = Clazz_defineMethod (c$, "getNoFallbackControl", -function (a) { -if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { -return java.util.ResourceBundle.NoFallbackControl.NO_FALLBACK; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { -return java.util.ResourceBundle.NoFallbackControl.PROPERTIES_ONLY_NO_FALLBACK; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { -return java.util.ResourceBundle.NoFallbackControl.CLASS_ONLY_NO_FALLBACK; -}throw new IllegalArgumentException (); -}, "java.util.List"); -Clazz_defineMethod (c$, "getFormats", -function (a) { -if (a == null) { -throw new NullPointerException (); -}return java.util.ResourceBundle.Control.FORMAT_DEFAULT; -}, "~S"); -Clazz_defineMethod (c$, "getCandidateLocales", -function (a, b) { -if (a == null) { -throw new NullPointerException (); -}var c = b.getLanguage (); -var d = b.getCountry (); -var e = b.getVariant (); -var f = new java.util.ArrayList (4); -if (e.length > 0) { -f.add (b); -}if (d.length > 0) { -f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, d, "")); -}if (c.length > 0) { -f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, "", "")); -}f.add (java.util.Locale.ROOT); -return f; -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "getFallbackLocale", -function (a, b) { -if (a == null) { -throw new NullPointerException (); -}var c = java.util.Locale.getDefault (); -return b.equals (c) ? null : c; -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "newBundle", -function (a, b, c, d, e) { -var f = this.toBundleName (a, b); -var g = null; -if (c.equals ("java.class")) { -g = swingjs.api.Interface.getInstance (f, false); -} else if (c.equals ("java.properties")) { -var h = this.toResourceName0 (f, "properties"); -if (h == null) { -return null; -}var i = swingjs.JSToolkit.getJavaResource (h); -var j = null; -j = (i == null ? null : new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (i.getBytes ()))); -if (j != null) { -try { -g = this.newPropertyBundle (j); -} finally { -j.close (); -} -}} else { -throw new IllegalArgumentException ("unknown format: " + c); -}return g; -}, "~S,java.util.Locale,~S,~O,~B"); -Clazz_defineMethod (c$, "newPropertyBundle", - function (a) { -return (swingjs.api.Interface.getInstance ("java.util.PropertyResourceBundle", false)).setStream (a); -}, "java.io.InputStream"); -Clazz_defineMethod (c$, "getTimeToLive", -function (a, b) { -if (a == null || b == null) { -throw new NullPointerException (); -}return -2; -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "toBundleName", -function (a, b) { -if (b === java.util.Locale.ROOT) { -return a; -}var c = b.getLanguage (); -var d = b.getCountry (); -var e = b.getVariant (); -if (c === "" && d === "" && e === "") { -return a; -}var f = new StringBuilder (a); -f.append ('_'); -if (e !== "") { -f.append (c).append ('_').append (d).append ('_').append (e); -} else if (d !== "") { -f.append (c).append ('_').append (d); -} else { -f.append (c); -}return f.toString (); -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "toResourceName", -function (a, b) { -var c = new StringBuilder (a.length + 1 + b.length); -c.append (a.$replace ('.', '/')).append ('.').append (b); -return c.toString (); -}, "~S,~S"); -Clazz_defineMethod (c$, "toResourceName0", - function (a, b) { -if (a.contains ("://")) { -return null; -} else { -return this.toResourceName (a, b); -}}, "~S,~S"); -c$.FORMAT_DEFAULT = c$.prototype.FORMAT_DEFAULT = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class", "java.properties"])); -c$.FORMAT_CLASS = c$.prototype.FORMAT_CLASS = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class"])); -c$.FORMAT_PROPERTIES = c$.prototype.FORMAT_PROPERTIES = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.properties"])); -Clazz_defineStatics (c$, -"TTL_DONT_CACHE", -1, -"TTL_NO_EXPIRATION_CONTROL", -2); -c$.INSTANCE = c$.prototype.INSTANCE = new java.util.ResourceBundle.Control (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.formats = null; -Clazz_instantialize (this, arguments); -}, java.util.ResourceBundle, "SingleFormatControl", java.util.ResourceBundle.Control); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.util.ResourceBundle.SingleFormatControl, []); -this.formats = a; -}, "java.util.List"); -Clazz_overrideMethod (c$, "getFormats", -function (a) { -if (a == null) { -throw new NullPointerException (); -}return this.formats; -}, "~S"); -c$.PROPERTIES_ONLY = c$.prototype.PROPERTIES_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); -c$.CLASS_ONLY = c$.prototype.CLASS_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_CLASS); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.util.ResourceBundle, "NoFallbackControl", java.util.ResourceBundle.SingleFormatControl); -Clazz_overrideMethod (c$, "getFallbackLocale", -function (a, b) { -if (a == null || b == null) { -throw new NullPointerException (); -}return null; -}, "~S,java.util.Locale"); -c$.NO_FALLBACK = c$.prototype.NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_DEFAULT); -c$.PROPERTIES_ONLY_NO_FALLBACK = c$.prototype.PROPERTIES_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); -c$.CLASS_ONLY_NO_FALLBACK = c$.prototype.CLASS_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_CLASS); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"INITIAL_CACHE_SIZE", 32); -c$.NONEXISTENT_BUNDLE = c$.prototype.NONEXISTENT_BUNDLE = ((Clazz_isClassDefined ("java.util.ResourceBundle$1") ? 0 : java.util.ResourceBundle.$ResourceBundle$1$ ()), Clazz_innerTypeInstance (java.util.ResourceBundle$1, this, null)); -c$.cacheList = c$.prototype.cacheList = new java.util.HashMap (32); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["javajs.api.GenericLineReader"], "JU.Rdr", ["java.io.BufferedInputStream", "$.BufferedReader", "$.ByteArrayInputStream", "$.InputStreamReader", "$.StringReader", "JU.AU", "$.Base64", "$.Encoding", "$.SB"], function () { -c$ = Clazz_decorateAsClass (function () { -this.reader = null; -Clazz_instantialize (this, arguments); -}, JU, "Rdr", null, javajs.api.GenericLineReader); -Clazz_makeConstructor (c$, -function (reader) { -this.reader = reader; -}, "java.io.BufferedReader"); -Clazz_overrideMethod (c$, "readNextLine", -function () { -return this.reader.readLine (); -}); -c$.readCifData = Clazz_defineMethod (c$, "readCifData", -function (parser, br) { -return parser.set (null, br).getAllCifData (); -}, "javajs.api.GenericCifDataParser,java.io.BufferedReader"); -c$.fixUTF = Clazz_defineMethod (c$, "fixUTF", -function (bytes) { -var encoding = JU.Rdr.getUTFEncoding (bytes); -if (encoding !== JU.Encoding.NONE) try { -var s = String.instantialize (bytes, encoding.name ().$replace ('_', '-')); -switch (encoding) { -case JU.Encoding.UTF8: -case JU.Encoding.UTF_16BE: -case JU.Encoding.UTF_16LE: -s = s.substring (1); -break; -default: -break; -} -return s; -} catch (e) { -if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) { -System.out.println (e); -} else { -throw e; -} -} -return String.instantialize (bytes); -}, "~A"); -c$.getUTFEncoding = Clazz_defineMethod (c$, "getUTFEncoding", - function (bytes) { -if (bytes.length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) return JU.Encoding.UTF8; -if (bytes.length >= 4 && bytes[0] == 0 && bytes[1] == 0 && bytes[2] == 0xFE && bytes[3] == 0xFF) return JU.Encoding.UTF_32BE; -if (bytes.length >= 4 && bytes[0] == 0xFF && bytes[1] == 0xFE && bytes[2] == 0 && bytes[3] == 0) return JU.Encoding.UTF_32LE; -if (bytes.length >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE) return JU.Encoding.UTF_16LE; -if (bytes.length >= 2 && bytes[0] == 0xFE && bytes[1] == 0xFF) return JU.Encoding.UTF_16BE; -return JU.Encoding.NONE; -}, "~A"); -c$.getUTFEncodingForStream = Clazz_defineMethod (c$, "getUTFEncodingForStream", - function (is) { -{ -is.resetStream(); -}var abMagic = Clazz_newByteArray (4, 0); -abMagic[3] = 1; -try { -is.mark (5); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -return JU.Encoding.NONE; -} else { -throw e; -} -} -is.read (abMagic, 0, 4); -is.reset (); -return JU.Rdr.getUTFEncoding (abMagic); -}, "java.io.BufferedInputStream"); -c$.isBase64 = Clazz_defineMethod (c$, "isBase64", -function (sb) { -return (sb.indexOf (";base64,") == 0); -}, "JU.SB"); -c$.isCompoundDocumentS = Clazz_defineMethod (c$, "isCompoundDocumentS", -function (is) { -return JU.Rdr.isCompoundDocumentB (JU.Rdr.getMagic (is, 8)); -}, "java.io.InputStream"); -c$.isCompoundDocumentB = Clazz_defineMethod (c$, "isCompoundDocumentB", -function (bytes) { -return (bytes.length >= 8 && bytes[0] == 0xD0 && bytes[1] == 0xCF && bytes[2] == 0x11 && bytes[3] == 0xE0 && bytes[4] == 0xA1 && bytes[5] == 0xB1 && bytes[6] == 0x1A && bytes[7] == 0xE1); -}, "~A"); -c$.isGzipS = Clazz_defineMethod (c$, "isGzipS", -function (is) { -return JU.Rdr.isGzipB (JU.Rdr.getMagic (is, 2)); -}, "java.io.InputStream"); -c$.isGzipB = Clazz_defineMethod (c$, "isGzipB", -function (bytes) { -return (bytes != null && bytes.length >= 2 && bytes[0] == 0x1F && bytes[1] == 0x8B); -}, "~A"); -c$.isPickleS = Clazz_defineMethod (c$, "isPickleS", -function (is) { -return JU.Rdr.isPickleB (JU.Rdr.getMagic (is, 2)); -}, "java.io.InputStream"); -c$.isPickleB = Clazz_defineMethod (c$, "isPickleB", -function (bytes) { -return (bytes != null && bytes.length >= 2 && bytes[0] == 0x7D && bytes[1] == 0x71); -}, "~A"); -c$.isPngZipStream = Clazz_defineMethod (c$, "isPngZipStream", -function (is) { -return JU.Rdr.isPngZipB (JU.Rdr.getMagic (is, 55)); -}, "java.io.InputStream"); -c$.isPngZipB = Clazz_defineMethod (c$, "isPngZipB", -function (bytes) { -return (bytes[50] == 0 && bytes[51] == 0x50 && bytes[52] == 0x4E && bytes[53] == 0x47 && bytes[54] == 0x4A); -}, "~A"); -c$.isZipS = Clazz_defineMethod (c$, "isZipS", -function (is) { -return JU.Rdr.isZipB (JU.Rdr.getMagic (is, 4)); -}, "java.io.InputStream"); -c$.isZipB = Clazz_defineMethod (c$, "isZipB", -function (bytes) { -return (bytes.length >= 4 && bytes[0] == 0x50 && bytes[1] == 0x4B && bytes[2] == 0x03 && bytes[3] == 0x04); -}, "~A"); -c$.getMagic = Clazz_defineMethod (c$, "getMagic", - function (is, n) { -var abMagic = Clazz_newByteArray (n, 0); -{ -is.resetStream(); -}try { -is.mark (n + 1); -is.read (abMagic, 0, n); -} catch (e) { -if (Clazz_exceptionOf (e, java.io.IOException)) { -} else { -throw e; -} -} -try { -is.reset (); -} catch (e) { -if (Clazz_exceptionOf (e, java.io.IOException)) { -} else { -throw e; -} -} -return abMagic; -}, "java.io.InputStream,~N"); -c$.getBIS = Clazz_defineMethod (c$, "getBIS", -function (bytes) { -return new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (bytes)); -}, "~A"); -c$.getBR = Clazz_defineMethod (c$, "getBR", -function (string) { -return new java.io.BufferedReader ( new java.io.StringReader (string)); -}, "~S"); -c$.getUnzippedInputStream = Clazz_defineMethod (c$, "getUnzippedInputStream", -function (jzt, bis) { -while (JU.Rdr.isGzipS (bis)) bis = new java.io.BufferedInputStream (JU.Rdr.newGZIPInputStream (jzt, bis)); - -return bis; -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream"); -c$.getBytesFromSB = Clazz_defineMethod (c$, "getBytesFromSB", -function (sb) { -return (JU.Rdr.isBase64 (sb) ? JU.Base64.decodeBase64 (sb.substring (8)) : sb.toBytes (0, -1)); -}, "JU.SB"); -c$.getStreamAsBytes = Clazz_defineMethod (c$, "getStreamAsBytes", -function (bis, out) { -var buf = Clazz_newByteArray (1024, 0); -var bytes = (out == null ? Clazz_newByteArray (4096, 0) : null); -var len = 0; -var totalLen = 0; -while ((len = bis.read (buf, 0, 1024)) > 0) { -totalLen += len; -if (out == null) { -if (totalLen >= bytes.length) bytes = JU.AU.ensureLengthByte (bytes, totalLen * 2); -System.arraycopy (buf, 0, bytes, totalLen - len, len); -} else { -out.write (buf, 0, len); -}} -bis.close (); -if (out == null) { -return JU.AU.arrayCopyByte (bytes, totalLen); -}return totalLen + " bytes"; -}, "java.io.BufferedInputStream,JU.OC"); -c$.getBufferedReader = Clazz_defineMethod (c$, "getBufferedReader", -function (bis, charSet) { -if (JU.Rdr.getUTFEncodingForStream (bis) === JU.Encoding.NONE) return new java.io.BufferedReader ( new java.io.InputStreamReader (bis, (charSet == null ? "UTF-8" : charSet))); -var bytes = JU.Rdr.getLimitedStreamBytes (bis, -1); -bis.close (); -return JU.Rdr.getBR (charSet == null ? JU.Rdr.fixUTF (bytes) : String.instantialize (bytes, charSet)); -}, "java.io.BufferedInputStream,~S"); -c$.getLimitedStreamBytes = Clazz_defineMethod (c$, "getLimitedStreamBytes", -function (is, n) { -var buflen = (n > 0 && n < 1024 ? n : 1024); -var buf = Clazz_newByteArray (buflen, 0); -var bytes = Clazz_newByteArray (n < 0 ? 4096 : n, 0); -var len = 0; -var totalLen = 0; -if (n < 0) n = 2147483647; -while (totalLen < n && (len = is.read (buf, 0, buflen)) > 0) { -totalLen += len; -if (totalLen > bytes.length) bytes = JU.AU.ensureLengthByte (bytes, totalLen * 2); -System.arraycopy (buf, 0, bytes, totalLen - len, len); -if (n != 2147483647 && totalLen + buflen > bytes.length) buflen = bytes.length - totalLen; -} -if (totalLen == bytes.length) return bytes; -buf = Clazz_newByteArray (totalLen, 0); -System.arraycopy (bytes, 0, buf, 0, totalLen); -return buf; -}, "java.io.InputStream,~N"); -c$.StreamToUTF8String = Clazz_defineMethod (c$, "StreamToUTF8String", -function (bis) { -var data = new Array (1); -try { -JU.Rdr.readAllAsString (JU.Rdr.getBufferedReader (bis, "UTF-8"), -1, true, data, 0); -} catch (e) { -if (Clazz_exceptionOf (e, java.io.IOException)) { -} else { -throw e; -} -} -return data[0]; -}, "java.io.BufferedInputStream"); -c$.readAllAsString = Clazz_defineMethod (c$, "readAllAsString", -function (br, nBytesMax, allowBinary, data, i) { -try { -var sb = JU.SB.newN (8192); -var line; -if (nBytesMax < 0) { -line = br.readLine (); -if (allowBinary || line != null && line.indexOf ('\0') < 0 && (line.length != 4 || line.charCodeAt (0) != 65533 || line.indexOf ("PNG") != 1)) { -sb.append (line).appendC ('\n'); -while ((line = br.readLine ()) != null) sb.append (line).appendC ('\n'); - -}} else { -var n = 0; -var len; -while (n < nBytesMax && (line = br.readLine ()) != null) { -if (nBytesMax - n < (len = line.length) + 1) line = line.substring (0, nBytesMax - n - 1); -sb.append (line).appendC ('\n'); -n += len + 1; -} -}br.close (); -data[i] = sb.toString (); -return true; -} catch (ioe) { -if (Clazz_exceptionOf (ioe, Exception)) { -data[i] = ioe.toString (); -return false; -} else { -throw ioe; -} -} -}, "java.io.BufferedReader,~N,~B,~A,~N"); -c$.getPngZipPointAndCount = Clazz_defineMethod (c$, "getPngZipPointAndCount", -function (bis, pt_count) { -bis.mark (75); -try { -var data = JU.Rdr.getLimitedStreamBytes (bis, 74); -bis.reset (); -var pt = 0; -for (var i = 64, f = 1; --i > 54; f *= 10) pt += (data[i] - 48) * f; - -var n = 0; -for (var i = 74, f = 1; --i > 64; f *= 10) n += (data[i] - 48) * f; - -pt_count[0] = pt; -pt_count[1] = n; -} catch (e) { -pt_count[1] = 0; -} -}, "java.io.BufferedInputStream,~A"); -c$.getPngZipStream = Clazz_defineMethod (c$, "getPngZipStream", -function (bis, asNewStream) { -if (!JU.Rdr.isPngZipStream (bis)) return bis; -var data = Clazz_newByteArray (0, 0); -bis.mark (75); -try { -var pt_count = Clazz_newIntArray (2, 0); -JU.Rdr.getPngZipPointAndCount (bis, pt_count); -if (pt_count[1] != 0) { -var pt = pt_count[0]; -while (pt > 0) pt -= bis.skip (pt); - -if (!asNewStream) return bis; -data = JU.Rdr.getLimitedStreamBytes (bis, pt_count[1]); -}} catch (e) { -} finally { -try { -if (asNewStream) bis.close (); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -} else { -throw e; -} -} -} -return JU.Rdr.getBIS (data); -}, "java.io.BufferedInputStream,~B"); -c$.readFileAsMap = Clazz_defineMethod (c$, "readFileAsMap", -function (jzt, is, bdata, name) { -jzt.readFileAsMap (is, bdata, name); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,java.util.Map,~S"); -c$.getZipDirectoryAsStringAndClose = Clazz_defineMethod (c$, "getZipDirectoryAsStringAndClose", -function (jzt, t) { -return jzt.getZipDirectoryAsStringAndClose (t); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream"); -c$.newGZIPInputStream = Clazz_defineMethod (c$, "newGZIPInputStream", -function (jzt, bis) { -return jzt.newGZIPInputStream (bis); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream"); -c$.newZipInputStream = Clazz_defineMethod (c$, "newZipInputStream", -function (jzt, $in) { -return jzt.newZipInputStream ($in); -}, "javajs.api.GenericZipTools,java.io.InputStream"); -c$.getZipFileDirectory = Clazz_defineMethod (c$, "getZipFileDirectory", -function (jzt, bis, subFileList, listPtr, asBufferedInputStream) { -return jzt.getZipFileDirectory (jzt, bis, subFileList, listPtr, asBufferedInputStream); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~A,~N,~B"); -c$.getZipDirectoryAndClose = Clazz_defineMethod (c$, "getZipDirectoryAndClose", -function (jzt, t, manifestID) { -return jzt.getZipDirectoryAndClose (t, manifestID); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~S"); -c$.getAllZipData = Clazz_defineMethod (c$, "getAllZipData", -function (jzt, bis, subFileList, replace, string, fileData) { -jzt.getAllZipData (bis, subFileList, replace, string, fileData); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~A,~S,~S,java.util.Map"); -c$.getZipFileContentsAsBytes = Clazz_defineMethod (c$, "getZipFileContentsAsBytes", -function (jzt, bis, subFileList, i) { -return jzt.getZipFileContentsAsBytes (bis, subFileList, i); -}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~A,~N"); -c$.addZipEntry = Clazz_defineMethod (c$, "addZipEntry", -function (jzt, zos, fileName) { -jzt.addZipEntry (zos, fileName); -}, "javajs.api.GenericZipTools,~O,~S"); -c$.closeZipEntry = Clazz_defineMethod (c$, "closeZipEntry", -function (jzt, zos) { -jzt.closeZipEntry (zos); -}, "javajs.api.GenericZipTools,~O"); -c$.getZipOutputStream = Clazz_defineMethod (c$, "getZipOutputStream", -function (jzt, bos) { -return jzt.getZipOutputStream (bos); -}, "javajs.api.GenericZipTools,~O"); -c$.getCrcValue = Clazz_defineMethod (c$, "getCrcValue", -function (jzt, bytes) { -return jzt.getCrcValue (bytes); -}, "javajs.api.GenericZipTools,~A"); -c$.getZipRoot = Clazz_defineMethod (c$, "getZipRoot", -function (fileName) { -var pt = fileName.indexOf ("|"); -return (pt < 0 ? fileName : fileName.substring (0, pt)); -}, "~S"); -}); -Clazz_declarePackage ("javajs.api"); -Clazz_declareInterface (javajs.api, "GenericLineReader"); -Clazz_load (["java.io.FilterInputStream"], "java.io.BufferedInputStream", ["java.io.IOException", "java.lang.IndexOutOfBoundsException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.buf = null; -this.count = 0; -this.pos = 0; -this.markpos = -1; -this.marklimit = 0; -Clazz_instantialize (this, arguments); -}, java.io, "BufferedInputStream", java.io.FilterInputStream); -Clazz_defineMethod (c$, "getInIfOpen", - function () { -var input = this.$in; -if (input == null) throw new java.io.IOException ("Stream closed"); -return input; -}); -Clazz_defineMethod (c$, "getBufIfOpen", - function () { -var buffer = this.buf; -if (buffer == null) throw new java.io.IOException ("Stream closed"); -return buffer; -}); -Clazz_overrideMethod (c$, "resetStream", -function () { -}); -Clazz_makeConstructor (c$, -function ($in) { -Clazz_superConstructor (this, java.io.BufferedInputStream, [$in]); -this.buf = Clazz_newByteArray (8192, 0); -}, "java.io.InputStream"); -Clazz_defineMethod (c$, "fill", - function () { -var buffer = this.getBufIfOpen (); -if (this.markpos < 0) this.pos = 0; - else if (this.pos >= buffer.length) if (this.markpos > 0) { -var sz = this.pos - this.markpos; -System.arraycopy (buffer, this.markpos, buffer, 0, sz); -this.pos = sz; -this.markpos = 0; -} else if (buffer.length >= this.marklimit) { -this.markpos = -1; -this.pos = 0; -} else { -var nsz = this.pos * 2; -if (nsz > this.marklimit) nsz = this.marklimit; -var nbuf = Clazz_newByteArray (nsz, 0); -System.arraycopy (buffer, 0, nbuf, 0, this.pos); -buffer = this.buf = nbuf; -}this.count = this.pos; -var n = this.getInIfOpen ().read (buffer, this.pos, buffer.length - this.pos); -if (n > 0) this.count = n + this.pos; -}); -Clazz_overrideMethod (c$, "readByteAsInt", -function () { -if (this.pos >= this.count) { -this.fill (); -if (this.pos >= this.count) return -1; -}return this.getBufIfOpen ()[this.pos++] & 0xff; -}); -Clazz_defineMethod (c$, "read1", - function (b, off, len) { -var avail = this.count - this.pos; -if (avail <= 0) { -if (len >= this.getBufIfOpen ().length && this.markpos < 0) { -return this.getInIfOpen ().read (b, off, len); -}this.fill (); -avail = this.count - this.pos; -if (avail <= 0) return -1; -}var cnt = (avail < len) ? avail : len; -System.arraycopy (this.getBufIfOpen (), this.pos, b, off, cnt); -this.pos += cnt; -return cnt; -}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "read", -function (b, off, len) { -if (arguments.length == 1) { - off = 0; - len = b.length; -} -this.getBufIfOpen (); -if ((off | len | (off + len) | (b.length - (off + len))) < 0) { -throw new IndexOutOfBoundsException (); -} else if (len == 0) { -return 0; -}var n = 0; -for (; ; ) { -var nread = this.read1 (b, off + n, len - n); -if (nread <= 0) return (n == 0) ? nread : n; -n += nread; -if (n >= len) return n; -var input = this.$in; -if (input != null && input.available () <= 0) return n; -} -}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "skip", -function (n) { -this.getBufIfOpen (); -if (n <= 0) { -return 0; -}var avail = this.count - this.pos; -if (avail <= 0) { -if (this.markpos < 0) return this.getInIfOpen ().skip (n); -this.fill (); -avail = this.count - this.pos; -if (avail <= 0) return 0; -}var skipped = (avail < n) ? avail : n; -this.pos += skipped; -return skipped; -}, "~N"); -Clazz_overrideMethod (c$, "available", -function () { -var n = this.count - this.pos; -var avail = this.getInIfOpen ().available (); -return n > (2147483647 - avail) ? 2147483647 : n + avail; -}); -Clazz_overrideMethod (c$, "mark", -function (readlimit) { -this.marklimit = readlimit; -this.markpos = this.pos; -}, "~N"); -Clazz_overrideMethod (c$, "reset", -function () { -this.getBufIfOpen (); -if (this.markpos < 0) throw new java.io.IOException ("Resetting to invalid mark"); -this.pos = this.markpos; -}); -Clazz_overrideMethod (c$, "markSupported", -function () { -return true; -}); -Clazz_overrideMethod (c$, "close", -function () { -var input = this.$in; -this.$in = null; -if (input != null) input.close (); -return; -}); -Clazz_defineStatics (c$, -"DEFAULT_BUFFER_SIZE", 8192); -}); -Clazz_load (["java.io.InputStream"], "java.io.FilterInputStream", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.$in = null; -Clazz_instantialize (this, arguments); -}, java.io, "FilterInputStream", java.io.InputStream); -Clazz_makeConstructor (c$, -function ($in) { -Clazz_superConstructor (this, java.io.FilterInputStream, []); -this.$in = $in; -}, "java.io.InputStream"); -Clazz_defineMethod (c$, "readByteAsInt", -function () { -return this.$in.readByteAsInt (); -}); -Clazz_defineMethod (c$, "read", -function (b, off, len) { - if (arguments.length == 1) { off = 0; len = b.length; } -return this.$in.read (b, off, len); -}, "~A,~N,~N"); -Clazz_defineMethod (c$, "skip", -function (n) { -return this.$in.skip (n); -}, "~N"); -Clazz_defineMethod (c$, "available", -function () { -return this.$in.available (); -}); -Clazz_defineMethod (c$, "close", -function () { -this.$in.close (); -}); -Clazz_defineMethod (c$, "mark", -function (readlimit) { -this.$in.mark (readlimit); -}, "~N"); -Clazz_defineMethod (c$, "reset", -function () { -this.$in.reset (); -}); -Clazz_defineMethod (c$, "markSupported", -function () { -return this.$in.markSupported (); -}); -}); -Clazz_load (null, "java.io.InputStream", ["java.io.IOException", "java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () { -c$ = Clazz_declareType (java.io, "InputStream"); -Clazz_defineMethod (c$, "read", -function (b, off, len) { -if (b == null) { -throw new NullPointerException (); -} - if (arguments.length == 1) { off = 0; len = b.length; } - -if (off < 0 || len < 0 || len > b.length - off) { -throw new IndexOutOfBoundsException (); -} else if (len == 0) { -return 0; -}var c = this.readByteAsInt (); -if (c == -1) { -return -1; -}b[off] = c; -var i = 1; -try { -for (; i < len; i++) { -c = this.readByteAsInt (); -if (c == -1) { -break; -}b[off + i] = c; -} -} catch (ee) { -if (Clazz_exceptionOf (ee, java.io.IOException)) { -} else { -throw ee; -} -} -return i; -}, "~A,~N,~N"); -Clazz_defineMethod (c$, "skip", -function (n) { -var remaining = n; -var nr; -if (java.io.InputStream.skipBuffer == null) java.io.InputStream.skipBuffer = Clazz_newByteArray (2048, 0); -var localSkipBuffer = java.io.InputStream.skipBuffer; -if (n <= 0) { -return 0; -}while (remaining > 0) { -nr = this.read (localSkipBuffer, 0, Math.min (2048, remaining)); -if (nr < 0) { -break; -}remaining -= nr; -} -return n - remaining; -}, "~N"); -Clazz_defineMethod (c$, "available", -function () { -return 0; -}); -Clazz_defineMethod (c$, "close", -function () { -}); -Clazz_defineMethod (c$, "mark", -function (readlimit) { -}, "~N"); -Clazz_defineMethod (c$, "reset", -function () { -throw new java.io.IOException ("mark/reset not supported"); -}); -Clazz_defineMethod (c$, "markSupported", -function () { -return false; -}); -Clazz_defineMethod (c$, "resetStream", -function () { -}); -Clazz_defineStatics (c$, -"SKIP_BUFFER_SIZE", 2048, -"skipBuffer", null); -}); -Clazz_load (["java.io.Reader"], "java.io.BufferedReader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "JU.SB"], function () { -c$ = Clazz_decorateAsClass (function () { -this.$in = null; -this.cb = null; -this.nChars = 0; -this.nextChar = 0; -this.markedChar = -1; -this.readAheadLimit = 0; -this.skipLF = false; -this.markedSkipLF = false; -Clazz_instantialize (this, arguments); -}, java.io, "BufferedReader", java.io.Reader); -Clazz_defineMethod (c$, "setSize", - function (sz) { -if (sz <= 0) throw new IllegalArgumentException ("Buffer size <= 0"); -this.cb = Clazz_newCharArray (sz, '\0'); -this.nextChar = this.nChars = 0; -}, "~N"); -Clazz_makeConstructor (c$, -function ($in) { -Clazz_superConstructor (this, java.io.BufferedReader, [$in]); -this.$in = $in; -this.setSize (8192); -}, "java.io.Reader"); -Clazz_defineMethod (c$, "ensureOpen", - function () { -if (this.$in == null) throw new java.io.IOException ("Stream closed"); -}); -Clazz_defineMethod (c$, "fill", - function () { -var dst; -if (this.markedChar <= -1) { -dst = 0; -} else { -var delta = this.nextChar - this.markedChar; -if (delta >= this.readAheadLimit) { -this.markedChar = -2; -this.readAheadLimit = 0; -dst = 0; -} else { -if (this.readAheadLimit <= this.cb.length) { -System.arraycopy (this.cb, this.markedChar, this.cb, 0, delta); -this.markedChar = 0; -dst = delta; -} else { -var ncb = Clazz_newCharArray (this.readAheadLimit, '\0'); -System.arraycopy (this.cb, this.markedChar, ncb, 0, delta); -this.cb = ncb; -this.markedChar = 0; -dst = delta; -}this.nextChar = this.nChars = delta; -}}var n; -do { -n = this.$in.read (this.cb, dst, this.cb.length - dst); -} while (n == 0); -if (n > 0) { -this.nChars = dst + n; -this.nextChar = dst; -}}); -Clazz_defineMethod (c$, "read1", - function (cbuf, off, len) { -if (this.nextChar >= this.nChars) { -if (len >= this.cb.length && this.markedChar <= -1 && !this.skipLF) { -return this.$in.read (cbuf, off, len); -}this.fill (); -}if (this.nextChar >= this.nChars) return -1; -if (this.skipLF) { -this.skipLF = false; -if (this.cb[this.nextChar] == '\n') { -this.nextChar++; -if (this.nextChar >= this.nChars) this.fill (); -if (this.nextChar >= this.nChars) return -1; -}}var n = Math.min (len, this.nChars - this.nextChar); -System.arraycopy (this.cb, this.nextChar, cbuf, off, n); -this.nextChar += n; -return n; -}, "~A,~N,~N"); -Clazz_defineMethod (c$, "read", -function (cbuf, off, len) { -{ -this.ensureOpen (); -if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) { -throw new IndexOutOfBoundsException (); -} else if (len == 0) { -return 0; -}var n = this.read1 (cbuf, off, len); -if (n <= 0) return n; -while ((n < len) && this.$in.ready ()) { -var n1 = this.read1 (cbuf, off + n, len - n); -if (n1 <= 0) break; -n += n1; -} -return n; -}}, "~A,~N,~N"); -Clazz_defineMethod (c$, "readLine1", - function (ignoreLF) { -var s = null; -var startChar; -{ -this.ensureOpen (); -var omitLF = ignoreLF || this.skipLF; -for (; ; ) { -if (this.nextChar >= this.nChars) this.fill (); -if (this.nextChar >= this.nChars) { -if (s != null && s.length () > 0) return s.toString (); -return null; -}var eol = false; -var c = String.fromCharCode (0); -var i; -if (omitLF && (this.cb[this.nextChar] == '\n')) this.nextChar++; -this.skipLF = false; -omitLF = false; -charLoop : for (i = this.nextChar; i < this.nChars; i++) { -c = this.cb[i]; -if ((c == '\n') || (c == '\r')) { -eol = true; -break charLoop; -}} -startChar = this.nextChar; -this.nextChar = i; -if (eol) { -var str; -if (s == null) { -str = String.instantialize (this.cb, startChar, i - startChar); -} else { -s.appendCB (this.cb, startChar, i - startChar); -str = s.toString (); -}this.nextChar++; -if (c == '\r') { -this.skipLF = true; -}return str; -}if (s == null) s = JU.SB.newN (80); -s.appendCB (this.cb, startChar, i - startChar); -} -}}, "~B"); -Clazz_defineMethod (c$, "readLine", -function () { -return this.readLine1 (false); -}); -Clazz_overrideMethod (c$, "skip", -function (n) { -if (n < 0) { -throw new IllegalArgumentException ("skip value is negative"); -}{ -this.ensureOpen (); -var r = n; -while (r > 0) { -if (this.nextChar >= this.nChars) this.fill (); -if (this.nextChar >= this.nChars) break; -if (this.skipLF) { -this.skipLF = false; -if (this.cb[this.nextChar] == '\n') { -this.nextChar++; -}}var d = this.nChars - this.nextChar; -if (r <= d) { -this.nextChar += r; -r = 0; -break; -}r -= d; -this.nextChar = this.nChars; -} -return n - r; -}}, "~N"); -Clazz_defineMethod (c$, "ready", -function () { -{ -this.ensureOpen (); -if (this.skipLF) { -if (this.nextChar >= this.nChars && this.$in.ready ()) { -this.fill (); -}if (this.nextChar < this.nChars) { -if (this.cb[this.nextChar] == '\n') this.nextChar++; -this.skipLF = false; -}}return (this.nextChar < this.nChars) || this.$in.ready (); -}}); -Clazz_overrideMethod (c$, "markSupported", -function () { -return true; -}); -Clazz_overrideMethod (c$, "mark", -function (readAheadLimit) { -if (readAheadLimit < 0) { -throw new IllegalArgumentException ("Read-ahead limit < 0"); -}{ -this.ensureOpen (); -this.readAheadLimit = readAheadLimit; -this.markedChar = this.nextChar; -this.markedSkipLF = this.skipLF; -}}, "~N"); -Clazz_overrideMethod (c$, "reset", -function () { -{ -this.ensureOpen (); -if (this.markedChar < 0) throw new java.io.IOException ((this.markedChar == -2) ? "Mark invalid" : "Stream not marked"); -this.nextChar = this.markedChar; -this.skipLF = this.markedSkipLF; -}}); -Clazz_defineMethod (c$, "close", -function () { -{ -if (this.$in == null) return; -this.$in.close (); -this.$in = null; -this.cb = null; -}}); -Clazz_defineStatics (c$, -"INVALIDATED", -2, -"UNMARKED", -1, -"DEFAULT_CHAR_BUFFER_SIZE", 8192, -"DEFAULT_EXPECTED_LINE_LENGTH", 80); -}); -Clazz_load (["java.io.InputStream"], "java.io.ByteArrayInputStream", ["java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.buf = null; -this.pos = 0; -this.$mark = 0; -this.count = 0; -Clazz_instantialize (this, arguments); -}, java.io, "ByteArrayInputStream", java.io.InputStream); -Clazz_makeConstructor (c$, -function (buf) { -Clazz_superConstructor (this, java.io.ByteArrayInputStream, []); -this.buf = buf; -this.pos = 0; -this.count = buf.length; -}, "~A"); -Clazz_overrideMethod (c$, "readByteAsInt", -function () { -return (this.pos < this.count) ? (this.buf[this.pos++] & 0xff) : -1; -}); -Clazz_overrideMethod (c$, "read", -function (b, off, len) { -if (b == null) { -throw new NullPointerException (); -} - if (arguments.length == 1) { off = 0; len = b.length; } - -if (off < 0 || len < 0 || len > b.length - off) { -throw new IndexOutOfBoundsException (); -}if (this.pos >= this.count) { -return -1; -}var avail = this.count - this.pos; -if (len > avail) { -len = avail; -}if (len <= 0) { -return 0; -}System.arraycopy (this.buf, this.pos, b, off, len); -this.pos += len; -return len; -}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "skip", -function (n) { -var k = this.count - this.pos; -if (n < k) { -k = n < 0 ? 0 : n; -}this.pos += k; -return k; -}, "~N"); -Clazz_overrideMethod (c$, "available", -function () { -return this.count - this.pos; -}); -Clazz_overrideMethod (c$, "markSupported", -function () { -return true; -}); -Clazz_overrideMethod (c$, "mark", -function (readAheadLimit) { -this.$mark = this.pos; -}, "~N"); -Clazz_overrideMethod (c$, "resetStream", -function () { -}); -Clazz_overrideMethod (c$, "reset", -function () { -this.pos = this.$mark; -}); -Clazz_overrideMethod (c$, "close", -function () { -}); -}); -Clazz_load (["java.io.Closeable"], "java.io.Reader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.NullPointerException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.lock = null; -this.skipBuffer = null; -Clazz_instantialize (this, arguments); -}, java.io, "Reader", null, java.io.Closeable); -Clazz_makeConstructor (c$, -function (lock) { -if (lock == null) { -throw new NullPointerException (); -}this.lock = lock; -}, "~O"); -Clazz_defineMethod (c$, "skip", -function (n) { -if (n < 0) throw new IllegalArgumentException ("skip value is negative"); -var nn = Math.min (n, 8192); -{ -if ((this.skipBuffer == null) || (this.skipBuffer.length < nn)) this.skipBuffer = Clazz_newCharArray (nn, '\0'); -var r = n; -while (r > 0) { -var nc = this.read (this.skipBuffer, 0, Math.min (r, nn)); -if (nc == -1) break; -r -= nc; -} -return n - r; -}}, "~N"); -Clazz_defineMethod (c$, "ready", -function () { -return false; -}); -Clazz_defineMethod (c$, "markSupported", -function () { -return false; -}); -Clazz_defineMethod (c$, "mark", -function (readAheadLimit) { -throw new java.io.IOException ("mark() not supported"); -}, "~N"); -Clazz_defineMethod (c$, "reset", -function () { -throw new java.io.IOException ("reset() not supported"); -}); -Clazz_defineStatics (c$, -"MAX_SKIP_BUFFE_SIZE", 8192); -}); -Clazz_load (["java.io.Reader"], "java.io.StringReader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.str = null; -this.length = 0; -this.next = 0; -this.$mark = 0; -Clazz_instantialize (this, arguments); -}, java.io, "StringReader", java.io.Reader); -Clazz_makeConstructor (c$, -function (s) { -Clazz_superConstructor (this, java.io.StringReader, [s]); -this.str = s; -this.length = s.length; -}, "~S"); -Clazz_defineMethod (c$, "ensureOpen", - function () { -if (this.str == null) throw new java.io.IOException ("Stream closed"); -}); -Clazz_overrideMethod (c$, "read", -function (cbuf, off, len) { -{ -this.ensureOpen (); -if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) { -throw new IndexOutOfBoundsException (); -} else if (len == 0) { -return 0; -}if (this.next >= this.length) return -1; -var n = Math.min (this.length - this.next, len); -this.str.getChars (this.next, this.next + n, cbuf, off); -this.next += n; -return n; -}}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "skip", -function (ns) { -{ -this.ensureOpen (); -if (this.next >= this.length) return 0; -var n = Math.min (this.length - this.next, ns); -n = Math.max (-this.next, n); -this.next += n; -return n; -}}, "~N"); -Clazz_overrideMethod (c$, "ready", -function () { -{ -this.ensureOpen (); -return true; -}}); -Clazz_overrideMethod (c$, "markSupported", -function () { -return true; -}); -Clazz_overrideMethod (c$, "mark", -function (readAheadLimit) { -if (readAheadLimit < 0) { -throw new IllegalArgumentException ("Read-ahead limit < 0"); -}{ -this.ensureOpen (); -this.$mark = this.next; -}}, "~N"); -Clazz_overrideMethod (c$, "reset", -function () { -{ -this.ensureOpen (); -this.next = this.$mark; -}}); -Clazz_overrideMethod (c$, "close", -function () { -this.str = null; -}); -}); -Clazz_declarePackage ("JU"); -Clazz_load (null, "JU.Base64", ["JU.SB"], function () { -c$ = Clazz_declareType (JU, "Base64"); -c$.getBytes64 = Clazz_defineMethod (c$, "getBytes64", -function (bytes) { -return JU.Base64.getBase64 (bytes).toBytes (0, -1); -}, "~A"); -c$.getBase64 = Clazz_defineMethod (c$, "getBase64", -function (bytes) { -var nBytes = bytes.length; -var sout = new JU.SB (); -if (nBytes == 0) return sout; -for (var i = 0, nPad = 0; i < nBytes && nPad == 0; ) { -if (i % 75 == 0 && i != 0) sout.append ("\r\n"); -nPad = (i + 2 == nBytes ? 1 : i + 1 == nBytes ? 2 : 0); -var outbytes = ((bytes[i++] << 16) & 0xFF0000) | ((nPad == 2 ? 0 : bytes[i++] << 8) & 0x00FF00) | ((nPad >= 1 ? 0 : bytes[i++]) & 0x0000FF); -sout.appendC (JU.Base64.base64.charAt ((outbytes >> 18) & 0x3F)); -sout.appendC (JU.Base64.base64.charAt ((outbytes >> 12) & 0x3F)); -sout.appendC (nPad == 2 ? '=' : JU.Base64.base64.charAt ((outbytes >> 6) & 0x3F)); -sout.appendC (nPad >= 1 ? '=' : JU.Base64.base64.charAt (outbytes & 0x3F)); -} -return sout; -}, "~A"); -c$.decodeBase64 = Clazz_defineMethod (c$, "decodeBase64", -function (strBase64) { -var nBytes = 0; -var ch; -var pt0 = strBase64.indexOf (";base64,") + 1; -if (pt0 > 0) pt0 += 7; -var chars64 = strBase64.toCharArray (); -var len64 = chars64.length; -if (len64 == 0) return Clazz_newByteArray (0, 0); -for (var i = len64; --i >= pt0; ) nBytes += ((ch = (chars64[i]).charCodeAt (0) & 0x7F) == 65 || JU.Base64.decode64[ch] > 0 ? 3 : 0); - -nBytes = nBytes >> 2; -var bytes = Clazz_newByteArray (nBytes, 0); -var offset = 18; -for (var i = pt0, pt = 0, b = 0; i < len64; i++) { -if (JU.Base64.decode64[ch = (chars64[i]).charCodeAt (0) & 0x7F] > 0 || ch == 65 || ch == 61) { -b |= JU.Base64.decode64[ch] << offset; -offset -= 6; -if (offset < 0) { -bytes[pt++] = ((b & 0xFF0000) >> 16); -if (pt < nBytes) bytes[pt++] = ((b & 0xFF00) >> 8); -if (pt < nBytes) bytes[pt++] = (b & 0xFF); -offset = 18; -b = 0; -}}} -return bytes; -}, "~S"); -Clazz_defineStatics (c$, -"base64", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", -"decode64", Clazz_newIntArray (-1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 62, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0])); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["java.lang.Enum"], "JU.Encoding", null, function () { -c$ = Clazz_declareType (JU, "Encoding", Enum); -Clazz_defineEnumConstant (c$, "NONE", 0, []); -Clazz_defineEnumConstant (c$, "UTF8", 1, []); -Clazz_defineEnumConstant (c$, "UTF_16BE", 2, []); -Clazz_defineEnumConstant (c$, "UTF_16LE", 3, []); -Clazz_defineEnumConstant (c$, "UTF_32BE", 4, []); -Clazz_defineEnumConstant (c$, "UTF_32LE", 5, []); -}); -Clazz_declarePackage ("java.util"); -Clazz_load (["java.lang.RuntimeException"], "java.util.MissingResourceException", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.className = null; -this.key = null; -Clazz_instantialize (this, arguments); -}, java.util, "MissingResourceException", RuntimeException); -Clazz_makeConstructor (c$, -function (s, className, key) { -Clazz_superConstructor (this, java.util.MissingResourceException, [s]); -this.className = className; -this.key = key; -}, "~S,~S,~S"); -Clazz_makeConstructor (c$, -function (message, className, key, cause) { -Clazz_superConstructor (this, java.util.MissingResourceException, [message, cause]); -this.className = className; -this.key = key; -}, "~S,~S,~S,Throwable"); -Clazz_defineMethod (c$, "getClassName", -function () { -return this.className; -}); -Clazz_defineMethod (c$, "getKey", -function () { -return this.key; -}); -}); -Clazz_declarePackage ("jssun.misc"); -Clazz_load (null, "jssun.misc.MessageUtils", ["java.lang.Character", "$.StringBuffer"], function () { -c$ = Clazz_declareType (jssun.misc, "MessageUtils"); -Clazz_makeConstructor (c$, -function () { -}); -c$.subst = Clazz_defineMethod (c$, "subst", -function (patt, arg) { -var args = Clazz_newArray (-1, [arg]); -return jssun.misc.MessageUtils.subst (patt, args); -}, "~S,~S"); -c$.subst = Clazz_defineMethod (c$, "subst", -function (patt, arg1, arg2) { -var args = Clazz_newArray (-1, [arg1, arg2]); -return jssun.misc.MessageUtils.subst (patt, args); -}, "~S,~S,~S"); -c$.subst = Clazz_defineMethod (c$, "subst", -function (patt, arg1, arg2, arg3) { -var args = Clazz_newArray (-1, [arg1, arg2, arg3]); -return jssun.misc.MessageUtils.subst (patt, args); -}, "~S,~S,~S,~S"); -c$.subst = Clazz_defineMethod (c$, "subst", -function (patt, args) { -var result = new StringBuffer (); -var len = patt.length; -for (var i = 0; i >= 0 && i < len; i++) { -var ch = patt.charAt (i); -if (ch == '%') { -if (i != len) { -var index = Character.digit (patt.charAt (i + 1), 10); -if (index == -1) { -result.append (patt.charAt (i + 1)); -i++; -} else if (index < args.length) { -result.append (args[index]); -i++; -}}} else { -result.append (ch); -}} -return result.toString (); -}, "~S,~A"); -c$.substProp = Clazz_defineMethod (c$, "substProp", -function (propName, arg) { -return jssun.misc.MessageUtils.subst (System.getProperty (propName), arg); -}, "~S,~S"); -c$.substProp = Clazz_defineMethod (c$, "substProp", -function (propName, arg1, arg2) { -return jssun.misc.MessageUtils.subst (System.getProperty (propName), arg1, arg2); -}, "~S,~S,~S"); -c$.substProp = Clazz_defineMethod (c$, "substProp", -function (propName, arg1, arg2, arg3) { -return jssun.misc.MessageUtils.subst (System.getProperty (propName), arg1, arg2, arg3); -}, "~S,~S,~S,~S"); -c$.toStderr = Clazz_defineMethod (c$, "toStderr", -function (msg) { -{ -System.out.println(msg); -}}, "~S"); -c$.toStdout = Clazz_defineMethod (c$, "toStdout", -function (msg) { -{ -System.out.println(msg); -}}, "~S"); -c$.err = Clazz_defineMethod (c$, "err", -function (s) { -jssun.misc.MessageUtils.toStderr (s + "\n"); -}, "~S"); -c$.out = Clazz_defineMethod (c$, "out", -function (s) { -jssun.misc.MessageUtils.toStdout (s + "\n"); -}, "~S"); -c$.where = Clazz_defineMethod (c$, "where", -function () { -{ -System.out.println(Clazz_getStackTrace()); -}}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.geom.Dimension2D"], "java.awt.Dimension", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.width = 0; -this.height = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "Dimension", java.awt.geom.Dimension2D); -Clazz_makeConstructor (c$, -function () { -this.construct (0, 0); -}); -Clazz_makeConstructor (c$, -function (d) { -this.construct (d.width, d.height); -}, "java.awt.Dimension"); -Clazz_makeConstructor (c$, -function (width, height) { -Clazz_superConstructor (this, java.awt.Dimension, []); -this.width = width; -this.height = height; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getWidth", -function () { -return this.width; -}); -Clazz_overrideMethod (c$, "getHeight", -function () { -return this.height; -}); -Clazz_defineMethod (c$, "setSize", -function (width, height) { -this.width = Clazz_doubleToInt (Math.ceil (width)); -this.height = Clazz_doubleToInt (Math.ceil (height)); -}, "~N,~N"); -Clazz_defineMethod (c$, "getSize", -function () { -return new java.awt.Dimension (this.width, this.height); -}); -Clazz_defineMethod (c$, "setSize", -function (d) { -this.setSize (d.width, d.height); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "setSize", -function (width, height) { -this.width = width; -this.height = height; -}, "~N,~N"); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (Clazz_instanceOf (obj, java.awt.Dimension)) { -var d = obj; -return (this.width == d.width) && (this.height == d.height); -}return false; -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -var sum = this.width + this.height; -return Clazz_doubleToInt (sum * (sum + 1) / 2) + this.width; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[width=" + this.width + ",height=" + this.height + "]"; -}); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (null, "java.awt.geom.Dimension2D", ["java.lang.InternalError"], function () { -c$ = Clazz_declareType (java.awt.geom, "Dimension2D", null, Cloneable); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setSize", -function (d) { -this.setSize (d.getWidth (), d.getHeight ()); -}, "java.awt.geom.Dimension2D"); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.Dimension2D, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.Container"], "java.awt.Panel", ["java.awt.FlowLayout"], function () { -c$ = Clazz_declareType (java.awt, "Panel", java.awt.Container); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.Panel, []); -this.setPanel (); -}); -Clazz_defineMethod (c$, "setPanel", -function () { -this.setAppContext (); -this.setLayout ( new java.awt.FlowLayout ()); -}); -Clazz_makeConstructor (c$, -function (layout) { -Clazz_superConstructor (this, java.awt.Panel, []); -if (layout == null) layout = new java.awt.FlowLayout (); -this.setAppContext (); -this.setLayout (layout); -}, "java.awt.LayoutManager"); -Clazz_overrideMethod (c$, "constructComponentName", -function () { -{ -return "panel" + java.awt.Panel.nameCounter++; -}}); -Clazz_defineMethod (c$, "addNotify", -function () { -if (this.peer == null) this.peer = this.getToolkit ().createPanel (this); -Clazz_superCall (this, java.awt.Panel, "addNotify", []); -}); -Clazz_defineStatics (c$, -"base", "panel", -"nameCounter", 0); -}); -Clazz_load(["java.util.AbstractList","$.List","$.RandomAccess"],"java.util.ArrayList",["java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","java.lang.reflect.Array","java.util.Arrays"],function(){ -c$=Clazz_decorateAsClass(function(){ -this.firstIndex=0; -this.lastIndex=0; -this.array=null; -Clazz_instantialize(this,arguments); -},java.util,"ArrayList",java.util.AbstractList,[java.util.List,Cloneable,java.io.Serializable,java.util.RandomAccess]); - -Clazz_overrideConstructor(c$, -function(){ -this.setup(0); -}); - -Clazz_defineMethod(c$, "setup", -function(capacity){ -//Clazz_superConstructor(this,java.util.ArrayList,[]); -this.firstIndex=this.lastIndex=0; -try{ -this.array=this.newElementArray(capacity); -}catch(e){ -if(Clazz_instanceOf(e,NegativeArraySizeException)){ -throw new IllegalArgumentException(); -}else{ -throw e; -} -} -},"~N"); -/* -Clazz_makeConstructor(c$, -function(collection){ -Clazz_superConstructor(this,java.util.ArrayList,[]); -var size=collection.size(); -this.firstIndex=this.lastIndex=0; -this.array=this.newElementArray(size+(Math.floor(size/10))); -this.addAll(collection); -},"java.util.Collection"); - -*/ - -Clazz_defineMethod(c$,"newElementArray", -($fz=function(size){ -return new Array(size); -},$fz.isPrivate=true,$fz),"~N"); - -Clazz_overrideMethod(c$,"add", -function(location,object){ - -if (arguments.length == 1) { - // coming from Java methods, e.g. Collections.list() - // location is actually the object - return this.add1(location); -} -var size=this.size(); -if(00)||this.lastIndex==this.array.length){ -System.arraycopy(this.array,this.firstIndex,this.array,--this.firstIndex,location); -}else{ -var index=location+this.firstIndex; -System.arraycopy(this.array,index,this.array,index+1,size-location); -this.lastIndex++; -}this.array[location+this.firstIndex]=object; -}else if(location==0){ -if(this.firstIndex==0){ -this.growAtFront(1); -}this.array[--this.firstIndex]=object; -}else if(location==size){ -if(this.lastIndex==this.array.length){ -this.growAtEnd(1); -}this.array[this.lastIndex++]=object; -}else{ -throw new IndexOutOfBoundsException(); -}this.modCount++; -},"~N,~O"); - -Clazz_overrideMethod(c$,"add1", -function(object){ -if(this.lastIndex==this.array.length){ -this.growAtEnd(1); -}this.array[this.lastIndex++]=object; -this.modCount++; -return true; -},"~O"); - -/* BH disallow addAll(int,List) - * -Clazz_defineMethod(c$,"addAll", -function(location,collection){ -var size=this.size(); -if(location<0||location>size){ -throw new IndexOutOfBoundsException(); -}var growSize=collection.size(); -if(00)||this.lastIndex>this.array.length-growSize){ -var newFirst=this.firstIndex-growSize; -if(newFirst<0){ -var index=location+this.firstIndex; -System.arraycopy(this.array,index,this.array,index-newFirst,size-location); -this.lastIndex-=newFirst; -newFirst=0; -}System.arraycopy(this.array,this.firstIndex,this.array,newFirst,location); -this.firstIndex=newFirst; -}else{ -var index=location+this.firstIndex; -System.arraycopy(this.array,index,this.array,index+growSize,size-location); -this.lastIndex+=growSize; -}}else if(location==0){ -this.growAtFront(growSize); -this.firstIndex-=growSize; -}else if(location==size){ -if(this.lastIndex>this.array.length-growSize){ -this.growAtEnd(growSize); -}this.lastIndex+=growSize; -}if(growSize>0){ -var it=collection.iterator(); -var index=location+this.firstIndex; -var end=index+growSize; -while(index0){ - if(this.lastIndex>this.array.length-growSize){ - this.growAtEnd(growSize); -} -var it=collection.iterator(); -var end=this.lastIndex+growSize; -while(this.lastIndex= i1;) -this.array[i] = null; -},"~N,~N"); - -Clazz_defineMethod(c$,"clone", -function(){ -try{ -var newList=Clazz_superCall(this,java.util.ArrayList,"clone",[]); -newList.array=this.array.clone(); -return newList; -}catch(e){ -if(Clazz_instanceOf(e,CloneNotSupportedException)){ -return null; -}else{ -throw e; -} -} -}); -Clazz_overrideMethod(c$,"contains", -function(object){ -if(object!=null){ -for(var i=this.firstIndex;i0){ -this.growAtFront(minimumCapacity-this.array.length); -}else{ -this.growAtEnd(minimumCapacity-this.array.length); -}}},"~N"); -Clazz_overrideMethod(c$,"get", -function(location){ -if(0<=location&&location=required-(this.array.length-this.lastIndex)){ - var newLast=this.lastIndex-this.firstIndex; - if(size>0){ - System.arraycopy(this.array,this.firstIndex,this.array,0,size); - var start=newLastincrement){ - increment=required; - } - if(increment<12){ - increment=12; - } - var newArray=this.newElementArray(size+increment); - if(size>0){ - System.arraycopy(this.array,this.firstIndex,newArray,this.firstIndex,size); - } - this.array=newArray; -} - -},$fz.isPrivate=true,$fz),"~N"); -Clazz_defineMethod(c$,"growAtFront", -($fz=function(required){ -var size=this.size(); -if(this.array.length-this.lastIndex>=required){ -var newFirst=this.array.length-size; -if(size>0){ -System.arraycopy(this.array,this.firstIndex,this.array,newFirst,size); -var length=this.firstIndex+size>newFirst?newFirst:this.firstIndex+size; -this.fill(this.firstIndex,length); -}this.firstIndex=newFirst; -this.lastIndex=this.array.length; -}else{ -var increment=Math.floor(size/2); -if(required>increment){ -increment=required; -}if(increment<12){ -increment=12; -}var newArray=this.newElementArray(size+increment); -if(size>0){ -System.arraycopy(this.array,this.firstIndex,newArray,newArray.length-size,size); -}this.firstIndex=newArray.length-size; -this.lastIndex=newArray.length; -this.array=newArray; -}},$fz.isPrivate=true,$fz),"~N"); -Clazz_defineMethod(c$,"growForInsert", -($fz=function(location,required){ -var size=this.size(); -var increment=Math.floor(size/2); -if(required>increment){ -increment=required; -}if(increment<12){ -increment=12; -}var newArray=this.newElementArray(size+increment); -if(location=this.firstIndex;i--){ -if(object.equals(this.array[i])){ -return i-this.firstIndex; -}} -}else{ -for(var i=this.lastIndex-1;i>=this.firstIndex;i--){ -if(this.array[i]==null){ -return i-this.firstIndex; -}} -}return-1; -},"~O"); -Clazz_overrideMethod(c$,"remove", -function(location){ -var result; -var size=this.size(); -if(0<=location&&location=0&&start<=end&&end<=this.size()){ -if(start==end){ -return; -}var size=this.size(); -if(end==size){ - this.fill(this.firstIndex+start,this.lastIndex); -this.lastIndex=this.firstIndex+start; -}else if(start==0){ - this.fill(this.firstIndex,this.firstIndex+end); -this.firstIndex+=end; -}else{ -System.arraycopy(this.array,this.firstIndex+end,this.array,this.firstIndex+start,size-end); -var newLast=this.lastIndex+start-end; -this.fill(newLast,this.lastIndex); -this.lastIndex=newLast; -}this.modCount++; -}else{ -throw new IndexOutOfBoundsException(); -}},"~N,~N"); -Clazz_overrideMethod(c$,"set", -function(location,object){ -if(0<=location&&locationcontents.length) - contents= new Array(size); -System.arraycopy(this.array,this.firstIndex,contents,0,size); -if(size=0; -}); -Clazz_overrideMethod(c$,"nextIndex", -function(){ -return this.pos+1; -}); -Clazz_overrideMethod(c$,"previous", -function(){ -if(this.expectedModCount==this._list.modCount){ -try{ -var a=this._list.get(this.pos); -this.lastPosition=this.pos; -this.pos--; -return a; -}catch(e){ -if(Clazz_instanceOf(e,IndexOutOfBoundsException)){ -throw new java.util.NoSuchElementException(); -}else{ -throw e; -} -} -}throw new java.util.ConcurrentModificationException(); -}); -Clazz_overrideMethod(c$,"previousIndex", -function(){ -return this.pos; -}); -Clazz_overrideMethod(c$,"set", -function(a){ -if(this.expectedModCount==this._list.modCount){ -try{ -this._list.set(this.lastPosition,a); -}catch(e){ -if(Clazz_instanceOf(e,IndexOutOfBoundsException)){ -throw new IllegalStateException(); -}else{ -throw e; -} -} -}else{ -throw new java.util.ConcurrentModificationException(); -}},"~O"); -c$=Clazz_p0p(); -//}; - - - - -Clazz_pu$h(self.c$); -c$=Clazz_declareType(java.util.AbstractList,"SubAbstractListRandomAccess",java.util.AbstractList.SubAbstractList,java.util.RandomAccess); -c$=Clazz_p0p(); - - - - -Clazz_pu$h(self.c$); -c$=Clazz_decorateAsClass(function(){ -this.fullList=null; -this.offset=0; -this.$size=0; -Clazz_instantialize(this,arguments); -},java.util.AbstractList,"SubAbstractList",java.util.AbstractList); -Clazz_makeConstructor(c$, -function(a,b,c){ -Clazz_superConstructor(this,java.util.AbstractList.SubAbstractList); -this.fullList=a; -this.modCount=this.fullList.modCount; -this.offset=b; -this.$size=c-b; -},"java.util.AbstractList,~N,~N"); -Clazz_defineMethod(c$,"add", -function(a,b){ -if(this.modCount==this.fullList.modCount){ -if(0<=a&&a<=this.$size){ -this.fullList.add(a+this.offset,b); -this.$size++; -this.modCount=this.fullList.modCount; -}else{ -throw new IndexOutOfBoundsException(); -}}else{ -throw new java.util.ConcurrentModificationException(); -}},"~N,~O"); -Clazz_defineMethod(c$,"addAll", -function(a,b){ -if(this.modCount==this.fullList.modCount){ -if(0<=a&&a<=this.$size){ -var c=this.fullList.addAll(a+this.offset,b); -if(c){ -this.$size+=b.size(); -this.modCount=this.fullList.modCount; -}return c; -}throw new IndexOutOfBoundsException(); -}throw new java.util.ConcurrentModificationException(); -},"~N,java.util.Collection"); -Clazz_defineMethod(c$,"addAll", -function(a){ -if(this.modCount==this.fullList.modCount){ -var b=this.fullList.addAll(this.offset+this.$size,a); -if(b){ -this.$size+=a.size(); -this.modCount=this.fullList.modCount; -}return b; -}throw new java.util.ConcurrentModificationException(); -},"java.util.Collection"); -Clazz_defineMethod(c$,"get", -function(a){ -if(this.modCount==this.fullList.modCount){ -if(0<=a&&a=this.start; -}); -Clazz_defineMethod(c$,"next", -function(){ -if(this.iterator.nextIndex()=this.start){ -return this.iterator.previous(); -}throw new java.util.NoSuchElementException(); -}); -Clazz_defineMethod(c$,"previousIndex", -function(){ -var a=this.iterator.previousIndex(); -if(a>=this.start){ -return a-this.start; -}return-1; -}); -Clazz_defineMethod(c$,"remove", -function(){ -this.iterator.remove(); -this.subList.sizeChanged(false); -this.end--; -}); -Clazz_defineMethod(c$,"set", -function(a){ -this.iterator.set(a); -},"~O"); -c$=Clazz_p0p(); -c$=Clazz_p0p(); -}); -// 4/23/2015 1:20:24 PM BH removing need for array.getClass().getComponentType() - -Clazz_load(["java.util.Collection"],"java.util.AbstractCollection",["java.lang.StringBuilder","$.UnsupportedOperationException","java.lang.reflect.Array"],function(){ -c$=Clazz_declareType(java.util,"AbstractCollection",null,java.util.Collection); -Clazz_makeConstructor(c$, -function(){ -}); -Clazz_overrideMethod(c$,"add", -function(object){ -throw new UnsupportedOperationException(); -},"~O"); -Clazz_overrideMethod(c$,"addAll", -function(collection){ -var result=false; -var it=collection.iterator(); -while(it.hasNext()){ -if(this.add(it.next())){ -result=true; -}} -return result; -},"java.util.Collection"); -Clazz_overrideMethod(c$,"clear", -function(){ -var it=this.iterator(); -while(it.hasNext()){ -it.next(); -it.remove(); -} -}); -Clazz_overrideMethod(c$,"contains", -function(object){ -var it=this.iterator(); -if(object!=null){ -while(it.hasNext()){ -if(object.equals(it.next())){ -return true; -}} -}else{ -while(it.hasNext()){ -if(it.next()==null){ -return true; -}} -}return false; -},"~O"); -Clazz_overrideMethod(c$,"containsAll", -function(collection){ -var it=collection.iterator(); -while(it.hasNext()){ -if(!this.contains(it.next())){ -return false; -}} -return true; -},"java.util.Collection"); -Clazz_overrideMethod(c$,"isEmpty", -function(){ -return this.size()==0; -}); -Clazz_overrideMethod(c$,"remove", -function(object){ -var it=this.iterator(); -if(object!=null){ -while(it.hasNext()){ -if(object.equals(it.next())){ -it.remove(); -return true; -}} -}else{ -while(it.hasNext()){ -if(it.next()==null){ -it.remove(); -return true; -}} -}return false; -},"~O"); -Clazz_overrideMethod(c$,"removeAll", -function(collection){ -var result=false; -var it=this.iterator(); -while(it.hasNext()){ -if(collection.contains(it.next())){ -it.remove(); -result=true; -}} -return result; -},"java.util.Collection"); -Clazz_overrideMethod(c$,"retainAll", -function(collection){ -var result=false; -var it=this.iterator(); -while(it.hasNext()){ -if(!collection.contains(it.next())){ -it.remove(); -result=true; -}} -return result; -},"java.util.Collection"); -Clazz_defineMethod(c$,"toArray", -function(){ -var size=this.size(); -var index=0; -var it=this.iterator(); -var array=new Array(size); -while(indexcontents.length){ // BH unnec -//var ct=contents.getClass().getComponentType(); -//contents=java.lang.reflect.Array.newInstance(ct,size); -//} -for(var entry,$entry=this.iterator();$entry.hasNext()&&((entry=$entry.next())||true);){ -contents[index++]=entry; -} -if(index=0){ -//this.elementCount=0; -//this.elementData=this.newElementArray(capacity==0?1:capacity); -//this.loadFactor=0.75; -//this.computeMaxSize(); -//}else{ -//throw new IllegalArgumentException(); -//}},"~N"); -Clazz_makeConstructor(c$, -function(){ -this.construct(16); -}); -Clazz_makeConstructor(c$, -function(capacity){ -Clazz_superConstructor(this,java.util.HashMap,[]); -if(capacity>=0){ -this.elementCount=0; -this.elementData=this.newElementArray(capacity==0?1:capacity); -this.loadFactor=0.75; -this.computeMaxSize(); -}else{ -throw new IllegalArgumentException(); -}},"~N"); -Clazz_makeConstructor(c$, -function(capacity,loadFactor){ -Clazz_superConstructor(this,java.util.HashMap,[]); -if(capacity>=0&&loadFactor>0){ -this.elementCount=0; -this.elementData=this.newElementArray(capacity==0?1:capacity); -this.loadFactor=loadFactor; -this.computeMaxSize(); -}else{ -throw new IllegalArgumentException(); -}},"~N,~N"); -Clazz_makeConstructor(c$, -function(map){ -this.construct(map.size()<6?11:map.size()*2); -Clazz_superCall(this,java.util.HashMap,"putAll",[map]); -},"java.util.Map"); - - -/* -Clazz_makeConstructor(c$, -function(capacity,loadFactor){ -this.doConstruct(capacity,loadFactor); -},"~N,~N"); - -Clazz_defineMethod(c$, "doConstruct", -function(capacity,loadFactor) { -capacity || (capacity = 16); -loadFactor || (loadFactor = 0.75); -if (typeof capacity != "number") { - var map = capacity; - this.loadFactor=loadFactor; - this.elementData=this.newElementArray(map.size()<6?11:map.size()*2); - this.computeMaxSize(); - this.putAllHM(map); - return; -} - -//Clazz_superConstructor(this,java.util.HashMap,[]); -if(capacity>=0&&loadFactor>0){ -this.elementData=this.newElementArray(capacity==0?1:capacity); -this.loadFactor=loadFactor; -this.computeMaxSize(); -}else{ -throw new IllegalArgumentException(); -} -},"~N,~N"); - -//Clazz_makeConstructor(c$, -//function(map){ -//this.construct(map.size()<6?11:map.size()*2); -//Clazz_superCall(this,java.util.HashMap,"putAll",[map]); -//},"java.util.Map"); - -*/ -Clazz_overrideMethod(c$,"clear", -function(){ -if(this.elementCount>0){ -this.elementCount=0; -java.util.Arrays.fill(this.elementData,null); -this.modCount++; -}}); -Clazz_defineMethod(c$,"clone", -function(){ - return this.cloneHM(); -}); - -Clazz_defineMethod(c$,"cloneHM", -function(){ -try{ -var map=this.cloneAM();//Clazz_superCall(this,java.util.HashMap,"clone",[]); -map.elementData=this.newElementArray(this.elementData.length); -var entry; -for(var i=0;i=0;){ -var entry=this.elementData[i]; -while(entry!=null){ -if(value.equals(entry.value)){ -return true; -}entry=entry.next; -} -} -}else{ -for(var i=this.elementData.length;--i>=0;){ -var entry=this.elementData[i]; -while(entry!=null){ -if(entry.value==null){ -return true; -}entry=entry.next; -} -} -}return false; -},"~O"); -Clazz_overrideMethod(c$,"entrySet", -function(){ -return new java.util.HashMap.HashMapEntrySet(this); -}); -Clazz_overrideMethod(c$,"get", -function(key){ -var m=this.getEntry(key); -if(m!=null){ -return m.value; -}return null; -},"~O"); -Clazz_defineMethod(c$,"getEntry", -function(key){ -var index=this.getModuloHash(key); -return this.findEntry(key,index); -},"~O"); -Clazz_defineMethod(c$,"getModuloHash", -function(key){ -if(key==null){ -return 0; -}return(key.hashCode()&0x7FFFFFFF)%this.elementData.length; -},"~O"); -Clazz_defineMethod(c$,"findEntry", -function(key,index){ -var m; -m=this.elementData[index]; -if(key!=null){ -while(m!=null&&!this.keysEqual(key,m)){ -m=m.next; -} -}else{ -while(m!=null&&m.key!=null){ -m=m.next; -} -}return m; -},"~O,~N"); -Clazz_overrideMethod(c$,"isEmpty", -function(){ -return this.elementCount==0; -}); -Clazz_overrideMethod(c$,"keySet", -function(){ -if(this.$keySet==null){ -this.$keySet=((Clazz_isClassDefined("java.util.HashMap$1")?0:java.util.HashMap.$HashMap$1$()),Clazz_innerTypeInstance(java.util.HashMap$1,this,null)); -}return this.$keySet; -}); -Clazz_overrideMethod(c$,"put", -function(key,value){ -var index=this.getModuloHash(key); -var entry=this.findEntry(key,index); -if(entry==null){ -this.modCount++; -if(++this.elementCount>this.threshold){ -this.rehash(); -index=key==null?0:(key.hashCode()&0x7FFFFFFF)%this.elementData.length; -}entry=this.createEntry(key,index,value); -return null; -}var result=entry.value; -entry.value=value; -return result; -},"~O,~O"); -Clazz_defineMethod(c$,"createEntry", -function(key,index,value){ -var entry=new java.util.HashMap.Entry(key,value); -entry.next=this.elementData[index]; -this.elementData[index]=entry; -return entry; -},"~O,~N,~O"); -Clazz_defineMethod(c$,"putAll", -function(map){ -if(!map.isEmpty()){ -var capacity=this.elementCount+map.size(); -if(capacity>this.threshold){ -this.rehash(capacity); -} -this.putAllHM(map); - -}},"java.util.Map"); -Clazz_defineMethod(c$,"rehash", -function(capacity){ -var length=(capacity==0?1:capacity<<1); -var newData=this.newElementArray(length); -for(var i=0;itwice?min:twice,'\0'); -System.arraycopy(this.value,0,newData,0,this.count); -this.value=newData; -this.shared=false; -},$fz.isPrivate=true,$fz),"~N"); -Clazz_defineMethod(c$,"appendNull", -function(){ -var newSize=this.count+4; -if(newSize>this.value.length){ -this.enlargeBuffer(newSize); -}else if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}this.value[this.count++]='n'; -this.value[this.count++]='u'; -this.value[this.count++]='l'; -this.value[this.count++]='l'; -}); -Clazz_defineMethod(c$,"append0", -function(chars){ -var newSize=this.count+chars.length; -if(newSize>this.value.length){ -this.enlargeBuffer(newSize); -}else if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}System.arraycopy(chars,0,this.value,this.count,chars.length); -this.count=newSize; -},"~A"); -Clazz_defineMethod(c$,"append0", -function(chars,start,length){ -if(chars==null){ -throw new NullPointerException(); -}if(start>=0&&0<=length&&length<=chars.length-start){ -var newSize=this.count+length; -if(newSize>this.value.length){ -this.enlargeBuffer(newSize); -}else if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}System.arraycopy(chars,start,this.value,this.count,length); -this.count=newSize; -}else{ -throw new ArrayIndexOutOfBoundsException(); -}},"~A,~N,~N"); -Clazz_defineMethod(c$,"append0", -function(ch){ -if(this.count==this.value.length){ -this.enlargeBuffer(this.count+1); -}if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}this.value[this.count++]=ch; -},"~N"); -Clazz_defineMethod(c$,"append0", -function(string){ -if(string==null){ -this.appendNull(); -return; -}var adding=string.length; -var newSize=this.count+adding; -if(newSize>this.value.length){ -this.enlargeBuffer(newSize); -}else if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}string.getChars(0,adding,this.value,this.count); -this.count=newSize; -},"~S"); -Clazz_defineMethod(c$,"append0", -function(s,start,end){ -if(s==null)s="null"; -if(start<0||end<0||start>end||end>s.length())throw new IndexOutOfBoundsException(); -this.append0(s.subSequence(start,end).toString()); -},"CharSequence,~N,~N"); -Clazz_defineMethod(c$,"capacity", -function(){ -return this.value.length; -}); -Clazz_defineMethod(c$,"charAt", -function(index){ -if(index<0||index>=this.count)throw new StringIndexOutOfBoundsException(index); -return this.value[index]; -},"~N"); -Clazz_defineMethod(c$,"delete0", -function(start,end){ -if(start>=0){ -if(end>this.count){ -end=this.count; -}if(end==start){ -return; -}if(end>start){ -var length=this.count-end; -if(length>0){ -if(!this.shared){ -System.arraycopy(this.value,end,this.value,start,length); -}else{ -var newData=Clazz_newArray(this.value.length,'\0'); -System.arraycopy(this.value,0,newData,0,start); -System.arraycopy(this.value,end,newData,start,length); -this.value=newData; -this.shared=false; -}}this.count-=end-start; -return; -}}throw new StringIndexOutOfBoundsException(); -},"~N,~N"); -Clazz_defineMethod(c$,"deleteCharAt0", -function(location){ -if(0>location||location>=this.count)throw new StringIndexOutOfBoundsException(location); -var length=this.count-location-1; -if(length>0){ -if(!this.shared){ -System.arraycopy(this.value,location+1,this.value,location,length); -}else{ -var newData=Clazz_newArray(this.value.length,'\0'); -System.arraycopy(this.value,0,newData,0,location); -System.arraycopy(this.value,location+1,newData,location,length); -this.value=newData; -this.shared=false; -}}this.count--; -},"~N"); -Clazz_defineMethod(c$,"ensureCapacity", -function(min){ -if(min>this.value.length){ -this.enlargeBuffer(min); -}},"~N"); -Clazz_defineMethod(c$,"getChars", -function(start,end,dest,destStart){ -if(start>this.count||end>this.count||start>end){ -throw new StringIndexOutOfBoundsException(); -}System.arraycopy(this.value,start,dest,destStart,end-start); -},"~N,~N,~A,~N"); -Clazz_defineMethod(c$,"insert0", -function(index,chars){ -if(0>index||index>this.count){ -throw new StringIndexOutOfBoundsException(index); -}if(chars.length!=0){ -this.move(chars.length,index); -System.arraycopy(chars,0,this.value,index,chars.length); -this.count+=chars.length; -}},"~N,~A"); -Clazz_defineMethod(c$,"insert0", -function(index,chars,start,length){ -if(0<=index&&index<=this.count){ -if(start>=0&&0<=length&&length<=chars.length-start){ -if(length!=0){ -this.move(length,index); -System.arraycopy(chars,start,this.value,index,length); -this.count+=length; -}return; -}throw new StringIndexOutOfBoundsException("offset "+start+", len "+length+", array.length "+chars.length); -}throw new StringIndexOutOfBoundsException(index); -},"~N,~A,~N,~N"); -Clazz_defineMethod(c$,"insert0", -function(index,ch){ -if(0>index||index>this.count){ -throw new ArrayIndexOutOfBoundsException(index); -}this.move(1,index); -this.value[index]=ch; -this.count++; -},"~N,~N"); -Clazz_defineMethod(c$,"insert0", -function(index,string){ -if(0<=index&&index<=this.count){ -if(string==null)string="null"; -var min=string.length; -if(min!=0){ -this.move(min,index); -string.getChars(0,min,this.value,index); -this.count+=min; -}}else{ -throw new StringIndexOutOfBoundsException(index); -}},"~N,~S"); -Clazz_defineMethod(c$,"insert0", -function(index,s,start,end){ -if(s==null)s="null"; -if(index<0||index>this.count||start<0||end<0||start>end||end>s.length())throw new IndexOutOfBoundsException(); -this.insert0(index,s.subSequence(start,end).toString()); -},"~N,CharSequence,~N,~N"); -Clazz_defineMethod(c$,"length", -function(){ -return this.count; -}); -Clazz_defineMethod(c$,"move", -($fz=function(size,index){ -var newSize; -if(this.value.length-this.count>=size){ -if(!this.shared){ -System.arraycopy(this.value,index,this.value,index+size,this.count-index); -return; -}newSize=this.value.length; -}else{ -var a=this.count+size; -var b=(this.value.length<<1)+2; -newSize=a>b?a:b; -}var newData=Clazz_newArray(newSize,'\0'); -System.arraycopy(this.value,0,newData,0,index); -System.arraycopy(this.value,index,newData,index+size,this.count-index); -this.value=newData; -this.shared=false; -},$fz.isPrivate=true,$fz),"~N,~N"); -Clazz_defineMethod(c$,"replace0", -function(start,end,string){ -if(start>=0){ -if(end>this.count)end=this.count; -if(end>start){ -var stringLength=string.length; -var diff=end-start-stringLength; -if(diff>0){ -if(!this.shared){ -System.arraycopy(this.value,end,this.value,start+stringLength,this.count-end); -}else{ -var newData=Clazz_newArray(this.value.length,'\0'); -System.arraycopy(this.value,0,newData,0,start); -System.arraycopy(this.value,end,newData,start+stringLength,this.count-end); -this.value=newData; -this.shared=false; -}}else if(diff<0){ -this.move(-diff,end); -}else if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}string.getChars(0,stringLength,this.value,start); -this.count-=diff; -return; -}if(start==end){ -if(string==null)throw new NullPointerException(); -this.insert0(start,string); -return; -}}throw new StringIndexOutOfBoundsException(); -},"~N,~N,~S"); -Clazz_defineMethod(c$,"reverse0", -function(){ -if(this.count<2){ -return; -}if(!this.shared){ -for(var i=0,end=this.count,mid=Math.floor(this.count/2);iindex||index>=this.count){ -throw new StringIndexOutOfBoundsException(index); -}if(this.shared){ -this.value=this.value.clone(); -this.shared=false; -}this.value[index]=ch; -},"~N,~N"); -Clazz_defineMethod(c$,"setLength", -function(length){ -if(length<0)throw new StringIndexOutOfBoundsException(length); -if(this.countthis.value.length){ -this.enlargeBuffer(length); -}else{ -if(this.shared){ -var newData=Clazz_newArray(this.value.length,'\0'); -System.arraycopy(this.value,0,newData,0,this.count); -this.value=newData; -this.shared=false; -}else{ -for(var i=this.count;i=256&&this.count<=(this.value.length>>1))return String.instantialize(this.value,0,this.count); -this.shared=true; -return String.instantialize(0,this.count,this.value); -}); -Clazz_defineMethod(c$,"subSequence", -function(start,end){ -return this.substring(start,end); -},"~N,~N"); -Clazz_defineMethod(c$,"indexOf", -function(string){ -return this.indexOf(string,0); -},"~S"); -Clazz_defineMethod(c$,"indexOf", -function(subString,start){ -if(start<0)start=0; -var subCount=subString.length; -if(subCount>0){ -if(subCount+start>this.count)return-1; -var firstChar=subString.charAt(0); -while(true){ -var i=start; -var found=false; -for(;ithis.count)return-1; -var o1=i; -var o2=0; -while(++o2=0){ -if(subCount>0){ -if(start>this.count-subCount)start=this.count-subCount; -var firstChar=subString.charAt(0); -while(true){ -var i=start; -var found=false; -for(;i>=0;--i)if((this.value[i]).charCodeAt(0)==(firstChar).charCodeAt(0)){ -found=true; -break; -} -if(!found)return-1; -var o1=i; -var o2=0; -while(++o2 " + to); -if (original.slice) - return original.slice(from, to); - // MSIE and Chrome do not have Int32Array.slice() -var c = Clazz_newIntArray(newLength, 0); -for (var i = 0; i < newLength; i++) - c[i] = original[from++]; -return c; -}, "~A,~N,~N"); - -c$.sort=Clazz_overrideMethod(c$,"sort", -function(a,c,d,e){ - switch (arguments.length) { - case 1: - var aux=a.sort(function(o1,o2){ - if(typeof o1=="string"||o1 instanceof Comparable){ - return o1.compareTo(o2); - } - return o1-o2; - }); - for(var i=0;itoIndex)throw new IllegalArgumentException("fromIndex("+fromIndex+") > toIndex("+toIndex+")"); -if(fromIndex<0)throw new ArrayIndexOutOfBoundsException(fromIndex); -if(toIndex>arrayLen)throw new ArrayIndexOutOfBoundsException(toIndex); -},$fz.isPrivate=true,$fz),"~N,~N,~N"); -c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", -function(a,key){ -var low=0; -var high=a.length-1; -while(low<=high){ -var mid=(low+high)>>1; -var midVal=a[mid]; -if(midValkey)high=mid-1; -else return mid; -} -return-(low+1); -},"~A,~N"); -c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", -function(a,key){ -var low=0; -var high=a.length-1; -while(low<=high){ -var mid=(low+high)>>1; -var midVal=a[mid]; -var cmp=(midVal).compareTo(key); -if(cmp<0)low=mid+1; -else if(cmp>0)high=mid-1; -else return mid; -} -return-(low+1); -},"~A,~O"); -c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", -function(a,key,c){ -if(c==null)return java.util.Arrays.binarySearch(a,key); -var low=0; -var high=a.length-1; -while(low<=high){ -var mid=(low+high)>>1; -var midVal=a[mid]; -var cmp=c.compare(midVal,key); -if(cmp<0)low=mid+1; -else if(cmp>0)high=mid-1; -else return mid; -} -return-(low+1); -},"~A,~O,java.util.Comparator"); -c$.equals=Clazz_defineMethod(c$,"equals", -function(a,a2){ -if(a===a2)return true; -if(a==null||a2==null)return false; -var length=a.length; -if(a2.length!=length)return false; -for(var i=0;i 13) { -throw new IllegalArgumentException ("illegal cursor type"); -}var c = java.awt.Cursor.predefinedPrivate[type]; -if (c == null) { -java.awt.Cursor.predefinedPrivate[type] = c = new java.awt.Cursor (type); -}if (java.awt.Cursor.predefined[type] == null) { -java.awt.Cursor.predefined[type] = c; -}return c; -}, "~N"); -c$.getSystemCustomCursor = Clazz_defineMethod (c$, "getSystemCustomCursor", -function (name) { -return null; -}, "~S"); -c$.getDefaultCursor = Clazz_defineMethod (c$, "getDefaultCursor", -function () { -return java.awt.Cursor.getPredefinedCursor (0); -}); -Clazz_makeConstructor (c$, -function (type) { -if (type < 0 || type > 13) { -throw new IllegalArgumentException ("illegal cursor type"); -}this.type = type; -this.name = "TODO_CURSOR"; -}, "~N"); -Clazz_makeConstructor (c$, -function (name) { -this.type = -1; -this.name = name; -}, "~S"); -Clazz_defineMethod (c$, "getType", -function () { -return this.type; -}); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[" + this.getName () + "]"; -}); -Clazz_defineStatics (c$, -"DEFAULT_CURSOR", 0, -"CROSSHAIR_CURSOR", 1, -"TEXT_CURSOR", 2, -"WAIT_CURSOR", 3, -"SW_RESIZE_CURSOR", 4, -"SE_RESIZE_CURSOR", 5, -"NW_RESIZE_CURSOR", 6, -"NE_RESIZE_CURSOR", 7, -"N_RESIZE_CURSOR", 8, -"S_RESIZE_CURSOR", 9, -"W_RESIZE_CURSOR", 10, -"E_RESIZE_CURSOR", 11, -"HAND_CURSOR", 12, -"MOVE_CURSOR", 13); -c$.predefined = c$.prototype.predefined = new Array (14); -c$.predefinedPrivate = c$.prototype.predefinedPrivate = new Array (14); -Clazz_defineStatics (c$, -"cursorProperties", Clazz_newArray (-1, [ Clazz_newArray (-1, ["AWT.DefaultCursor", "Default Cursor"]), Clazz_newArray (-1, ["AWT.CrosshairCursor", "Crosshair Cursor"]), Clazz_newArray (-1, ["AWT.TextCursor", "Text Cursor"]), Clazz_newArray (-1, ["AWT.WaitCursor", "Wait Cursor"]), Clazz_newArray (-1, ["AWT.SWResizeCursor", "Southwest Resize Cursor"]), Clazz_newArray (-1, ["AWT.SEResizeCursor", "Southeast Resize Cursor"]), Clazz_newArray (-1, ["AWT.NWResizeCursor", "Northwest Resize Cursor"]), Clazz_newArray (-1, ["AWT.NEResizeCursor", "Northeast Resize Cursor"]), Clazz_newArray (-1, ["AWT.NResizeCursor", "North Resize Cursor"]), Clazz_newArray (-1, ["AWT.SResizeCursor", "South Resize Cursor"]), Clazz_newArray (-1, ["AWT.WResizeCursor", "West Resize Cursor"]), Clazz_newArray (-1, ["AWT.EResizeCursor", "East Resize Cursor"]), Clazz_newArray (-1, ["AWT.HandCursor", "Hand Cursor"]), Clazz_newArray (-1, ["AWT.MoveCursor", "Move Cursor"])]), -"CUSTOM_CURSOR", -1); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.lang.Error"], "java.awt.AWTError", null, function () { -c$ = Clazz_declareType (java.awt, "AWTError", Error); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (null, "java.awt.Insets", ["java.lang.InternalError"], function () { -c$ = Clazz_decorateAsClass (function () { -this.top = 0; -this.left = 0; -this.bottom = 0; -this.right = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "Insets", null, [Cloneable, java.io.Serializable]); -Clazz_makeConstructor (c$, -function (top, left, bottom, right) { -this.top = top; -this.left = left; -this.bottom = bottom; -this.right = right; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "set", -function (top, left, bottom, right) { -this.top = top; -this.left = left; -this.bottom = bottom; -this.right = right; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (Clazz_instanceOf (obj, java.awt.Insets)) { -var insets = obj; -return ((this.top == insets.top) && (this.left == insets.left) && (this.bottom == insets.bottom) && (this.right == insets.right)); -}return false; -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -var sum1 = this.left + this.bottom; -var sum2 = this.right + this.top; -var val1 = Clazz_doubleToInt (sum1 * (sum1 + 1) / 2) + this.left; -var val2 = Clazz_doubleToInt (sum2 * (sum2 + 1) / 2) + this.top; -var sum3 = val1 + val2; -return Clazz_doubleToInt (sum3 * (sum3 + 1) / 2) + val2; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[top=" + this.top + ",left=" + this.left + ",bottom=" + this.bottom + ",right=" + this.right + "]"; -}); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.Insets, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.util.Map", "$.HashMap"], "java.awt.RenderingHints", ["java.lang.IllegalArgumentException", "$.InternalError", "java.util.Collections"], function () { -c$ = Clazz_decorateAsClass (function () { -this.hintmap = null; -Clazz_instantialize (this, arguments); -}, java.awt, "RenderingHints", null, [java.util.Map, Cloneable]); -Clazz_prepareFields (c$, function () { -this.hintmap = new java.util.HashMap (7); -}); -Clazz_overrideMethod (c$, "size", -function () { -return this.hintmap.size (); -}); -Clazz_overrideMethod (c$, "isEmpty", -function () { -return this.hintmap.isEmpty (); -}); -Clazz_overrideMethod (c$, "containsKey", -function (key) { -return this.hintmap.containsKey (key); -}, "~O"); -Clazz_overrideMethod (c$, "containsValue", -function (value) { -return this.hintmap.containsValue (value); -}, "~O"); -Clazz_overrideMethod (c$, "get", -function (key) { -return this.hintmap.get (key); -}, "~O"); -Clazz_overrideMethod (c$, "put", -function (key, value) { -if (!(key).isCompatibleValue (value)) { -throw new IllegalArgumentException (value + " incompatible with " + key); -}return this.hintmap.put (key, value); -}, "~O,~O"); -Clazz_defineMethod (c$, "add", -function (hints) { -this.hintmap.putAll (hints.hintmap); -}, "java.awt.RenderingHints"); -Clazz_overrideMethod (c$, "clear", -function () { -this.hintmap.clear (); -}); -Clazz_overrideMethod (c$, "remove", -function (key) { -return this.hintmap.remove (key); -}, "~O"); -Clazz_overrideMethod (c$, "putAll", -function (m) { -if (java.awt.RenderingHints.isInstance (m)) { -for (var entry, $entry = m.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) this.hintmap.put (entry.getKey (), entry.getValue ()); - -} else { -for (var entry, $entry = m.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) this.put (entry.getKey (), entry.getValue ()); - -}}, "java.util.Map"); -Clazz_overrideMethod (c$, "keySet", -function () { -return this.hintmap.keySet (); -}); -Clazz_overrideMethod (c$, "values", -function () { -return this.hintmap.values (); -}); -Clazz_overrideMethod (c$, "entrySet", -function () { -return java.util.Collections.unmodifiableMap (this.hintmap).entrySet (); -}); -Clazz_overrideMethod (c$, "equals", -function (o) { -if (Clazz_instanceOf (o, java.awt.RenderingHints)) { -return this.hintmap.equals ((o).hintmap); -} else if (Clazz_instanceOf (o, java.util.Map)) { -return this.hintmap.equals (o); -}return false; -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -return this.hintmap.hashCode (); -}); -Clazz_overrideMethod (c$, "clone", -function () { -var rh; -try { -{ -rh = Clazz_clone(this); -if (this.hintmap != null) { rh.hintmap = -this.hintmap.cloneHM(); } -}} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -return rh; -}); -Clazz_overrideMethod (c$, "toString", -function () { -if (this.hintmap == null) { -return this.getClass ().getName () + "@" + Integer.toHexString (this.hashCode ()) + " (0 hints)"; -}return this.hintmap.toString (); -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.privatekey = 0; -Clazz_instantialize (this, arguments); -}, java.awt.RenderingHints, "Key"); -Clazz_defineMethod (c$, "getIdentity", - function () { -return this.getClass ().getName () + "@" + Integer.toHexString (System.identityHashCode (this.getClass ())) + ":" + Integer.toHexString (this.privatekey); -}); -Clazz_defineMethod (c$, "recordIdentity", - function (a) { -var b = a.getIdentity (); -var c = java.awt.RenderingHints.Key.identitymap.get (b); -if (c != null) { -var d = c; -if (d != null && d.getClass () === a.getClass ()) { -throw new IllegalArgumentException (b + " already registered"); -}}java.awt.RenderingHints.Key.identitymap.put (b, a); -}, "java.awt.RenderingHints.Key"); -Clazz_makeConstructor (c$, -function (a) { -this.privatekey = a; -this.recordIdentity (this); -}, "~N"); -Clazz_defineMethod (c$, "intKey", -function () { -return this.privatekey; -}); -Clazz_overrideMethod (c$, "equals", -function (a) { -return this === a; -}, "~O"); -c$.identitymap = c$.prototype.identitymap = new java.util.HashMap (17); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.description = null; -Clazz_instantialize (this, arguments); -}, java.awt.RenderingHints, "SunKey", java.awt.RenderingHints.Key); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.RenderingHints.SunKey, [a]); -this.description = b; -}, "~N,~S"); -Clazz_defineMethod (c$, "getIndex", -function () { -return this.privatekey; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.description; -}); -Clazz_overrideMethod (c$, "isCompatibleValue", -function (a) { -if (Clazz_instanceOf (a, java.awt.RenderingHints.Value)) { -return (a).isCompatibleKey (this); -}return false; -}, "~O"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.myKey = null; -this.index = 0; -this.description = null; -Clazz_instantialize (this, arguments); -}, java.awt.RenderingHints, "Value"); -c$.register = Clazz_defineMethod (c$, "register", - function (a, b) { -var c = a.getIndex (); -var d = b.getIndex (); -if (java.awt.RenderingHints.Value.ValueObjects[c][d] != null) { -throw new InternalError ("duplicate index: " + d); -}java.awt.RenderingHints.Value.ValueObjects[c][d] = b; -}, "java.awt.RenderingHints.SunKey,java.awt.RenderingHints.Value"); -c$.get = Clazz_defineMethod (c$, "get", -function (a, b) { -return java.awt.RenderingHints.Value.ValueObjects[a][b]; -}, "~N,~N"); -Clazz_makeConstructor (c$, -function (a, b, c) { -this.myKey = a; -this.index = b; -this.description = c; -java.awt.RenderingHints.Value.register (a, this); -}, "java.awt.RenderingHints.SunKey,~N,~S"); -Clazz_defineMethod (c$, "getIndex", -function () { -return this.index; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.description; -}); -Clazz_defineMethod (c$, "isCompatibleKey", -function (a) { -return this.myKey === a; -}, "java.awt.RenderingHints.SunKey"); -Clazz_overrideMethod (c$, "hashCode", -function () { -return this.description.hashCode (); -}); -Clazz_overrideMethod (c$, "equals", -function (a) { -return this === a; -}, "~O"); -c$.ValueObjects = c$.prototype.ValueObjects = Clazz_newArray (9, 8, null); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.RenderingHints, "LCDContrastKey", java.awt.RenderingHints.SunKey); -Clazz_overrideMethod (c$, "isCompatibleValue", -function (a) { -if (Clazz_instanceOf (a, Integer)) { -var b = (a).intValue (); -return b >= 100 && b <= 250; -}return false; -}, "~O"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"NUM_KEYS", 9, -"VALS_PER_KEY", 8, -"INTKEY_RENDERING", 0, -"INTVAL_RENDER_DEFAULT", 0, -"INTVAL_RENDER_SPEED", 1, -"INTVAL_RENDER_QUALITY", 2, -"INTKEY_ANTIALIASING", 1, -"INTVAL_ANTIALIAS_DEFAULT", 0, -"INTVAL_ANTIALIAS_OFF", 1, -"INTVAL_ANTIALIAS_ON", 2, -"INTKEY_TEXT_ANTIALIASING", 2, -"INTVAL_TEXT_ANTIALIAS_DEFAULT", 0, -"INTVAL_TEXT_ANTIALIAS_OFF", 1, -"INTVAL_TEXT_ANTIALIAS_ON", 2, -"INTVAL_TEXT_ANTIALIAS_GASP", 3, -"INTVAL_TEXT_ANTIALIAS_LCD_HRGB", 4, -"INTVAL_TEXT_ANTIALIAS_LCD_HBGR", 5, -"INTVAL_TEXT_ANTIALIAS_LCD_VRGB", 6, -"INTVAL_TEXT_ANTIALIAS_LCD_VBGR", 7, -"INTKEY_FRACTIONALMETRICS", 3, -"INTVAL_FRACTIONALMETRICS_DEFAULT", 0, -"INTVAL_FRACTIONALMETRICS_OFF", 1, -"INTVAL_FRACTIONALMETRICS_ON", 2, -"INTKEY_DITHERING", 4, -"INTVAL_DITHER_DEFAULT", 0, -"INTVAL_DITHER_DISABLE", 1, -"INTVAL_DITHER_ENABLE", 2, -"INTKEY_INTERPOLATION", 5, -"INTVAL_INTERPOLATION_NEAREST_NEIGHBOR", 0, -"INTVAL_INTERPOLATION_BILINEAR", 1, -"INTVAL_INTERPOLATION_BICUBIC", 2, -"INTKEY_ALPHA_INTERPOLATION", 6, -"INTVAL_ALPHA_INTERPOLATION_DEFAULT", 0, -"INTVAL_ALPHA_INTERPOLATION_SPEED", 1, -"INTVAL_ALPHA_INTERPOLATION_QUALITY", 2, -"INTKEY_COLOR_RENDERING", 7, -"INTVAL_COLOR_RENDER_DEFAULT", 0, -"INTVAL_COLOR_RENDER_SPEED", 1, -"INTVAL_COLOR_RENDER_QUALITY", 2, -"INTKEY_STROKE_CONTROL", 8, -"INTVAL_STROKE_DEFAULT", 0, -"INTVAL_STROKE_NORMALIZE", 1, -"INTVAL_STROKE_PURE", 2, -"INTKEY_AATEXT_LCD_CONTRAST", 100); -c$.KEY_RENDERING = c$.prototype.KEY_RENDERING = new java.awt.RenderingHints.SunKey (0, "Global rendering quality key"); -c$.VALUE_RENDER_SPEED = c$.prototype.VALUE_RENDER_SPEED = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_RENDERING, 1, "Fastest rendering methods"); -c$.VALUE_RENDER_QUALITY = c$.prototype.VALUE_RENDER_QUALITY = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_RENDERING, 2, "Highest quality rendering methods"); -c$.VALUE_RENDER_DEFAULT = c$.prototype.VALUE_RENDER_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_RENDERING, 0, "Default rendering methods"); -c$.KEY_ANTIALIASING = c$.prototype.KEY_ANTIALIASING = new java.awt.RenderingHints.SunKey (1, "Global antialiasing enable key"); -c$.VALUE_ANTIALIAS_ON = c$.prototype.VALUE_ANTIALIAS_ON = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ANTIALIASING, 2, "Antialiased rendering mode"); -c$.VALUE_ANTIALIAS_OFF = c$.prototype.VALUE_ANTIALIAS_OFF = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ANTIALIASING, 1, "Nonantialiased rendering mode"); -c$.VALUE_ANTIALIAS_DEFAULT = c$.prototype.VALUE_ANTIALIAS_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ANTIALIASING, 0, "Default antialiasing rendering mode"); -c$.KEY_FRACTIONALMETRICS = c$.prototype.KEY_FRACTIONALMETRICS = new java.awt.RenderingHints.SunKey (3, "Fractional metrics enable key"); -c$.VALUE_FRACTIONALMETRICS_ON = c$.prototype.VALUE_FRACTIONALMETRICS_ON = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_FRACTIONALMETRICS, 2, "Fractional text metrics mode"); -c$.VALUE_FRACTIONALMETRICS_OFF = c$.prototype.VALUE_FRACTIONALMETRICS_OFF = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_FRACTIONALMETRICS, 1, "Integer text metrics mode"); -c$.VALUE_FRACTIONALMETRICS_DEFAULT = c$.prototype.VALUE_FRACTIONALMETRICS_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_FRACTIONALMETRICS, 0, "Default fractional text metrics mode"); -c$.KEY_DITHERING = c$.prototype.KEY_DITHERING = new java.awt.RenderingHints.SunKey (4, "Dithering quality key"); -c$.VALUE_DITHER_ENABLE = c$.prototype.VALUE_DITHER_ENABLE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_DITHERING, 2, "Dithered rendering mode"); -c$.VALUE_DITHER_DISABLE = c$.prototype.VALUE_DITHER_DISABLE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_DITHERING, 1, "Nondithered rendering mode"); -c$.VALUE_DITHER_DEFAULT = c$.prototype.VALUE_DITHER_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_DITHERING, 0, "Default dithering mode"); -c$.KEY_INTERPOLATION = c$.prototype.KEY_INTERPOLATION = new java.awt.RenderingHints.SunKey (5, "Image interpolation method key"); -c$.VALUE_INTERPOLATION_NEAREST_NEIGHBOR = c$.prototype.VALUE_INTERPOLATION_NEAREST_NEIGHBOR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_INTERPOLATION, 0, "Nearest Neighbor image interpolation mode"); -c$.VALUE_INTERPOLATION_BILINEAR = c$.prototype.VALUE_INTERPOLATION_BILINEAR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_INTERPOLATION, 1, "Bilinear image interpolation mode"); -c$.VALUE_INTERPOLATION_BICUBIC = c$.prototype.VALUE_INTERPOLATION_BICUBIC = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_INTERPOLATION, 2, "Bicubic image interpolation mode"); -c$.KEY_ALPHA_INTERPOLATION = c$.prototype.KEY_ALPHA_INTERPOLATION = new java.awt.RenderingHints.SunKey (6, "Alpha blending interpolation method key"); -c$.VALUE_ALPHA_INTERPOLATION_SPEED = c$.prototype.VALUE_ALPHA_INTERPOLATION_SPEED = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, 1, "Fastest alpha blending methods"); -c$.VALUE_ALPHA_INTERPOLATION_QUALITY = c$.prototype.VALUE_ALPHA_INTERPOLATION_QUALITY = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, 2, "Highest quality alpha blending methods"); -c$.VALUE_ALPHA_INTERPOLATION_DEFAULT = c$.prototype.VALUE_ALPHA_INTERPOLATION_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, 0, "Default alpha blending methods"); -c$.KEY_COLOR_RENDERING = c$.prototype.KEY_COLOR_RENDERING = new java.awt.RenderingHints.SunKey (7, "Color rendering quality key"); -c$.VALUE_COLOR_RENDER_SPEED = c$.prototype.VALUE_COLOR_RENDER_SPEED = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_COLOR_RENDERING, 1, "Fastest color rendering mode"); -c$.VALUE_COLOR_RENDER_QUALITY = c$.prototype.VALUE_COLOR_RENDER_QUALITY = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_COLOR_RENDERING, 2, "Highest quality color rendering mode"); -c$.VALUE_COLOR_RENDER_DEFAULT = c$.prototype.VALUE_COLOR_RENDER_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_COLOR_RENDERING, 0, "Default color rendering mode"); -c$.KEY_STROKE_CONTROL = c$.prototype.KEY_STROKE_CONTROL = new java.awt.RenderingHints.SunKey (8, "Stroke normalization control key"); -c$.VALUE_STROKE_DEFAULT = c$.prototype.VALUE_STROKE_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_STROKE_CONTROL, 0, "Default stroke normalization"); -c$.VALUE_STROKE_NORMALIZE = c$.prototype.VALUE_STROKE_NORMALIZE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_STROKE_CONTROL, 1, "Normalize strokes for consistent rendering"); -c$.VALUE_STROKE_PURE = c$.prototype.VALUE_STROKE_PURE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_STROKE_CONTROL, 2, "Pure stroke conversion for accurate paths"); -c$.KEY_TEXT_ANTIALIASING = c$.prototype.KEY_TEXT_ANTIALIASING = new java.awt.RenderingHints.SunKey (2, "Text-specific antialiasing enable key"); -c$.VALUE_TEXT_ANTIALIAS_ON = c$.prototype.VALUE_TEXT_ANTIALIAS_ON = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 2, "Antialiased text mode"); -c$.VALUE_TEXT_ANTIALIAS_OFF = c$.prototype.VALUE_TEXT_ANTIALIAS_OFF = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 1, "Nonantialiased text mode"); -c$.VALUE_TEXT_ANTIALIAS_DEFAULT = c$.prototype.VALUE_TEXT_ANTIALIAS_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 0, "Default antialiasing text mode"); -c$.VALUE_TEXT_ANTIALIAS_GASP = c$.prototype.VALUE_TEXT_ANTIALIAS_GASP = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 3, "gasp antialiasing text mode"); -c$.VALUE_TEXT_ANTIALIAS_LCD_HRGB = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_HRGB = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 4, "LCD HRGB antialiasing text mode"); -c$.VALUE_TEXT_ANTIALIAS_LCD_HBGR = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_HBGR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 5, "LCD HBGR antialiasing text mode"); -c$.VALUE_TEXT_ANTIALIAS_LCD_VRGB = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_VRGB = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 6, "LCD VRGB antialiasing text mode"); -c$.VALUE_TEXT_ANTIALIAS_LCD_VBGR = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_VBGR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 7, "LCD VBGR antialiasing text mode"); -c$.KEY_TEXT_ANTIALIAS_LCD_CONTRAST = c$.prototype.KEY_TEXT_ANTIALIAS_LCD_CONTRAST = new java.awt.RenderingHints.LCDContrastKey (100, "Text-specific LCD contrast key"); -c$.KEY_TEXT_LCD_CONTRAST = c$.prototype.KEY_TEXT_LCD_CONTRAST = java.awt.RenderingHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST; -}); -//BH note: a declared static superclass must come before a static class referencing it - -Clazz_load(["java.util.AbstractList","$.AbstractMap","$.AbstractSet","$.Collection","$.Iterator","$.List","$.ListIterator","$.Map","$.RandomAccess","$.Set","$.SortedMap","$.SortedSet","java.lang.NullPointerException","$.UnsupportedOperationException","java.lang.reflect.Array"],"java.util.Collections",["java.lang.ArrayIndexOutOfBoundsException","$.ClassCastException","$.IllegalArgumentException","$.IndexOutOfBoundsException","java.util.ArrayList","$.Arrays","$.Enumeration","java.util.Map.Entry","java.util.NoSuchElementException","$.Random"],function(){ -c$=Clazz_declareType(java.util,"Collections"); -c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", -function(list,object){ -if(list==null){ -throw new NullPointerException(); -}if(list.isEmpty()){ -return-1; -}var key=object; -if(!(Clazz_instanceOf(list,java.util.RandomAccess))){ -var it=list.listIterator(); -while(it.hasNext()){ -var result; -if((result=key.compareTo(it.next()))<=0){ -if(result==0){ -return it.previousIndex(); -}return-it.previousIndex()-1; -}} -return-list.size()-1; -}var low=0; -var mid=list.size(); -var high=mid-1; -var result=-1; -while(low<=high){ -mid=(low+high)>>1; -if((result=key.compareTo(list.get(mid)))>0){ -low=mid+1; -}else if(result==0){ -return mid; -}else{ -high=mid-1; -}} -return-mid-(result<0?1:2); -},"java.util.List,~O"); -c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", -function(list,object,comparator){ -if(comparator==null){ -return java.util.Collections.binarySearch(list,object); -}if(!(Clazz_instanceOf(list,java.util.RandomAccess))){ -var it=list.listIterator(); -while(it.hasNext()){ -var result; -if((result=comparator.compare(object,it.next()))<=0){ -if(result==0){ -return it.previousIndex(); -}return-it.previousIndex()-1; -}} -return-list.size()-1; -}var low=0; -var mid=list.size(); -var high=mid-1; -var result=-1; -while(low<=high){ -mid=(low+high)>>1; -if((result=comparator.compare(object,list.get(mid)))>0){ -low=mid+1; -}else if(result==0){ -return mid; -}else{ -high=mid-1; -}} -return-mid-(result<0?1:2); -},"java.util.List,~O,java.util.Comparator"); -c$.copy=Clazz_defineMethod(c$,"copy", -function(destination,source){ -if(destination.size()0){ -min=next; -}} -return min; -},"java.util.Collection"); -c$.min=Clazz_defineMethod(c$,"min", -function(collection,comparator){ -var it=collection.iterator(); -var min=it.next(); -while(it.hasNext()){ -var next=it.next(); -if(comparator.compare(min,next)>0){ -min=next; -}} -return min; -},"java.util.Collection,java.util.Comparator"); -c$.nCopies=Clazz_defineMethod(c$,"nCopies", -function(length,object){ -return new java.util.Collections.CopiesList(length,object); -},"~N,~O"); -c$.reverse=Clazz_defineMethod(c$,"reverse", -function(list){ -var size=list.size(); -var front=list.listIterator(); -var back=list.listIterator(size); -for(var i=0;i0;i--){ -var index=random.nextInt()%(i+1); -if(index<0){ -index=-index; -}var temp=array[i]; -array[i]=array[index]; -array[index]=temp; -} -var i=0; -var it=list.listIterator(); -while(it.hasNext()){ -it.next(); -it.set(array[i++]); -} -}else{ -var rawList=list; -for(var i=rawList.size()-1;i>0;i--){ -var index=random.nextInt()%(i+1); -if(index<0){ -index=-index; -}rawList.set(index,rawList.set(i,rawList.get(index))); -} -}},"java.util.List,java.util.Random"); -c$.singleton=Clazz_defineMethod(c$,"singleton", -function(object){ -return new java.util.Collections.SingletonSet(object); -},"~O"); -c$.singletonList=Clazz_defineMethod(c$,"singletonList", -function(object){ -return new java.util.Collections.SingletonList(object); -},"~O"); -c$.singletonMap=Clazz_defineMethod(c$,"singletonMap", -function(key,value){ -return new java.util.Collections.SingletonMap(key,value); -},"~O,~O"); -c$.sort=Clazz_defineMethod(c$,"sort", -function(list){ -var array=list.toArray(); -java.util.Arrays.sort(array); -var i=0; -var it=list.listIterator(); -while(it.hasNext()){ -it.next(); -it.set(array[i++]); -} -},"java.util.List"); -c$.sort=Clazz_defineMethod(c$,"sort", -function(list,comparator){ -var array=list.toArray(new Array(list.size())); -java.util.Arrays.sort(array,comparator); -var i=0; -var it=list.listIterator(); -while(it.hasNext()){ -it.next(); -it.set(array[i++]); -} -},"java.util.List,java.util.Comparator"); -c$.swap=Clazz_defineMethod(c$,"swap", -function(list,index1,index2){ -if(list==null){ -throw new NullPointerException(); -}if(index1==index2){ -return; -}var rawList=list; -rawList.set(index2,rawList.set(index1,rawList.get(index2))); -},"java.util.List,~N,~N"); -c$.replaceAll=Clazz_defineMethod(c$,"replaceAll", -function(list,obj,obj2){ -var index; -var found=false; -while((index=list.indexOf(obj))>-1){ -found=true; -list.set(index,obj2); -} -return found; -},"java.util.List,~O,~O"); -c$.rotate=Clazz_defineMethod(c$,"rotate", -function(lst,dist){ -var list=lst; -var size=list.size(); -if(size==0){ -return; -}var normdist; -if(dist>0){ -normdist=dist%size; -}else{ -normdist=size-((dist%size)*(-1)); -}if(normdist==0||normdist==size){ -return; -}if(Clazz_instanceOf(list,java.util.RandomAccess)){ -var temp=list.get(0); -var index=0; -var beginIndex=0; -for(var i=0;isize){ -return-1; -}if(sublistSize==0){ -return 0; -}var firstObj=sublist.get(0); -var index=list.indexOf(firstObj); -if(index==-1){ -return-1; -}while(index=sublistSize)){ -var listIt=list.listIterator(index); -if((firstObj==null)?listIt.next()==null:firstObj.equals(listIt.next())){ -var sublistIt=sublist.listIterator(1); -var difFound=false; -while(sublistIt.hasNext()){ -var element=sublistIt.next(); -if(!listIt.hasNext()){ -return-1; -}if((element==null)?listIt.next()!=null:!element.equals(listIt.next())){ -difFound=true; -break; -}} -if(!difFound){ -return index; -}}index++; -} -return-1; -},"java.util.List,java.util.List"); -c$.lastIndexOfSubList=Clazz_defineMethod(c$,"lastIndexOfSubList", -function(list,sublist){ -var sublistSize=sublist.size(); -var size=list.size(); -if(sublistSize>size){ -return-1; -}if(sublistSize==0){ -return size; -}var lastObj=sublist.get(sublistSize-1); -var index=list.lastIndexOf(lastObj); -while((index>-1)&&(index+1>=sublistSize)){ -var listIt=list.listIterator(index+1); -if((lastObj==null)?listIt.previous()==null:lastObj.equals(listIt.previous())){ -var sublistIt=sublist.listIterator(sublistSize-1); -var difFound=false; -while(sublistIt.hasPrevious()){ -var element=sublistIt.previous(); -if(!listIt.hasPrevious()){ -return-1; -}if((element==null)?listIt.previous()!=null:!element.equals(listIt.previous())){ -difFound=true; -break; -}} -if(!difFound){ -return listIt.nextIndex(); -}}index--; -} -return-1; -},"java.util.List,java.util.List"); -c$.list=Clazz_defineMethod(c$,"list", -function(enumeration){ -var list=new java.util.ArrayList(); -while(enumeration.hasMoreElements()){ -list.add(enumeration.nextElement()); -} -return list; -},"java.util.Enumeration"); -c$.synchronizedCollection=Clazz_defineMethod(c$,"synchronizedCollection", -function(collection){ -if(collection==null){ -throw new NullPointerException(); -}return new java.util.Collections.SynchronizedCollection(collection); -},"java.util.Collection"); -c$.synchronizedList=Clazz_defineMethod(c$,"synchronizedList", -function(list){ -if(list==null){ -throw new NullPointerException(); -}if(Clazz_instanceOf(list,java.util.RandomAccess)){ -return new java.util.Collections.SynchronizedRandomAccessList(list); -}return new java.util.Collections.SynchronizedList(list); -},"java.util.List"); -c$.synchronizedMap=Clazz_defineMethod(c$,"synchronizedMap", -function(map){ -if(map==null){ -throw new NullPointerException(); -}return new java.util.Collections.SynchronizedMap(map); -},"java.util.Map"); -c$.synchronizedSet=Clazz_defineMethod(c$,"synchronizedSet", -function(set){ -if(set==null){ -throw new NullPointerException(); -}return new java.util.Collections.SynchronizedSet(set); -},"java.util.Set"); -c$.synchronizedSortedMap=Clazz_defineMethod(c$,"synchronizedSortedMap", -function(map){ -if(map==null){ -throw new NullPointerException(); -}return new java.util.Collections.SynchronizedSortedMap(map); -},"java.util.SortedMap"); -c$.synchronizedSortedSet=Clazz_defineMethod(c$,"synchronizedSortedSet", -function(set){ -if(set==null){ -throw new NullPointerException(); -}return new java.util.Collections.SynchronizedSortedSet(set); -},"java.util.SortedSet"); -c$.unmodifiableCollection=Clazz_defineMethod(c$,"unmodifiableCollection", -function(collection){ -if(collection==null){ -throw new NullPointerException(); -}return new java.util.Collections.UnmodifiableCollection(collection); -},"java.util.Collection"); -c$.unmodifiableList=Clazz_defineMethod(c$,"unmodifiableList", -function(list){ -if(list==null){ -throw new NullPointerException(); -}if(Clazz_instanceOf(list,java.util.RandomAccess)){ -return new java.util.Collections.UnmodifiableRandomAccessList(list); -}return new java.util.Collections.UnmodifiableList(list); -},"java.util.List"); -c$.unmodifiableMap=Clazz_defineMethod(c$,"unmodifiableMap", -function(map){ -if(map==null){ -throw new NullPointerException(); -}return new java.util.Collections.UnmodifiableMap(map); -},"java.util.Map"); -c$.unmodifiableSet=Clazz_defineMethod(c$,"unmodifiableSet", -function(set){ -if(set==null){ -throw new NullPointerException(); -}return new java.util.Collections.UnmodifiableSet(set); -},"java.util.Set"); -c$.unmodifiableSortedMap=Clazz_defineMethod(c$,"unmodifiableSortedMap", -function(map){ -if(map==null){ -throw new NullPointerException(); -}return new java.util.Collections.UnmodifiableSortedMap(map); -},"java.util.SortedMap"); -c$.unmodifiableSortedSet=Clazz_defineMethod(c$,"unmodifiableSortedSet", -function(set){ -if(set==null){ -throw new NullPointerException(); -}return new java.util.Collections.UnmodifiableSortedSet(set); -},"java.util.SortedSet"); -c$.frequency=Clazz_defineMethod(c$,"frequency", -function(c,o){ -if(c==null){ -throw new NullPointerException(); -}if(c.isEmpty()){ -return 0; -} -var result=0; -var itr=c.iterator(); -while(itr.hasNext()){ -var e=itr.next(); -if(o==null?e==null:o.equals(e)){ -result++; -}} -return result; -},"java.util.Collection,~O"); - -c$.emptyList=Clazz_defineMethod(c$,"emptyList", -function(){ -return java.util.Collections.EMPTY_LIST; -}); -c$.emptySet=Clazz_defineMethod(c$,"emptySet", -function(){ -return java.util.Collections.EMPTY_SET; -}); -c$.emptyMap=Clazz_defineMethod(c$,"emptyMap", -function(){ -return java.util.Collections.EMPTY_MAP; -}); -c$.checkedCollection=Clazz_defineMethod(c$,"checkedCollection", -function(c,type){ -return new java.util.Collections.CheckedCollection(c,type); -},"java.util.Collection,Class"); -c$.checkedMap=Clazz_defineMethod(c$,"checkedMap", -function(m,keyType,valueType){ -return new java.util.Collections.CheckedMap(m,keyType,valueType); -},"java.util.Map,Class,Class"); -c$.checkedList=Clazz_defineMethod(c$,"checkedList", -function(list,type){ -if(Clazz_instanceOf(list,java.util.RandomAccess)){ -return new java.util.Collections.CheckedRandomAccessList(list,type); -}return new java.util.Collections.CheckedList(list,type); -},"java.util.List,Class"); -c$.checkedSet=Clazz_defineMethod(c$,"checkedSet", -function(s,type){ -return new java.util.Collections.CheckedSet(s,type); -},"java.util.Set,Class"); -c$.checkedSortedMap=Clazz_defineMethod(c$,"checkedSortedMap", -function(m,keyType,valueType){ -return new java.util.Collections.CheckedSortedMap(m,keyType,valueType); -},"java.util.SortedMap,Class,Class"); -c$.checkedSortedSet=Clazz_defineMethod(c$,"checkedSortedSet", -function(s,type){ -return new java.util.Collections.CheckedSortedSet(s,type); -},"java.util.SortedSet,Class"); -c$.addAll=Clazz_defineMethod(c$,"addAll", -function(c,a){ -var modified=false; -for(var i=0;ic1.size()){ -var tmp=c1; -c1=c2; -c2=tmp; -}var it=c1.iterator(); -while(it.hasNext()){ -if(c2.contains(it.next())){ -return false; -}} -return true; -},"java.util.Collection,java.util.Collection"); -c$.checkType=Clazz_defineMethod(c$,"checkType", -function(obj,type){ -if(!type.isInstance(obj)){ -throw new ClassCastException("Attempt to insert "+obj.getClass()+" element into collection with element type "+type); -}return obj; -},"~O,Class"); - -c$.$Collections$1$=function(c){ -Clazz_pu$h(self.c$); -c$=Clazz_decorateAsClass(function(){ -Clazz_prepareCallback(this,arguments); -this.it=null; -Clazz_instantialize(this,arguments); -},java.util,"Collections$1",null,java.util.Enumeration); - -Clazz_prepareFields(c$,function(){ -this.it=c.iterator(); -}); - -Clazz_defineMethod(c$,"hasMoreElements", -function(){ -return this.it.hasNext(); -}); -Clazz_defineMethod(c$,"nextElement", -function(){ -return this.it.next(); -}); -c$=Clazz_p0p(); -}; - -Clazz_pu$h(self.c$); -c$=Clazz_decorateAsClass(function(){ -this.n=0; -this.element=null; -Clazz_instantialize(this,arguments); -},java.util.Collections,"CopiesList",java.util.AbstractList,java.io.Serializable); -Clazz_makeConstructor(c$, -function(a,b){ -Clazz_superConstructor(this,java.util.Collections.CopiesList,[]); -if(a<0){ -throw new IllegalArgumentException(); -}this.n=a; -this.element=b; -},"~N,~O"); -Clazz_overrideMethod(c$,"contains", -function(a){ -return this.element==null?a==null:this.element.equals(a); -},"~O"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.n; -}); -Clazz_overrideMethod(c$,"get", -function(a){ -if(0<=a&&a=0;){ -b[d]=c.next(); -} -return b; -}); -Clazz_defineMethod(c$,"toArray", -function(a){ -var b=this.c.size(); -var c=0; -var d=this.iterator(); -if(b>a.length){ -var e=a.getClass().getComponentType(); -a=java.lang.reflect.Array.newInstance(e,b); -}while(c>>(48-bits)); -},"~N"); -Clazz_defineMethod(c$,"nextBoolean", -function(){ -return Math.random()>0.5; -}); -Clazz_defineMethod(c$,"nextBytes", -function(buf){ -for(var i=0;i=1); -var norm=Math.sqrt(-2*Math.log(s)/s); -this.nextNextGaussian=v2*norm; -this.haveNextNextGaussian=true; -return v1*norm; -}); -Clazz_defineMethod(c$,"nextInt", -function(){ -return Math.ceil(0xffff*Math.random())-0x8000; -}); -Clazz_defineMethod(c$,"nextInt", -function(n){ -if(n>0){ -n = Math.min(n, 31); -return Math.floor((2 << (n - 1)) * Math.random()) - -/* -if((n&-n)==n){ -return((n*this.next(31))>>31); -}var bits; -var val; -do{ -bits=this.next(31); -val=bits%n; -}while(bits-val+(n-1)<0); - - -return val; - -*/ -} -throw new IllegalArgumentException(); -},"~N"); -Clazz_defineMethod(c$,"nextLong", -function(){ -return Math.ceil(0xffffffff*Math.random())-0x80000000; -}); -Clazz_defineMethod(c$,"setSeed", -function(seed){ -Math.seedrandom(seed); -//this.seed=(seed^25214903917)&(281474976710655); -//this.haveNextNextGaussian=false; -},"~N"); -Clazz_defineStatics(c$, -"multiplier",0x5deece66d); -}); - -// seedrandom.js -// Author: David Bau 3/11/2010 -// -// Defines a method Math.seedrandom() that, when called, substitutes -// an explicitly seeded RC4-based algorithm for Math.random(). Also -// supports automatic seeding from local or network sources of entropy. -// -// Usage: -// -// -// -// Math.seedrandom('yipee'); Sets Math.random to a function that is -// initialized using the given explicit seed. -// -// Math.seedrandom(); Sets Math.random to a function that is -// seeded using the current time, dom state, -// and other accumulated local entropy. -// The generated seed string is returned. -// -// Math.seedrandom('yowza', true); -// Seeds using the given explicit seed mixed -// together with accumulated entropy. -// -// -// Seeds using physical random bits downloaded -// from random.org. -// -// Examples: -// -// Math.seedrandom("hello"); // Use "hello" as the seed. -// document.write(Math.random()); // Always 0.5463663768140734 -// document.write(Math.random()); // Always 0.43973793770592234 -// var rng1 = Math.random; // Remember the current prng. -// -// var autoseed = Math.seedrandom(); // New prng with an automatic seed. -// document.write(Math.random()); // Pretty much unpredictable. -// -// Math.random = rng1; // Continue "hello" prng sequence. -// document.write(Math.random()); // Always 0.554769432473455 -// -// Math.seedrandom(autoseed); // Restart at the previous seed. -// document.write(Math.random()); // Repeat the 'unpredictable' value. -// -// Notes: -// -// Each time seedrandom('arg') is called, entropy from the passed seed -// is accumulated in a pool to help generate future seeds for the -// zero-argument form of Math.seedrandom, so entropy can be injected over -// time by calling seedrandom with explicit data repeatedly. -// -// On speed - This javascript implementation of Math.random() is about -// 3-10x slower than the built-in Math.random() because it is not native -// code, but this is typically fast enough anyway. Seeding is more expensive, -// especially if you use auto-seeding. Some details (timings on Chrome 4): -// -// Our Math.random() - avg less than 0.002 milliseconds per call -// seedrandom('explicit') - avg less than 0.5 milliseconds per call -// seedrandom('explicit', true) - avg less than 2 milliseconds per call -// seedrandom() - avg about 38 milliseconds per call -// -// LICENSE (BSD): -// -// Copyright 2010 David Bau, all rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of this module nor the names of its contributors may -// be used to endorse or promote products derived from this software -// without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -/** - * All code is in an anonymous closure to keep the global namespace clean. - * - * @param {number=} overflow - * @param {number=} startdenom - */ -(function (pool, math, width, chunks, significance, overflow, startdenom) { - -var copyright = "Copyright 2010 David Bau, all rights reserved. (BSD)" -// -// seedrandom() -// This is the seedrandom function described above. -// -math['seedrandom'] = function seedrandom(seed, use_entropy) { - var key = []; - var arc4; - - // Flatten the seed string or build one from local entropy if needed. - seed = mixkey(flatten( - use_entropy ? [seed, pool] : - arguments.length ? seed : - [new Date().getTime(), pool, window], 3), key); - - // Use the seed to initialize an ARC4 generator. - arc4 = new ARC4(key); - - // Mix the randomness into accumulated entropy. - mixkey(arc4.S, pool); - - // Override Math.random - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - - math['random'] = function random() { // Closure to return a random double: - var n = arc4.g(chunks); // Start with a numerator n < 2 ^ 48 - var d = startdenom; // and denominator d = 2 ^ 48. - var x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - // Return the seed that was used - return seed; -}; - -// -// ARC4 -// -// An ARC4 implementation. The constructor takes a key in the form of -// an array of at most (width) integers that should be 0 <= x < (width). -// -// The g(count) method returns a pseudorandom integer that concatenates -// the next (count) outputs from ARC4. Its return value is a number x -// that is in the range 0 <= x < (width ^ count). -// -/** @constructor */ -function ARC4(key) { - var t, u, me = this, keylen = key.length; - var i = 0, j = me.i = me.j = me.m = 0; - me.S = []; - me.c = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { me.S[i] = i++; } - for (i = 0; i < width; i++) { - t = me.S[i]; - j = lowbits(j + t + key[i % keylen]); - u = me.S[j]; - me.S[i] = u; - me.S[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - me.g = function getnext(count) { - var s = me.S; - var i = lowbits(me.i + 1); var t = s[i]; - var j = lowbits(me.j + t); var u = s[j]; - s[i] = u; - s[j] = t; - var r = s[lowbits(t + u)]; - while (--count) { - i = lowbits(i + 1); t = s[i]; - j = lowbits(j + t); u = s[j]; - s[i] = u; - s[j] = t; - r = r * width + s[lowbits(t + u)]; - } - me.i = i; - me.j = j; - return r; - }; - // For robust unpredictability discard an initial batch of values. - // See http://www.rsa.com/rsalabs/node.asp?id=2009 - me.g(width); -} - -// -// flatten() -// Converts an object tree to nested arrays of strings. -// -/** @param {Object=} result - * @param {string=} prop */ -function flatten(obj, depth, result, prop) { - result = []; - if (depth && typeof(obj) == 'object') { - for (prop in obj) { - if (prop.indexOf('S') < 5) { // Avoid FF3 bug (local/sessionStorage) - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} - } - } - } - return result.length ? result : '' + obj; -} - -// -// mixkey() -// Mixes a string seed into a key that is an array of integers, and -// returns a shortened string seed that is equivalent to the result key. -// -/** @param {number=} smear - * @param {number=} j */ -function mixkey(seed, key, smear, j) { - seed += ''; // Ensure the seed is a string - smear = 0; - for (j = 0; j < seed.length; j++) { - key[lowbits(j)] = - lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j)); - } - seed = ''; - for (j in key) { seed += String.fromCharCode(key[j]); } - return seed; -} - -// -// lowbits() -// A quick "n mod width" for width a power of 2. -// -function lowbits(n) { return n & (width - 1); } - -// -// The following constants are related to IEEE 754 limits. -// -startdenom = math.pow(width, chunks); -significance = math.pow(2, significance); -overflow = significance * 2; - -// -// When seedrandom.js is loaded, we immediately mix a few bits -// from the built-in RNG into the entropy pool. Because we do -// not want to intefere with determinstic PRNG state later, -// seedrandom will not call math.random on its own again after -// initialization. -// -mixkey(math.random(), pool); - -// End anonymous scope, and pass initial values. -})( - [], // pool: entropy pool starts empty - Math, // math: package containing random, pow, and seedrandom - 256, // width: each RC4 output is 0 <= x < 256 - 6, // chunks: at least six RC4 outputs for each double - 52 // significance: there are 52 significant digits in a double -); - -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.util.EventListenerProxy", "java.awt.event.AWTEventListener"], "java.awt.event.AWTEventListenerProxy", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.eventMask = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "AWTEventListenerProxy", java.util.EventListenerProxy, java.awt.event.AWTEventListener); -Clazz_makeConstructor (c$, -function (eventMask, listener) { -Clazz_superConstructor (this, java.awt.event.AWTEventListenerProxy, [listener]); -this.eventMask = eventMask; -}, "~N,java.awt.event.AWTEventListener"); -Clazz_defineMethod (c$, "eventDispatched", -function (evt) { -(this.getListener ()).eventDispatched (evt); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "getEventMask", -function () { -return this.eventMask; -}); -}); -Clazz_declarePackage ("java.beans"); -Clazz_load (["java.beans.ChangeListenerMap"], "java.beans.PropertyChangeSupport", ["java.lang.Boolean", "$.NullPointerException", "java.beans.IndexedPropertyChangeEvent", "$.PropertyChangeEvent", "$.PropertyChangeListenerProxy"], function () { -c$ = Clazz_decorateAsClass (function () { -this.map = null; -this.source = null; -Clazz_instantialize (this, arguments); -}, java.beans, "PropertyChangeSupport"); -Clazz_prepareFields (c$, function () { -this.map = new java.beans.PropertyChangeSupport.PropertyChangeListenerMap (); -}); -Clazz_makeConstructor (c$, -function (sourceBean) { -if (sourceBean == null) { -throw new NullPointerException (); -}this.source = sourceBean; -}, "~O"); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (listener) { -this.addPropertyChangeListener1 (listener); -}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "addPropertyChangeListener1", -function (listener) { -if (listener == null) { -return; -}if (Clazz_instanceOf (listener, java.beans.PropertyChangeListenerProxy)) { -var proxy = listener; -this.addPropertyChangeListener (proxy.getPropertyName (), proxy.getListener ()); -} else { -this.map.add (null, listener); -}}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (listener) { -if (listener == null) { -return; -}if (Clazz_instanceOf (listener, java.beans.PropertyChangeListenerProxy)) { -var proxy = listener; -this.removePropertyChangeListener (proxy.getPropertyName (), proxy.getListener ()); -} else { -this.map.remove (null, listener); -}}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -return this.map.getListeners (); -}); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (propertyName, listener) { -{ -if (arguments.length == 1) { -this.addPropertyChangeListener1(propertyName); -return; -} -}this.addPropertyChangeListener2 (propertyName, listener); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "addPropertyChangeListener2", -function (propertyName, listener) { -if (listener == null || propertyName == null) { -return; -}listener = this.map.extract (listener); -if (listener != null) { -this.map.add (propertyName, listener); -}}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (propertyName, listener) { -if (listener == null || propertyName == null) { -return; -}listener = this.map.extract (listener); -if (listener != null) { -this.map.remove (propertyName, listener); -}}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function (propertyName) { -return this.map.getListeners (propertyName); -}, "~S"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -if (oldValue != null && newValue != null && oldValue.equals (newValue)) { -return; -}this.firePropertyChangeEvt ( new java.beans.PropertyChangeEvent (this.source, propertyName, oldValue, newValue)); -}, "~S,~O,~O"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -if (oldValue == newValue) { -return; -}this.firePropertyChange (propertyName, Integer.$valueOf (oldValue), Integer.$valueOf (newValue)); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -if (oldValue == newValue) { -return; -}this.firePropertyChange (propertyName, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); -}, "~S,~B,~B"); -Clazz_defineMethod (c$, "firePropertyChangeEvt", -function (evt) { -var oldValue = evt.getOldValue (); -var newValue = evt.getNewValue (); -var propertyName = evt.getPropertyName (); -if (oldValue != null && newValue != null && oldValue.equals (newValue)) { -return; -}var common = this.map.get (null); -var named = (propertyName != null) ? this.map.get (propertyName) : null; -this.fire (common, evt); -this.fire (named, evt); -}, "java.beans.PropertyChangeEvent"); -Clazz_defineMethod (c$, "fire", - function (listeners, event) { -if (listeners != null) { -for (var listener, $listener = 0, $$listener = listeners; $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) { -listener.propertyChange (event); -} -}}, "~A,java.beans.PropertyChangeEvent"); -Clazz_defineMethod (c$, "fireIndexedPropertyChange", -function (propertyName, index, oldValue, newValue) { -this.firePropertyChangeEvt ( new java.beans.IndexedPropertyChangeEvent (this.source, propertyName, oldValue, newValue, index)); -}, "~S,~N,~O,~O"); -Clazz_defineMethod (c$, "fireIndexedPropertyChange", -function (propertyName, index, oldValue, newValue) { -if (oldValue == newValue) { -return; -}this.fireIndexedPropertyChange (propertyName, index, Integer.$valueOf (oldValue), Integer.$valueOf (newValue)); -}, "~S,~N,~N,~N"); -Clazz_defineMethod (c$, "fireIndexedPropertyChange", -function (propertyName, index, oldValue, newValue) { -if (oldValue == newValue) { -return; -}this.fireIndexedPropertyChange (propertyName, index, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); -}, "~S,~N,~B,~B"); -Clazz_defineMethod (c$, "hasListeners", -function (propertyName) { -return this.map.hasListeners (propertyName); -}, "~S"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.beans.PropertyChangeSupport, "PropertyChangeListenerMap", java.beans.ChangeListenerMap); -Clazz_overrideMethod (c$, "newArray", -function (a) { -return (0 < a) ? new Array (a) : java.beans.PropertyChangeSupport.PropertyChangeListenerMap.EMPTY; -}, "~N"); -Clazz_overrideMethod (c$, "newProxy", -function (a, b) { -return new java.beans.PropertyChangeListenerProxy (a, b); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineStatics (c$, -"EMPTY", Clazz_newArray (-1, [])); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.beans"); -Clazz_load (null, "java.beans.ChangeListenerMap", ["java.util.ArrayList", "$.Collections", "$.EventListenerProxy", "$.HashMap"], function () { -c$ = Clazz_decorateAsClass (function () { -this.map = null; -Clazz_instantialize (this, arguments); -}, java.beans, "ChangeListenerMap"); -Clazz_defineMethod (c$, "add", -function (name, listener) { -if (this.map == null) { -this.map = new java.util.HashMap (); -}var array = this.map.get (name); -var size = (array != null) ? array.length : 0; -var clone = this.newArray (size + 1); -clone[size] = listener; -if (array != null) { -System.arraycopy (array, 0, clone, 0, size); -}this.map.put (name, clone); -}, "~S,~O"); -Clazz_defineMethod (c$, "remove", -function (name, listener) { -if (this.map != null) { -var array = this.map.get (name); -if (array != null) { -for (var i = 0; i < array.length; i++) { -if (listener.equals (array[i])) { -var size = array.length - 1; -if (size > 0) { -var clone = this.newArray (size); -System.arraycopy (array, 0, clone, 0, i); -System.arraycopy (array, i + 1, clone, i, size - i); -this.map.put (name, clone); -} else { -this.map.remove (name); -if (this.map.isEmpty ()) { -this.map = null; -}}break; -}} -}}}, "~S,~O"); -Clazz_defineMethod (c$, "get", -function (name) { -return (this.map != null) ? this.map.get (name) : null; -}, "~S"); -Clazz_defineMethod (c$, "set", -function (name, listeners) { -if (listeners != null) { -if (this.map == null) { -this.map = new java.util.HashMap (); -}this.map.put (name, listeners); -} else if (this.map != null) { -this.map.remove (name); -if (this.map.isEmpty ()) { -this.map = null; -}}}, "~S,~A"); -Clazz_defineMethod (c$, "getListeners", -function () { -if (this.map == null) { -return this.newArray (0); -}var list = new java.util.ArrayList (); -var listeners = this.map.get (null); -if (listeners != null) { -for (var listener, $listener = 0, $$listener = listeners; $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) { -list.add (listener); -} -}for (var entry, $entry = this.map.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) { -var name = entry.getKey (); -if (name != null) { -for (var listener, $listener = 0, $$listener = entry.getValue (); $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) { -list.add (this.newProxy (name, listener)); -} -}} -return list.toArray (this.newArray (list.size ())); -}); -Clazz_defineMethod (c$, "getListeners", -function (name) { -if (name != null) { -var listeners = this.get (name); -if (listeners != null) { -return listeners.clone (); -}}return this.newArray (0); -}, "~S"); -Clazz_defineMethod (c$, "hasListeners", -function (name) { -if (this.map == null) { -return false; -}var array = this.map.get (null); -return (array != null) || ((name != null) && (null != this.map.get (name))); -}, "~S"); -Clazz_defineMethod (c$, "getEntries", -function () { -return (this.map != null) ? this.map.entrySet () : java.util.Collections.emptySet (); -}); -Clazz_defineMethod (c$, "extract", -function (listener) { -while (Clazz_instanceOf (listener, java.util.EventListenerProxy)) { -var proxy = listener; -listener = proxy.getListener (); -} -return listener; -}, "~O"); -}); -Clazz_declarePackage ("java.beans"); -Clazz_load (["java.beans.PropertyChangeEvent"], "java.beans.IndexedPropertyChangeEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.index = 0; -Clazz_instantialize (this, arguments); -}, java.beans, "IndexedPropertyChangeEvent", java.beans.PropertyChangeEvent); -Clazz_makeConstructor (c$, -function (source, propertyName, oldValue, newValue, index) { -Clazz_superConstructor (this, java.beans.IndexedPropertyChangeEvent, [source, propertyName, oldValue, newValue]); -this.index = index; -}, "~O,~S,~O,~O,~N"); -Clazz_defineMethod (c$, "getIndex", -function () { -return this.index; -}); -}); -Clazz_declarePackage ("java.beans"); -Clazz_load (["java.util.EventObject"], "java.beans.PropertyChangeEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.propertyName = null; -this.newValue = null; -this.oldValue = null; -this.propagationId = null; -Clazz_instantialize (this, arguments); -}, java.beans, "PropertyChangeEvent", java.util.EventObject); -Clazz_makeConstructor (c$, -function (source, propertyName, oldValue, newValue) { -Clazz_superConstructor (this, java.beans.PropertyChangeEvent, [source]); -this.propertyName = propertyName; -this.newValue = newValue; -this.oldValue = oldValue; -}, "~O,~S,~O,~O"); -Clazz_defineMethod (c$, "getPropertyName", -function () { -return this.propertyName; -}); -Clazz_defineMethod (c$, "getNewValue", -function () { -return this.newValue; -}); -Clazz_defineMethod (c$, "getOldValue", -function () { -return this.oldValue; -}); -Clazz_defineMethod (c$, "setPropagationId", -function (propagationId) { -this.propagationId = propagationId; -}, "~O"); -Clazz_defineMethod (c$, "getPropagationId", -function () { -return this.propagationId; -}); -}); -Clazz_declarePackage ("java.beans"); -Clazz_load (["java.util.EventListenerProxy", "java.beans.PropertyChangeListener"], "java.beans.PropertyChangeListenerProxy", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.propertyName = null; -Clazz_instantialize (this, arguments); -}, java.beans, "PropertyChangeListenerProxy", java.util.EventListenerProxy, java.beans.PropertyChangeListener); -Clazz_makeConstructor (c$, -function (propertyName, listener) { -Clazz_superConstructor (this, java.beans.PropertyChangeListenerProxy, [listener]); -this.propertyName = propertyName; -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "propertyChange", -function (evt) { -(this.getListener ()).propertyChange (evt); -}, "java.beans.PropertyChangeEvent"); -Clazz_defineMethod (c$, "getPropertyName", -function () { -return this.propertyName; -}); -}); -Clazz_declarePackage ("java.beans"); -Clazz_load (["java.util.EventListener"], "java.beans.PropertyChangeListener", null, function () { -Clazz_declareInterface (java.beans, "PropertyChangeListener", java.util.EventListener); -}); -Clazz_declarePackage ("java.security"); -Clazz_declareInterface (java.security, "PrivilegedAction"); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.geom.Point2D"], "java.awt.Point", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "Point", java.awt.geom.Point2D); -Clazz_makeConstructor (c$, -function () { -this.construct (0, 0); -}); -Clazz_makeConstructor (c$, -function (p) { -this.construct (p.x, p.y); -}, "java.awt.Point"); -Clazz_makeConstructor (c$, -function (x, y) { -Clazz_superConstructor (this, java.awt.Point, []); -this.x = x; -this.y = y; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "getLocation", -function () { -return new java.awt.Point (this.x, this.y); -}); -Clazz_defineMethod (c$, "setLocation", -function (p) { -this.setLocation (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "setLocation", -function (x, y) { -this.x = Clazz_doubleToInt (Math.floor (x + 0.5)); -this.y = Clazz_doubleToInt (Math.floor (y + 0.5)); -}, "~N,~N"); -Clazz_defineMethod (c$, "move", -function (x, y) { -this.x = x; -this.y = y; -}, "~N,~N"); -Clazz_defineMethod (c$, "translate", -function (dx, dy) { -this.x += dx; -this.y += dy; -}, "~N,~N"); -Clazz_defineMethod (c$, "equals", -function (obj) { -if (Clazz_instanceOf (obj, java.awt.Point)) { -var pt = obj; -return (this.x == pt.x) && (this.y == pt.y); -}return Clazz_superCall (this, java.awt.Point, "equals", [obj]); -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + "]"; -}); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (["java.lang.StringBuffer", "java.util.Collections", "$.HashMap", "$.IdentityHashMap"], ["jssun.awt.AppContext", "$.MostRecentThreadAppContext", "$.MostRecentKeyValue"], ["java.lang.Thread", "java.util.HashSet", "java.beans.PropertyChangeSupport"], function () { -c$ = Clazz_decorateAsClass (function () { -this.table = null; -this.threadGroup = null; -this.changeSupport = null; -this.$isDisposed = false; -this.mostRecentKeyValue = null; -this.shadowMostRecentKeyValue = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "AppContext"); -Clazz_prepareFields (c$, function () { -this.table = new java.util.HashMap (); -}); -c$.getAppContexts = Clazz_defineMethod (c$, "getAppContexts", -function () { -return new java.util.HashSet (jssun.awt.AppContext.threadGroup2appContext.values ()); -}); -Clazz_defineMethod (c$, "isDisposed", -function () { -return this.$isDisposed; -}); -Clazz_makeConstructor (c$, -function (threadGroup) { -jssun.awt.AppContext.numAppContexts++; -this.threadGroup = threadGroup; -jssun.awt.AppContext.threadGroup2appContext.put (threadGroup, this); -}, "ThreadGroup"); -c$.getAppContext = Clazz_defineMethod (c$, "getAppContext", -function () { -var currentThread = Thread.currentThread (); -var appContext = null; -var recent = jssun.awt.AppContext.mostRecentThreadAppContext; -if ((recent != null) && (recent.thread === currentThread)) { -appContext = recent.appContext; -} else { -var currentThreadGroup = currentThread.getThreadGroup (); -var threadGroup = currentThreadGroup; -appContext = jssun.awt.AppContext.threadGroup2appContext.get (threadGroup); -while (appContext == null) { -threadGroup = threadGroup.getParent (); -if (threadGroup == null) { -return null; -}appContext = jssun.awt.AppContext.threadGroup2appContext.get (threadGroup); -} -for (var tg = currentThreadGroup; tg !== threadGroup; tg = tg.getParent ()) { -jssun.awt.AppContext.threadGroup2appContext.put (tg, appContext); -} -jssun.awt.AppContext.mostRecentThreadAppContext = new jssun.awt.MostRecentThreadAppContext (currentThread, appContext); -}return appContext; -}); -c$.isMainContext = Clazz_defineMethod (c$, "isMainContext", -function (ctx) { -return false; -}, "jssun.awt.AppContext"); -Clazz_defineMethod (c$, "dispose", -function () { -}); -Clazz_defineMethod (c$, "get", -function (key) { -{ -var recent = this.mostRecentKeyValue; -if ((recent != null) && (recent.key === key)) { -return recent.value; -}var value = this.table.get (key); -if (this.mostRecentKeyValue == null) { -this.mostRecentKeyValue = new jssun.awt.MostRecentKeyValue (key, value); -this.shadowMostRecentKeyValue = new jssun.awt.MostRecentKeyValue (key, value); -} else { -var auxKeyValue = this.mostRecentKeyValue; -this.shadowMostRecentKeyValue.setPair (key, value); -this.mostRecentKeyValue = this.shadowMostRecentKeyValue; -this.shadowMostRecentKeyValue = auxKeyValue; -}return value; -}}, "~O"); -Clazz_defineMethod (c$, "put", -function (key, value) { -{ -var recent = this.mostRecentKeyValue; -if ((recent != null) && (recent.key === key)) recent.value = value; -return this.table.put (key, value); -}}, "~O,~O"); -Clazz_defineMethod (c$, "remove", -function (key) { -{ -var recent = this.mostRecentKeyValue; -if ((recent != null) && (recent.key === key)) recent.value = null; -return this.table.remove (key); -}}, "~O"); -Clazz_defineMethod (c$, "getThreadGroup", -function () { -return this.threadGroup; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[threadGroup=" + this.threadGroup.getName () + "]"; -}); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -if (this.changeSupport == null) { -return new Array (0); -}return this.changeSupport.getPropertyChangeListeners (); -}); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (propertyName, listener) { -if (listener == null) { -return; -}if (this.changeSupport == null) { -this.changeSupport = new java.beans.PropertyChangeSupport (this); -}this.changeSupport.addPropertyChangeListener (propertyName, listener); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (propertyName, listener) { -if (listener == null || this.changeSupport == null) { -return; -}this.changeSupport.removePropertyChangeListener (propertyName, listener); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function (propertyName) { -if (this.changeSupport == null) { -return new Array (0); -}return this.changeSupport.getPropertyChangeListeners (propertyName); -}, "~S"); -c$.EVENT_QUEUE_KEY = c$.prototype.EVENT_QUEUE_KEY = new StringBuffer ("EventQueue"); -c$.threadGroup2appContext = c$.prototype.threadGroup2appContext = java.util.Collections.synchronizedMap ( new java.util.IdentityHashMap ()); -Clazz_defineStatics (c$, -"DISPOSED_PROPERTY_NAME", "disposed", -"GUI_DISPOSED", "guidisposed", -"numAppContexts", 0, -"mostRecentThreadAppContext", null); -c$ = Clazz_decorateAsClass (function () { -this.thread = null; -this.appContext = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "MostRecentThreadAppContext"); -Clazz_makeConstructor (c$, -function (key, value) { -this.thread = key; -this.appContext = value; -}, "Thread,jssun.awt.AppContext"); -c$ = Clazz_decorateAsClass (function () { -this.key = null; -this.value = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "MostRecentKeyValue"); -Clazz_makeConstructor (c$, -function (k, v) { -this.key = k; -this.value = v; -}, "~O,~O"); -Clazz_defineMethod (c$, "setPair", -function (k, v) { -this.key = k; -this.value = v; -}, "~O,~O"); -}); -Clazz_load(["java.lang.AbstractStringBuilder","$.Appendable"],"java.lang.StringBuffer",["java.lang.Character","$.Double","$.Float","$.Long"],function(){ -c$=Clazz_declareType(java.lang,"StringBuffer",AbstractStringBuilder,[Appendable,java.io.Serializable,CharSequence]); -Clazz_makeConstructor(c$, -function(cs){ -if(cs==null){ -throw new NullPointerException(); -} -Clazz_superConstructor(this,StringBuffer,[cs.toString()]); -},"CharSequence"); -Clazz_defineMethod(c$,"append", -function(b){ -return this.append(b?"true":"false"); -},"~B"); -Clazz_defineMethod(c$,"append", -function(ch){ -this.append0(ch); -return this; -},"~N"); -Clazz_defineMethod(c$,"append", -function(d){ -return this.append(Double.toString(d)); -},"~N"); -Clazz_defineMethod(c$,"append", -function(obj){ -if(obj==null){ -this.appendNull(); -}else{ -this.append0(obj.toString()); -}return this; -},"~O"); -Clazz_defineMethod(c$,"append", -function(string){ -this.append0(string); -return this; -},"~S"); -Clazz_defineMethod(c$,"append", -function(sb){ -if(sb==null){ -this.appendNull(); -}else{ -{ -this.append0(sb.getValue(),0,sb.length()); -}}return this; -},"StringBuffer"); -Clazz_defineMethod(c$,"append", -function(chars){ -this.append0(chars); -return this; -},"~A"); -Clazz_defineMethod(c$,"append", -function(chars,start,length){ -this.append0(chars,start,length); -return this; -},"~A,~N,~N"); -Clazz_defineMethod(c$,"append", -function(s){ -if(s==null){ -this.appendNull(); -}else{ -this.append0(s.toString()); -}return this; -},"CharSequence"); -Clazz_defineMethod(c$,"append", -function(s,start,end){ -this.append0(s,start,end); -return this; -},"CharSequence,~N,~N"); -Clazz_defineMethod(c$,"appendCodePoint", -function(codePoint){ -return this.append(Character.toChars(codePoint)); -},"~N"); -Clazz_defineMethod(c$,"$delete", -function(start,end){ -this.delete0(start,end); -return this; -},"~N,~N"); -Clazz_defineMethod(c$,"deleteCharAt", -function(location){ -this.deleteCharAt0(location); -return this; -},"~N"); -Clazz_defineMethod(c$,"insert", -function(index,ch){ -this.insert0(index,ch); -return this; -},"~N,~N"); -Clazz_defineMethod(c$,"insert", -function(index,b){ -return this.insert(index,b?"true":"false"); -},"~N,~B"); -Clazz_defineMethod(c$,"insert", -function(index,i){ -return this.insert(index,Integer.toString(i)); -},"~N,~N"); -Clazz_defineMethod(c$,"insert", -function(index,l){ -return this.insert(index,Long.toString(l)); -},"~N,~N"); -Clazz_defineMethod(c$,"insert", -function(index,d){ -return this.insert(index,Double.toString(d)); -},"~N,~N"); -Clazz_defineMethod(c$,"insert", -function(index,f){ -return this.insert(index,Float.toString(f)); -},"~N,~N"); -Clazz_defineMethod(c$,"insert", -function(index,obj){ -return this.insert(index,obj==null?"null":obj.toString()); -},"~N,~O"); -Clazz_defineMethod(c$,"insert", -function(index,string){ -this.insert0(index,string); -return this; -},"~N,~S"); -Clazz_defineMethod(c$,"insert", -function(index,chars){ -this.insert0(index,chars); -return this; -},"~N,~A"); -Clazz_defineMethod(c$,"insert", -function(index,chars,start,length){ -this.insert0(index,chars,start,length); -return this; -},"~N,~A,~N,~N"); -Clazz_defineMethod(c$,"insert", -function(index,s){ -this.insert0(index,s==null?"null":s.toString()); -return this; -},"~N,CharSequence"); -Clazz_defineMethod(c$,"insert", -function(index,s,start,end){ -this.insert0(index,s,start,end); -return this; -},"~N,CharSequence,~N,~N"); -Clazz_defineMethod(c$,"replace", -function(start,end,string){ -this.replace0(start,end,string); -return this; -},"~N,~N,~S"); -Clazz_defineMethod(c$,"reverse", -function(){ -this.reverse0(); -return this; -}); -Clazz_overrideMethod(c$,"subSequence", -function(start,end){ -return Clazz_superCall(this,StringBuffer,"substring",[start,end]); -},"~N,~N"); -}); -Clazz_load(["java.util.AbstractMap","$.AbstractSet","$.Iterator","$.Map","$.MapEntry"],"java.util.IdentityHashMap",["java.lang.IllegalArgumentException","$.IllegalStateException","java.util.AbstractCollection","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.NoSuchElementException"],function(){ -c$=Clazz_decorateAsClass(function(){ -this.elementData=null; -this.$size=0; -this.threshold=0; -this.modCount=0; -Clazz_instantialize(this,arguments); -},java.util,"IdentityHashMap",java.util.AbstractMap,[java.util.Map,java.io.Serializable,Cloneable]); -Clazz_makeConstructor(c$, -function(){ -this.construct(21); -}); -Clazz_makeConstructor(c$, -function(maxSize){ -Clazz_superConstructor(this,java.util.IdentityHashMap,[]); -if(maxSize>=0){ -this.$size=0; -this.threshold=this.getThreshold(maxSize); -this.elementData=this.newElementArray(this.computeElementArraySize()); -}else{ -throw new IllegalArgumentException(); -}},"~N"); -Clazz_defineMethod(c$,"getThreshold", -($fz=function(maxSize){ -return maxSize>3?maxSize:3; -},$fz.isPrivate=true,$fz),"~N"); -Clazz_defineMethod(c$,"computeElementArraySize", -($fz=function(){ -return(Math.floor((this.threshold*10000)/7500))*2; -},$fz.isPrivate=true,$fz)); -Clazz_defineMethod(c$,"newElementArray", -($fz=function(s){ -return new Array(s); -},$fz.isPrivate=true,$fz),"~N"); -Clazz_makeConstructor(c$, -function(map){ -this.construct(map.size()<6?11:map.size()*2); -this.putAllImpl(map); -},"java.util.Map"); -Clazz_defineMethod(c$,"massageValue", -($fz=function(value){ -return((value===java.util.IdentityHashMap.NULL_OBJECT)?null:value); -},$fz.isPrivate=true,$fz),"~O"); -Clazz_overrideMethod(c$,"clear", -function(){ -this.$size=0; -for(var i=0;ithis.threshold){ -this.rehash(); -index=this.findIndex(_key,this.elementData); -}this.elementData[index]=_key; -this.elementData[index+1]=null; -}var result=this.elementData[index+1]; -this.elementData[index+1]=_value; -return this.massageValue(result); -},"~O,~O"); -Clazz_overrideMethod(c$,"putAll", -function(map){ -this.putAllImpl(map); -},"java.util.Map"); -Clazz_defineMethod(c$,"rehash", -($fz=function(){ -var newlength=this.elementData.length<<1; -if(newlength==0){ -newlength=1; -}var newData=this.newElementArray(newlength); -for(var i=0;iindex; -if(next= 0) { -return true; -}var owner = this.getOwner_NoClientCode (); -return (owner != null) && owner.isModalExcluded (exclusionType); -}, "java.awt.Dialog.ModalExclusionType"); -Clazz_defineMethod (c$, "updateChildrenBlocking", -function () { -}); -Clazz_defineMethod (c$, "addWindowListener", -function (l) { -if (l == null) { -return; -}this.newEventsOnly = true; -this.windowListener = java.awt.AWTEventMulticaster.add (this.windowListener, l); -}, "java.awt.event.WindowListener"); -Clazz_defineMethod (c$, "addWindowStateListener", -function (l) { -if (l == null) { -return; -}this.windowStateListener = java.awt.AWTEventMulticaster.add (this.windowStateListener, l); -this.newEventsOnly = true; -}, "java.awt.event.WindowStateListener"); -Clazz_defineMethod (c$, "addWindowFocusListener", -function (l) { -if (l == null) { -return; -}this.windowFocusListener = java.awt.AWTEventMulticaster.add (this.windowFocusListener, l); -this.newEventsOnly = true; -}, "java.awt.event.WindowFocusListener"); -Clazz_defineMethod (c$, "removeWindowListener", -function (l) { -if (l == null) { -return; -}this.windowListener = java.awt.AWTEventMulticaster.remove (this.windowListener, l); -}, "java.awt.event.WindowListener"); -Clazz_defineMethod (c$, "removeWindowStateListener", -function (l) { -if (l == null) { -return; -}this.windowStateListener = java.awt.AWTEventMulticaster.remove (this.windowStateListener, l); -}, "java.awt.event.WindowStateListener"); -Clazz_defineMethod (c$, "removeWindowFocusListener", -function (l) { -if (l == null) { -return; -}this.windowFocusListener = java.awt.AWTEventMulticaster.remove (this.windowFocusListener, l); -}, "java.awt.event.WindowFocusListener"); -Clazz_defineMethod (c$, "getWindowListeners", -function () { -return (this.getListeners (java.awt.event.WindowListener)); -}); -Clazz_defineMethod (c$, "getWindowFocusListeners", -function () { -return (this.getListeners (java.awt.event.WindowFocusListener)); -}); -Clazz_defineMethod (c$, "getWindowStateListeners", -function () { -return (this.getListeners (java.awt.event.WindowStateListener)); -}); -Clazz_defineMethod (c$, "getListeners", -function (listenerType) { -var l = null; -if (listenerType === java.awt.event.WindowFocusListener) { -l = this.windowFocusListener; -} else if (listenerType === java.awt.event.WindowStateListener) { -l = this.windowStateListener; -} else if (listenerType === java.awt.event.WindowListener) { -l = this.windowListener; -} else { -return Clazz_superCall (this, java.awt.Window, "getListeners", [listenerType]); -}return java.awt.AWTEventMulticaster.getListeners (l, listenerType); -}, "Class"); -Clazz_defineMethod (c$, "eventEnabled", -function (e) { -switch (e.id) { -case 200: -case 201: -case 202: -case 203: -case 204: -case 205: -case 206: -if ((this.eventMask & 64) != 0 || this.windowListener != null) { -return true; -}return false; -case 207: -case 208: -if ((this.eventMask & 524288) != 0 || this.windowFocusListener != null) { -return true; -}return false; -case 209: -if ((this.eventMask & 262144) != 0 || this.windowStateListener != null) { -return true; -}return false; -default: -break; -} -return Clazz_superCall (this, java.awt.Window, "eventEnabled", [e]); -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "processEvent", -function (e) { -if (Clazz_instanceOf (e, java.awt.event.WindowEvent)) { -switch (e.getID ()) { -case 200: -case 201: -case 202: -case 203: -case 204: -case 205: -case 206: -this.processWindowEvent (e); -break; -case 207: -case 208: -this.processWindowFocusEvent (e); -break; -case 209: -this.processWindowStateEvent (e); -default: -break; -} -return; -}this.processEventCont (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "processWindowEvent", -function (e) { -var listener = this.windowListener; -if (listener != null) { -switch (e.getID ()) { -case 200: -listener.windowOpened (e); -break; -case 201: -listener.windowClosing (e); -break; -case 202: -listener.windowClosed (e); -break; -case 203: -listener.windowIconified (e); -break; -case 204: -listener.windowDeiconified (e); -break; -case 205: -listener.windowActivated (e); -break; -case 206: -listener.windowDeactivated (e); -break; -default: -break; -} -}}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "processWindowFocusEvent", -function (e) { -var listener = this.windowFocusListener; -if (listener != null) { -switch (e.getID ()) { -case 207: -listener.windowGainedFocus (e); -break; -case 208: -listener.windowLostFocus (e); -break; -default: -break; -} -}}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "processWindowStateEvent", -function (e) { -var listener = this.windowStateListener; -if (listener != null) { -switch (e.getID ()) { -case 209: -listener.windowStateChanged (e); -break; -default: -break; -} -}}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "preProcessKeyEvent", -function (e) { -}, "java.awt.event.KeyEvent"); -Clazz_overrideMethod (c$, "postProcessKeyEvent", -function (e) { -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "setAlwaysOnTop", -function (alwaysOnTop) { -var oldAlwaysOnTop; -{ -oldAlwaysOnTop = this.alwaysOnTop; -this.alwaysOnTop = alwaysOnTop; -}if (oldAlwaysOnTop != alwaysOnTop) { -if (this.isAlwaysOnTopSupported ()) { -}this.firePropertyChangeBool ("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop); -}}, "~B"); -Clazz_defineMethod (c$, "isAlwaysOnTopSupported", -function () { -return java.awt.Toolkit.getDefaultToolkit ().isAlwaysOnTopSupported (); -}); -Clazz_defineMethod (c$, "isAlwaysOnTop", -function () { -return this.alwaysOnTop; -}); -Clazz_defineMethod (c$, "isActive", -function () { -return false; -}); -Clazz_defineMethod (c$, "isFocused", -function () { -return swingjs.JSToolkit.isFocused (this); -}); -Clazz_overrideMethod (c$, "getFocusTraversalKeys", -function (id) { -return null; -}, "~N"); -Clazz_defineMethod (c$, "setFocusCycleRoot", -function (focusCycleRoot) { -}, "~B"); -Clazz_defineMethod (c$, "isFocusCycleRoot", -function () { -return true; -}); -Clazz_overrideMethod (c$, "getFocusCycleRootAncestor", -function () { -return null; -}); -Clazz_defineMethod (c$, "isFocusableWindow", -function () { -if (!this.getFocusableWindowState ()) { -return false; -}if (Clazz_instanceOf (this, java.awt.Frame) || Clazz_instanceOf (this, java.awt.Dialog)) { -return true; -}for (var owner = this.getOwner (); owner != null; owner = owner.getOwner ()) { -if (Clazz_instanceOf (owner, java.awt.Frame) || Clazz_instanceOf (owner, java.awt.Dialog)) { -return owner.isShowing (); -}} -return false; -}); -Clazz_defineMethod (c$, "getFocusableWindowState", -function () { -return this.focusableWindowState; -}); -Clazz_defineMethod (c$, "setFocusableWindowState", -function (focusableWindowState) { -var oldFocusableWindowState; -{ -oldFocusableWindowState = this.focusableWindowState; -this.focusableWindowState = focusableWindowState; -}this.firePropertyChangeBool ("focusableWindowState", oldFocusableWindowState, focusableWindowState); -if (oldFocusableWindowState && !focusableWindowState && this.isFocused ()) { -for (var owner = this.getOwner (); owner != null; owner = owner.getOwner ()) { -} -}}, "~B"); -Clazz_defineMethod (c$, "dispatchEventImpl", -function (e) { -if (e.getID () == 101) { -this.invalidate (); -this.validate (); -}Clazz_superCall (this, java.awt.Window, "dispatchEventImpl", [e]); -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "postEvent", -function (e) { -if (this.handleEvent (e)) { -e.consume (); -return true; -}return false; -}, "java.awt.Event"); -Clazz_defineMethod (c$, "isShowing", -function () { -return this.visible; -}); -Clazz_defineMethod (c$, "applyResourceBundle", -function (rb) { -this.applyComponentOrientation (java.awt.ComponentOrientation.getOrientation (rb)); -}, "java.util.ResourceBundle"); -Clazz_defineMethod (c$, "applyResourceBundle", -function (rbName) { -this.applyResourceBundle (java.util.ResourceBundle.getBundle (rbName)); -}, "~S"); -Clazz_defineMethod (c$, "addOwnedWindow", -function (weakWindow) { -if (weakWindow != null) { -{ -if (!this.ownedWindowList.contains (weakWindow)) { -this.ownedWindowList.addElement (weakWindow); -}}}}, "java.awt.Window"); -Clazz_defineMethod (c$, "removeOwnedWindow", -function (weakWindow) { -if (weakWindow != null) { -this.ownedWindowList.removeElement (weakWindow); -}}, "java.awt.Window"); -Clazz_defineMethod (c$, "connectOwnedWindow", -function (child) { -child.parent = this; -this.addOwnedWindow (child); -}, "java.awt.Window"); -Clazz_defineMethod (c$, "addToWindowList", - function () { -var windowList = this.appContext.get (java.awt.Window); -if (windowList == null) { -windowList = new java.util.Vector (); -this.appContext.put (java.awt.Window, windowList); -}windowList.add (this); -}); -c$.removeFromWindowList = Clazz_defineMethod (c$, "removeFromWindowList", - function (context, w) { -{ -var windowList = context.get (java.awt.Window); -if (windowList != null) { -windowList.remove (w); -}}}, "jssun.awt.AppContext,java.awt.Window"); -Clazz_defineMethod (c$, "getGraphicsConfiguration", -function () { -if (this.graphicsConfig == null) this.graphicsConfig = swingjs.JSToolkit.getGraphicsConfiguration (); -return this.graphicsConfig; -}); -Clazz_overrideMethod (c$, "resetGC", -function () { -}); -Clazz_defineMethod (c$, "setLocationRelativeTo", -function (c) { -var root = null; -if (c != null) { -if (Clazz_instanceOf (c, java.awt.Window) || Clazz_instanceOf (c, java.applet.Applet)) { -root = c; -} else { -var parent; -for (parent = c.getParent (); parent != null; parent = parent.getParent ()) { -if (Clazz_instanceOf (parent, java.awt.Window) || Clazz_instanceOf (parent, java.applet.Applet)) { -root = parent; -break; -}} -}}if ((c != null && !c.isShowing ()) || root == null || !root.isShowing ()) { -var paneSize = this.getSize (); -var centerPoint = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ().getCenterPoint (); -this.setLocation (centerPoint.x - Clazz_doubleToInt (paneSize.width / 2), centerPoint.y - Clazz_doubleToInt (paneSize.height / 2)); -} else { -var invokerSize = c.getSize (); -var invokerScreenLocation = c.getLocationOnScreen (); -var windowBounds = this.getBounds (); -var dx = invokerScreenLocation.x + ((invokerSize.width - windowBounds.width) >> 1); -var dy = invokerScreenLocation.y + ((invokerSize.height - windowBounds.height) >> 1); -var ss = root.getGraphicsConfiguration ().getBounds (); -if (dy + windowBounds.height > ss.y + ss.height) { -dy = ss.y + ss.height - windowBounds.height; -if (invokerScreenLocation.x - ss.x + Clazz_doubleToInt (invokerSize.width / 2) < Clazz_doubleToInt (ss.width / 2)) { -dx = invokerScreenLocation.x + invokerSize.width; -} else { -dx = invokerScreenLocation.x - windowBounds.width; -}}if (dx + windowBounds.width > ss.x + ss.width) { -dx = ss.x + ss.width - windowBounds.width; -}if (dx < ss.x) dx = ss.x; -if (dy < ss.y) dy = ss.y; -this.setLocation (dx, dy); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "deliverMouseWheelToAncestor", -function (e) { -}, "java.awt.event.MouseWheelEvent"); -Clazz_overrideMethod (c$, "dispatchMouseWheelToAncestor", -function (e) { -return false; -}, "java.awt.event.MouseWheelEvent"); -Clazz_defineMethod (c$, "getTemporaryLostComponent", -function () { -return this.temporaryLostComponent; -}); -Clazz_defineMethod (c$, "setTemporaryLostComponent", -function (component) { -var previousComp = this.temporaryLostComponent; -if (component == null || component.canBeFocusOwner ()) { -this.temporaryLostComponent = component; -} else { -this.temporaryLostComponent = null; -}return previousComp; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "canContainFocusOwner", -function (focusOwnerCandidate) { -return Clazz_superCall (this, java.awt.Window, "canContainFocusOwner", [focusOwnerCandidate]) && this.isFocusableWindow (); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "setBounds", -function (r) { -this.setBounds (r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_overrideMethod (c$, "isRecursivelyVisible", -function () { -return this.visible; -}); -Clazz_defineMethod (c$, "getOpacity", -function () { -{ -return this.opacity; -}}); -Clazz_defineMethod (c$, "setOpacity", -function (opacity) { -{ -if (opacity < 0.0 || opacity > 1.0) { -throw new IllegalArgumentException ("The value of opacity should be in the range [0.0f .. 1.0f]."); -}this.opacity = opacity; -}}, "~N"); -Clazz_defineMethod (c$, "getShape", -function () { -{ -return this.shape; -}}); -Clazz_defineMethod (c$, "setShape", -function (shape) { -{ -this.shape = shape; -}}, "java.awt.Shape"); -Clazz_defineMethod (c$, "setOpaque", -function (opaque) { -{ -java.awt.Window.setLayersOpaque (this, opaque); -this.opaque = opaque; -var peer = this.getPeer (); -if (peer != null) { -peer.setOpaque (opaque); -}}}, "~B"); -c$.setLayersOpaque = Clazz_defineMethod (c$, "setLayersOpaque", - function (component, isOpaque) { -if (Clazz_instanceOf (component, javax.swing.RootPaneContainer)) { -var rpc = component; -var root = rpc.getRootPane (); -var lp = root.getLayeredPane (); -var c = root.getContentPane (); -var content = (Clazz_instanceOf (c, javax.swing.JComponent)) ? c : null; -lp.setOpaque (isOpaque); -root.setOpaque (isOpaque); -root.setDoubleBuffered (isOpaque); -if (content != null) { -content.setOpaque (isOpaque); -content.setDoubleBuffered (isOpaque); -var numChildren = content.getComponentCount (); -if (numChildren > 0) { -var child = content.getComponent (0); -if (Clazz_instanceOf (child, javax.swing.RootPaneContainer)) { -java.awt.Window.setLayersOpaque (child, isOpaque); -}}}}var bg = component.getBackground (); -var hasTransparentBg = java.awt.Window.TRANSPARENT_BACKGROUND_COLOR.equals (bg); -var container = null; -if (Clazz_instanceOf (component, java.awt.Container)) { -container = component; -}if (isOpaque) { -if (hasTransparentBg) { -var newColor = null; -if (container != null && container.preserveBackgroundColor != null) { -newColor = container.preserveBackgroundColor; -} else { -newColor = new java.awt.Color (255, 255, 255); -}component.setBackground (newColor); -}} else { -if (!hasTransparentBg && container != null) { -container.preserveBackgroundColor = bg; -}component.setBackground (java.awt.Window.TRANSPARENT_BACKGROUND_COLOR); -}}, "java.awt.Component,~B"); -Clazz_overrideMethod (c$, "getContainer", -function () { -return null; -}); -Clazz_overrideMethod (c$, "mixOnReshaping", -function () { -}); -Clazz_overrideMethod (c$, "getLocationOnWindow", -function () { -return new java.awt.Point (0, 0); -}); -c$.$Window$1DisposeAction$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, java.awt, "Window$1DisposeAction", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -var a; -{ -a = new Array (this.b$["java.awt.Window"].ownedWindowList.size ()); -this.b$["java.awt.Window"].ownedWindowList.copyInto (a); -}for (var b = 0; b < a.length; b++) { -var c = (((a[b]))); -if (c != null) { -c.disposeImpl (); -}} -this.b$["java.awt.Window"].hide (); -this.b$["java.awt.Window"].beforeFirstShow = true; -this.b$["java.awt.Window"].removeNotify (); -this.b$["java.awt.Window"].clearCurrentFocusCycleRootOnHide (); -}); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"systemSyncLWRequests", false, -"OPENED", 0x01, -"base", "win", -"nameCounter", 0); -c$.allWindows = c$.prototype.allWindows = new java.util.ArrayList (); -c$.TRANSPARENT_BACKGROUND_COLOR = c$.prototype.TRANSPARENT_BACKGROUND_COLOR = new java.awt.Color (0, 0, 0, 0); -c$ = Clazz_decorateAsClass (function () { -this.focusRoot = null; -this.focusOwner = null; -Clazz_instantialize (this, arguments); -}, java.awt, "FocusManager"); -}); -Clazz_load(["java.util.AbstractList","$.List","$.RandomAccess"],"java.util.Vector",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.IndexOutOfBoundsException","$.StringBuffer","java.lang.reflect.Array","java.util.Arrays","$.Collections","$.Enumeration","$.NoSuchElementException"],function(){ -c$=Clazz_decorateAsClass(function(){ -this.elementCount=0; -this.elementData=null; -this.capacityIncrement=0; -Clazz_instantialize(this,arguments); -},java.util,"Vector",java.util.AbstractList,[java.util.List,java.util.RandomAccess,Cloneable,java.io.Serializable]); -Clazz_makeConstructor(c$, -function(){ -this.construct(10,0); -}); -Clazz_makeConstructor(c$, -function(capacity){ -this.construct(capacity,0); -},"~N"); -Clazz_makeConstructor(c$, -function(capacity,capacityIncrement){ -Clazz_superConstructor(this,java.util.Vector,[]); -this.elementCount=0; -try{ -this.elementData=this.newElementArray(capacity); -}catch(e){ -if(Clazz_instanceOf(e,NegativeArraySizeException)){ -throw new IllegalArgumentException(); -}else{ -throw e; -} -} -this.capacityIncrement=capacityIncrement; -},"~N,~N"); -Clazz_makeConstructor(c$, -function(collection){ -this.construct(collection.size(),0); -var it=collection.iterator(); -while(it.hasNext()){ -this.elementData[this.elementCount++]=it.next(); -} -},"java.util.Collection"); -Clazz_defineMethod(c$,"newElementArray", -($fz=function(size){ -return new Array(size); -},$fz.isPrivate=true,$fz),"~N"); -Clazz_defineMethod(c$,"add", -function(location,object){ -this.insertElementAt(object,location); -},"~N,~O"); -Clazz_defineMethod(c$,"add", -function(object){ -this.addElement(object); -return true; -},"~O"); -Clazz_defineMethod(c$,"addAll", -function(location,collection){ -if(0<=location&&location<=this.elementCount){ -var size=collection.size(); -if(size==0){ -return false; -}var required=size-(this.elementData.length-this.elementCount); -if(required>0){ -this.growBy(required); -}var count=this.elementCount-location; -if(count>0){ -System.arraycopy(this.elementData,location,this.elementData,location+size,count); -}var it=collection.iterator(); -while(it.hasNext()){ -this.elementData[location++]=it.next(); -} -this.elementCount+=size; -this.modCount++; -return true; -}throw new ArrayIndexOutOfBoundsException(location); -},"~N,java.util.Collection"); -Clazz_defineMethod(c$,"addAll", -function(collection){ -return this.addAll(this.elementCount,collection); -},"java.util.Collection"); -Clazz_defineMethod(c$,"addElement", -function(object){ -if(this.elementCount==this.elementData.length){ -this.growByOne(); -}this.elementData[this.elementCount++]=object; -this.modCount++; -},"~O"); -Clazz_defineMethod(c$,"capacity", -function(){ -return this.elementData.length; -}); -Clazz_overrideMethod(c$,"clear", -function(){ -this.removeAllElements(); -}); -Clazz_defineMethod(c$,"clone", -function(){ -try{ -var vector=Clazz_superCall(this,java.util.Vector,"clone",[]); -vector.elementData=this.elementData.clone(); -return vector; -}catch(e){ -if(Clazz_instanceOf(e,CloneNotSupportedException)){ -return null; -}else{ -throw e; -} -} -}); -Clazz_overrideMethod(c$,"contains", -function(object){ -return this.indexOf(object,0)!=-1; -},"~O"); -Clazz_defineMethod(c$,"copyInto", -function(elements){ -System.arraycopy(this.elementData,0,elements,0,this.elementCount); -},"~A"); -Clazz_defineMethod(c$,"elementAt", -function(location){ -if(locationnext?minimumCapacity:next); -}},"~N"); -Clazz_overrideMethod(c$,"equals", -function(object){ -if(this===object){ -return true; -}if(Clazz_instanceOf(object,java.util.List)){ -var list=object; -if(list.size()!=this.size()){ -return false; -}var index=0; -var it=list.iterator(); -while(it.hasNext()){ -var e1=this.elementData[index++]; -var e2=it.next(); -if(!(e1==null?e2==null:e1.equals(e2))){ -return false; -}} -return true; -}return false; -},"~O"); -Clazz_defineMethod(c$,"firstElement", -function(){ -if(this.elementCount>0){ -return this.elementData[0]; -}throw new java.util.NoSuchElementException(); -}); -Clazz_overrideMethod(c$,"get", -function(location){ -return this.elementAt(location); -},"~N"); -Clazz_defineMethod(c$,"grow", -($fz=function(newCapacity){ -var newData=this.newElementArray(newCapacity); -System.arraycopy(this.elementData,0,newData,0,this.elementCount); -this.elementData=newData; -},$fz.isPrivate=true,$fz),"~N"); -Clazz_defineMethod(c$,"growByOne", -($fz=function(){ -var adding=0; -if(this.capacityIncrement<=0){ -if((adding=this.elementData.length)==0){ -adding=1; -}}else{ -adding=this.capacityIncrement; -}var newData=this.newElementArray(this.elementData.length+adding); -System.arraycopy(this.elementData,0,newData,0,this.elementCount); -this.elementData=newData; -},$fz.isPrivate=true,$fz)); -Clazz_defineMethod(c$,"growBy", -($fz=function(required){ -var adding=0; -if(this.capacityIncrement<=0){ -if((adding=this.elementData.length)==0){ -adding=required; -}while(adding0){ -System.arraycopy(this.elementData,location,this.elementData,location+1,count); -}this.elementData[location]=object; -this.elementCount++; -this.modCount++; -}else{ -throw new ArrayIndexOutOfBoundsException(location); -}},"~O,~N"); -Clazz_overrideMethod(c$,"isEmpty", -function(){ -return this.elementCount==0; -}); -Clazz_defineMethod(c$,"lastElement", -function(){ -try{ -return this.elementData[this.elementCount-1]; -}catch(e){ -if(Clazz_instanceOf(e,IndexOutOfBoundsException)){ -throw new java.util.NoSuchElementException(); -}else{ -throw e; -} -} -}); -Clazz_defineMethod(c$,"lastIndexOf", -function(object){ -return this.lastIndexOf(object,this.elementCount-1); -},"~O"); -Clazz_defineMethod(c$,"lastIndexOf", -function(object,location){ -if(location=0;i--){ -if(object.equals(this.elementData[i])){ -return i; -}} -}else{ -for(var i=location;i>=0;i--){ -if(this.elementData[i]==null){ -return i; -}} -}return-1; -}throw new ArrayIndexOutOfBoundsException(location); -},"~O,~N"); -Clazz_defineMethod(c$,"remove", -function(location){ -if(location0){ -System.arraycopy(this.elementData,location+1,this.elementData,location,size); -}this.elementData[this.elementCount]=null; -this.modCount++; -return result; -}throw new ArrayIndexOutOfBoundsException(location); -},"~N"); -Clazz_defineMethod(c$,"remove", -function(object){ -return this.removeElement(object); -},"~O"); -Clazz_defineMethod(c$,"removeAllElements", -function(){ -java.util.Arrays.fill(this.elementData,0,this.elementCount,null); -this.modCount++; -this.elementCount=0; -}); -Clazz_defineMethod(c$,"removeElement", -function(object){ -var index; -if((index=this.indexOf(object,0))==-1){ -return false; -}this.removeElementAt(index); -return true; -},"~O"); -Clazz_defineMethod(c$,"removeElementAt", -function(location){ -if(0<=location&&location0){ -System.arraycopy(this.elementData,location+1,this.elementData,location,size); -}this.elementData[this.elementCount]=null; -this.modCount++; -}else{ -throw new ArrayIndexOutOfBoundsException(location); -}},"~N"); -Clazz_overrideMethod(c$,"removeRange", -function(start,end){ -if(start>=0&&start<=end&&end<=this.size()){ -if(start==end){ -return; -}if(end!=this.elementCount){ -System.arraycopy(this.elementData,end,this.elementData,start,this.elementCount-end); -var newCount=this.elementCount-(end-start); -java.util.Arrays.fill(this.elementData,newCount,this.elementCount,null); -this.elementCount=newCount; -}else{ -java.util.Arrays.fill(this.elementData,start,this.elementCount,null); -this.elementCount=start; -}this.modCount++; -}else{ -throw new IndexOutOfBoundsException(); -}},"~N,~N"); -Clazz_overrideMethod(c$,"set", -function(location,object){ -if(locationlength){ -java.util.Arrays.fill(this.elementData,length,this.elementCount,null); -}this.elementCount=length; -this.modCount++; -},"~N"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.elementCount; -}); -Clazz_overrideMethod(c$,"subList", -function(start,end){ -return new java.util.Collections.SynchronizedRandomAccessList(Clazz_superCall(this,java.util.Vector,"subList",[start,end]),this); -},"~N,~N"); -Clazz_defineMethod(c$,"toArray", -function(){ -var result=new Array(this.elementCount); -System.arraycopy(this.elementData,0,result,0,this.elementCount); -return result; -}); -Clazz_defineMethod(c$,"toArray", -function(contents){ -if(this.elementCount>contents.length){ -var ct=contents.getClass().getComponentType(); -contents=java.lang.reflect.Array.newInstance(ct,this.elementCount); -}System.arraycopy(this.elementData,0,contents,0,this.elementCount); -if(this.elementCount 255) { -rangeError = true; -badComponentString = badComponentString + " Alpha"; -}if (r < 0 || r > 255) { -rangeError = true; -badComponentString = badComponentString + " Red"; -}if (g < 0 || g > 255) { -rangeError = true; -badComponentString = badComponentString + " Green"; -}if (b < 0 || b > 255) { -rangeError = true; -badComponentString = badComponentString + " Blue"; -}if (rangeError == true) { -throw new IllegalArgumentException ("Color parameter outside of expected range:" + badComponentString); -}}, "~N,~N,~N,~N"); -Clazz_makeConstructor (c$, -function () { -{ -var a = arguments; -switch(a.length) { -case 0: -break; -case 1: -this.value = (a[0].value ? a[0].value : 0xff000000 | a[0]); -break; -case 2: -this.value = (a[1] ? a[0] : 0xff000000 | a[0]); -break; -case 3: -this.setColor4(a[0], a[1], a[2], 255); -break; -case 4: -this.setColor4(a[0], a[1], a[2], a[3]); -break; -} -return this; -}}); -Clazz_defineMethod (c$, "setColor4", - function (r, g, b, a) { -this.value = ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | ((b & 0xFF) << 0); -java.awt.Color.testColorValueRange (r, g, b, a); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setFloat", - function (r, g, b, f) { -this.setColor4 (Clazz_doubleToInt (r * 255 + 0.5), Clazz_doubleToInt (g * 255 + 0.5), Clazz_doubleToInt (b * 255 + 0.5), Clazz_doubleToInt (f * 255 + 0.5)); -this.frgbvalue = Clazz_newFloatArray (3, 0); -this.frgbvalue[0] = r; -this.frgbvalue[1] = g; -this.frgbvalue[2] = b; -this.falpha = f; -}, "~N,~N,~N,~N"); -c$.getColorF4 = Clazz_defineMethod (c$, "getColorF4", -function (r, g, b, a) { -var c = new java.awt.Color (); -c.setFloat (r, g, b, a); -return c; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getRed", -function () { -return (this.getRGB () >> 16) & 0xFF; -}); -Clazz_defineMethod (c$, "getGreen", -function () { -return (this.getRGB () >> 8) & 0xFF; -}); -Clazz_defineMethod (c$, "getBlue", -function () { -return (this.getRGB () >> 0) & 0xFF; -}); -Clazz_defineMethod (c$, "getAlpha", -function () { -return (this.getRGB () >> 24) & 0xff; -}); -Clazz_defineMethod (c$, "getRGB", -function () { -return this.value; -}); -Clazz_defineMethod (c$, "brighter", -function () { -var r = this.getRed (); -var g = this.getGreen (); -var b = this.getBlue (); -var i = Clazz_doubleToInt (3.333333333333333); -if (r == 0 && g == 0 && b == 0) { -return new java.awt.Color (i, i, i); -}if (r > 0 && r < i) r = i; -if (g > 0 && g < i) g = i; -if (b > 0 && b < i) b = i; -return new java.awt.Color (Math.min (Clazz_doubleToInt (r / 0.7), 255), Math.min (Clazz_doubleToInt (g / 0.7), 255), Math.min (Clazz_doubleToInt (b / 0.7), 255)); -}); -Clazz_defineMethod (c$, "darker", -function () { -return new java.awt.Color (Math.max (Clazz_doubleToInt (this.getRed () * 0.7), 0), Math.max (Clazz_doubleToInt (this.getGreen () * 0.7), 0), Math.max (Clazz_doubleToInt (this.getBlue () * 0.7), 0)); -}); -Clazz_overrideMethod (c$, "hashCode", -function () { -return this.value; -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -return Clazz_instanceOf (obj, java.awt.Color) && (obj).getRGB () == this.getRGB (); -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[r=" + this.getRed () + ",g=" + this.getGreen () + ",b=" + this.getBlue () + "]"; -}); -c$.decode = Clazz_defineMethod (c$, "decode", -function (nm) { -var intval = Integer.decode (nm); -var i = intval.intValue (); -return new java.awt.Color ((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); -}, "~S"); -c$.getColor = Clazz_defineMethod (c$, "getColor", -function (nm) { -return java.awt.Color.getColor (nm, null); -}, "~S"); -c$.getColor = Clazz_defineMethod (c$, "getColor", -function (nm, v) { -var intval = Integer.getInteger (nm); -if (intval == null) { -return v; -}var i = intval.intValue (); -return new java.awt.Color ((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); -}, "~S,java.awt.Color"); -c$.getColor = Clazz_defineMethod (c$, "getColor", -function (nm, v) { -var intval = Integer.getInteger (nm); -var i = (intval != null) ? intval.intValue () : v; -return new java.awt.Color ((i >> 16) & 0xFF, (i >> 8) & 0xFF, (i >> 0) & 0xFF); -}, "~S,~N"); -c$.HSBtoRGB = Clazz_defineMethod (c$, "HSBtoRGB", -function (hue, saturation, brightness) { -var r = 0; -var g = 0; -var b = 0; -if (saturation == 0) { -r = g = b = Clazz_floatToInt (brightness * 255.0 + 0.5); -} else { -var h = (hue - Math.floor (hue)) * 6.0; -var f = h - java.lang.Math.floor (h); -var p = brightness * (1.0 - saturation); -var q = brightness * (1.0 - saturation * f); -var t = brightness * (1.0 - (saturation * (1.0 - f))); -switch (Clazz_floatToInt (h)) { -case 0: -r = Clazz_floatToInt (brightness * 255.0 + 0.5); -g = Clazz_floatToInt (t * 255.0 + 0.5); -b = Clazz_floatToInt (p * 255.0 + 0.5); -break; -case 1: -r = Clazz_floatToInt (q * 255.0 + 0.5); -g = Clazz_floatToInt (brightness * 255.0 + 0.5); -b = Clazz_floatToInt (p * 255.0 + 0.5); -break; -case 2: -r = Clazz_floatToInt (p * 255.0 + 0.5); -g = Clazz_floatToInt (brightness * 255.0 + 0.5); -b = Clazz_floatToInt (t * 255.0 + 0.5); -break; -case 3: -r = Clazz_floatToInt (p * 255.0 + 0.5); -g = Clazz_floatToInt (q * 255.0 + 0.5); -b = Clazz_floatToInt (brightness * 255.0 + 0.5); -break; -case 4: -r = Clazz_floatToInt (t * 255.0 + 0.5); -g = Clazz_floatToInt (p * 255.0 + 0.5); -b = Clazz_floatToInt (brightness * 255.0 + 0.5); -break; -case 5: -r = Clazz_floatToInt (brightness * 255.0 + 0.5); -g = Clazz_floatToInt (p * 255.0 + 0.5); -b = Clazz_floatToInt (q * 255.0 + 0.5); -break; -} -}return 0xff000000 | (r << 16) | (g << 8) | (b << 0); -}, "~N,~N,~N"); -c$.RGBtoHSB = Clazz_defineMethod (c$, "RGBtoHSB", -function (r, g, b, hsbvals) { -var hue; -var saturation; -var brightness; -if (hsbvals == null) { -hsbvals = Clazz_newFloatArray (3, 0); -}var cmax = (r > g) ? r : g; -if (b > cmax) cmax = b; -var cmin = (r < g) ? r : g; -if (b < cmin) cmin = b; -brightness = (cmax) / 255.0; -if (cmax != 0) saturation = ((cmax - cmin)) / (cmax); - else saturation = 0; -if (saturation == 0) hue = 0; - else { -var redc = ((cmax - r)) / ((cmax - cmin)); -var greenc = ((cmax - g)) / ((cmax - cmin)); -var bluec = ((cmax - b)) / ((cmax - cmin)); -if (r == cmax) hue = bluec - greenc; - else if (g == cmax) hue = 2.0 + redc - bluec; - else hue = 4.0 + greenc - redc; -hue = hue / 6.0; -if (hue < 0) hue = hue + 1.0; -}hsbvals[0] = hue; -hsbvals[1] = saturation; -hsbvals[2] = brightness; -return hsbvals; -}, "~N,~N,~N,~A"); -c$.getHSBColor = Clazz_defineMethod (c$, "getHSBColor", -function (h, s, b) { -return new java.awt.Color (java.awt.Color.HSBtoRGB (h, s, b)); -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "getRGBComponents", -function (compArray) { -var f; -if (compArray == null) { -f = Clazz_newFloatArray (4, 0); -} else { -f = compArray; -}if (this.frgbvalue == null) { -f[0] = (this.getRed ()) / 255; -f[1] = (this.getGreen ()) / 255; -f[2] = (this.getBlue ()) / 255; -f[3] = (this.getAlpha ()) / 255; -} else { -f[0] = this.frgbvalue[0]; -f[1] = this.frgbvalue[1]; -f[2] = this.frgbvalue[2]; -f[3] = this.falpha; -}return f; -}, "~A"); -Clazz_defineMethod (c$, "getRGBColorComponents", -function (compArray) { -var f; -if (compArray == null) { -f = Clazz_newFloatArray (3, 0); -} else { -f = compArray; -}if (this.frgbvalue == null) { -f[0] = (this.getRed ()) / 255; -f[1] = (this.getGreen ()) / 255; -f[2] = (this.getBlue ()) / 255; -} else { -f[0] = this.frgbvalue[0]; -f[1] = this.frgbvalue[1]; -f[2] = this.frgbvalue[2]; -}return f; -}, "~A"); -Clazz_overrideMethod (c$, "createContext", -function (cm, r, r2d, xform, hints) { -if (this.context == null || this.context.getRGB () != this.getRGB ()) { -this.context = new java.awt.ColorPaintContext (this.getRGB (), cm); -}return this.context; -}, "java.awt.image.ColorModel,java.awt.Rectangle,java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform,java.awt.RenderingHints"); -Clazz_overrideMethod (c$, "getTransparency", -function () { -var alpha = this.getAlpha (); -if (alpha == 0xff) { -return 1; -} else if (alpha == 0) { -return 2; -} else { -return 3; -}}); -c$.white = c$.prototype.white = new java.awt.Color (255, 255, 255); -c$.WHITE = c$.prototype.WHITE = java.awt.Color.white; -c$.lightGray = c$.prototype.lightGray = new java.awt.Color (192, 192, 192); -c$.LIGHT_GRAY = c$.prototype.LIGHT_GRAY = java.awt.Color.lightGray; -c$.gray = c$.prototype.gray = new java.awt.Color (128, 128, 128); -c$.GRAY = c$.prototype.GRAY = java.awt.Color.gray; -c$.darkGray = c$.prototype.darkGray = new java.awt.Color (64, 64, 64); -c$.DARK_GRAY = c$.prototype.DARK_GRAY = java.awt.Color.darkGray; -c$.black = c$.prototype.black = new java.awt.Color (0, 0, 0); -c$.BLACK = c$.prototype.BLACK = java.awt.Color.black; -c$.red = c$.prototype.red = new java.awt.Color (255, 0, 0); -c$.RED = c$.prototype.RED = java.awt.Color.red; -c$.pink = c$.prototype.pink = new java.awt.Color (255, 175, 175); -c$.PINK = c$.prototype.PINK = java.awt.Color.pink; -c$.orange = c$.prototype.orange = new java.awt.Color (255, 200, 0); -c$.ORANGE = c$.prototype.ORANGE = java.awt.Color.orange; -c$.yellow = c$.prototype.yellow = new java.awt.Color (255, 255, 0); -c$.YELLOW = c$.prototype.YELLOW = java.awt.Color.yellow; -c$.green = c$.prototype.green = new java.awt.Color (0, 255, 0); -c$.GREEN = c$.prototype.GREEN = java.awt.Color.green; -c$.magenta = c$.prototype.magenta = new java.awt.Color (255, 0, 255); -c$.MAGENTA = c$.prototype.MAGENTA = java.awt.Color.magenta; -c$.cyan = c$.prototype.cyan = new java.awt.Color (0, 255, 255); -c$.CYAN = c$.prototype.CYAN = java.awt.Color.cyan; -c$.blue = c$.prototype.blue = new java.awt.Color (0, 0, 255); -c$.BLUE = c$.prototype.BLUE = java.awt.Color.blue; -Clazz_defineStatics (c$, -"FACTOR", 0.7); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.Transparency"], "java.awt.Paint", null, function () { -Clazz_declareInterface (java.awt, "Paint", java.awt.Transparency); -}); -Clazz_declarePackage ("java.awt"); -c$ = Clazz_declareInterface (java.awt, "Transparency"); -Clazz_defineStatics (c$, -"OPAQUE", 1, -"BITMASK", 2, -"TRANSLUCENT", 3); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.PaintContext"], "java.awt.ColorPaintContext", ["java.awt.image.ColorModel"], function () { -c$ = Clazz_decorateAsClass (function () { -this.color = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "ColorPaintContext", null, java.awt.PaintContext); -Clazz_makeConstructor (c$, -function (color, cm) { -this.color = color; -}, "~N,java.awt.image.ColorModel"); -Clazz_overrideMethod (c$, "dispose", -function () { -}); -Clazz_defineMethod (c$, "getRGB", -function () { -return this.color; -}); -Clazz_overrideMethod (c$, "getColorModel", -function () { -return java.awt.image.ColorModel.getRGBdefault (); -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "PaintContext"); -Clazz_declarePackage ("java.awt.image"); -Clazz_load (["java.awt.Transparency", "java.awt.color.ColorSpace"], "java.awt.image.ColorModel", ["java.lang.IllegalArgumentException", "$.NullPointerException", "$.UnsupportedOperationException", "JU.AU"], function () { -c$ = Clazz_decorateAsClass (function () { -this.pixel_bits = 0; -this.nBits = null; -this.transparency = 3; -this.supportsAlpha = true; -this.$isAlphaPremultiplied = false; -this.numComponents = -1; -this.numColorComponents = -1; -this.colorSpace = null; -this.colorSpaceType = 5; -this.maxBits = 0; -this.is_sRGB = true; -this.transferType = 0; -Clazz_instantialize (this, arguments); -}, java.awt.image, "ColorModel", null, java.awt.Transparency); -Clazz_prepareFields (c$, function () { -this.colorSpace = java.awt.color.ColorSpace.getInstance (1000); -}); -c$.getRGBdefault = Clazz_defineMethod (c$, "getRGBdefault", -function () { -if (java.awt.image.ColorModel.RGBdefault == null) { -java.awt.image.ColorModel.RGBdefault = new java.awt.image.DirectColorModel (32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); -}return java.awt.image.ColorModel.RGBdefault; -}); -Clazz_makeConstructor (c$, -function (bits) { -this.pixel_bits = bits; -if (bits < 1) { -throw new IllegalArgumentException ("Number of bits must be > 0"); -}this.numComponents = 4; -this.numColorComponents = 3; -this.maxBits = bits; -this.transferType = java.awt.image.ColorModel.getDefaultTransferType (bits); -}, "~N"); -Clazz_makeConstructor (c$, -function (pixel_bits, bits, cspace, hasAlpha, isAlphaPremultiplied, transparency, transferType) { -this.colorSpace = cspace; -this.colorSpaceType = cspace.getType (); -this.numColorComponents = cspace.getNumComponents (); -this.numComponents = this.numColorComponents + (hasAlpha ? 1 : 0); -this.supportsAlpha = hasAlpha; -if (bits.length < this.numComponents) { -throw new IllegalArgumentException ("Number of color/alpha components should be " + this.numComponents + " but length of bits array is " + bits.length); -}if (transparency < 1 || transparency > 3) { -throw new IllegalArgumentException ("Unknown transparency: " + transparency); -}if (this.supportsAlpha == false) { -this.$isAlphaPremultiplied = false; -this.transparency = 1; -} else { -this.$isAlphaPremultiplied = isAlphaPremultiplied; -this.transparency = transparency; -}this.nBits = bits.clone (); -this.pixel_bits = pixel_bits; -if (pixel_bits <= 0) { -throw new IllegalArgumentException ("Number of pixel bits must be > 0"); -}this.maxBits = 0; -for (var i = 0; i < bits.length; i++) { -if (bits[i] < 0) { -throw new IllegalArgumentException ("Number of bits must be >= 0"); -}if (this.maxBits < bits[i]) { -this.maxBits = bits[i]; -}} -if (this.maxBits == 0) { -throw new IllegalArgumentException ("There must be at least one component with > 0 pixel bits."); -}if (cspace !== java.awt.color.ColorSpace.getInstance (1000)) { -this.is_sRGB = false; -}this.transferType = transferType; -}, "~N,~A,java.awt.color.ColorSpace,~B,~B,~N,~N"); -Clazz_defineMethod (c$, "hasAlpha", -function () { -return this.supportsAlpha; -}); -Clazz_defineMethod (c$, "isAlphaPremultiplied", -function () { -return this.$isAlphaPremultiplied; -}); -Clazz_defineMethod (c$, "getTransferType", -function () { -return this.transferType; -}); -Clazz_defineMethod (c$, "getPixelSize", -function () { -return this.pixel_bits; -}); -Clazz_defineMethod (c$, "getComponentSize", -function (componentIdx) { -if (this.nBits == null) { -throw new NullPointerException ("Number of bits array is null."); -}return this.nBits[componentIdx]; -}, "~N"); -Clazz_defineMethod (c$, "getComponentSize", -function () { -if (this.nBits != null) { -return this.nBits.clone (); -}return null; -}); -Clazz_overrideMethod (c$, "getTransparency", -function () { -return this.transparency; -}); -Clazz_defineMethod (c$, "getNumComponents", -function () { -return this.numComponents; -}); -Clazz_defineMethod (c$, "getNumColorComponents", -function () { -return this.numColorComponents; -}); -Clazz_defineMethod (c$, "getRGB", -function (pixel) { -return (this.getAlpha (pixel) << 24) | (this.getRed (pixel) << 16) | (this.getGreen (pixel) << 8) | (this.getBlue (pixel) << 0); -}, "~N"); -Clazz_defineMethod (c$, "getRed", -function (inData) { -var pixel = 0; -var length = 0; -var idata = inData; -pixel = idata[0]; -length = idata.length; -if (length == 1) { -return this.getRed (pixel); -} else { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}}, "~O"); -Clazz_defineMethod (c$, "getGreen", -function (inData) { -var pixel = 0; -var length = 0; -var idata = inData; -pixel = idata[0]; -length = idata.length; -if (length == 1) { -return this.getGreen (pixel); -} else { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}}, "~O"); -Clazz_defineMethod (c$, "getBlue", -function (inData) { -var pixel = 0; -var length = 0; -var idata = inData; -pixel = idata[0]; -length = idata.length; -if (length == 1) { -return this.getBlue (pixel); -} else { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}}, "~O"); -Clazz_defineMethod (c$, "getAlpha", -function (inData) { -var pixel = 0; -var length = 0; -var idata = inData; -pixel = idata[0]; -length = idata.length; -if (length == 1) { -return this.getAlpha (pixel); -} else { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}}, "~O"); -Clazz_defineMethod (c$, "getRGB", -function (inData) { -return (this.getAlpha (inData) << 24) | (this.getRed (inData) << 16) | (this.getGreen (inData) << 8) | (this.getBlue (inData) << 0); -}, "~O"); -Clazz_defineMethod (c$, "getDataElements", -function (rgb, pixel) { -throw new UnsupportedOperationException ("This method is not supported by this color model."); -}, "~N,~O"); -Clazz_defineMethod (c$, "getComponents", -function (pixel, components, offset) { -throw new UnsupportedOperationException ("This method is not supported by this color model."); -}, "~N,~A,~N"); -Clazz_defineMethod (c$, "getComponents", -function (pixel, components, offset) { -throw new UnsupportedOperationException ("This method is not supported by this color model."); -}, "~O,~A,~N"); -Clazz_defineMethod (c$, "getUnnormalizedComponents", -function (normComponents, normOffset, components, offset) { -if (this.colorSpace == null) { -throw new UnsupportedOperationException ("This method is not supported by this color model."); -}if (this.nBits == null) { -throw new UnsupportedOperationException ("This method is not supported. Unable to determine #bits per component."); -}if ((normComponents.length - normOffset) < this.numComponents) { -throw new IllegalArgumentException ("Incorrect number of components. Expecting " + this.numComponents); -}if (components == null) { -components = Clazz_newIntArray (offset + this.numComponents, 0); -}if (this.supportsAlpha && this.$isAlphaPremultiplied) { -var normAlpha = normComponents[normOffset + this.numColorComponents]; -for (var i = 0; i < this.numColorComponents; i++) { -components[offset + i] = Clazz_floatToInt (normComponents[normOffset + i] * ((1 << this.nBits[i]) - 1) * normAlpha + 0.5); -} -components[offset + this.numColorComponents] = Clazz_floatToInt (normAlpha * ((1 << this.nBits[this.numColorComponents]) - 1) + 0.5); -} else { -for (var i = 0; i < this.numComponents; i++) { -components[offset + i] = Clazz_floatToInt (normComponents[normOffset + i] * ((1 << this.nBits[i]) - 1) + 0.5); -} -}return components; -}, "~A,~N,~A,~N"); -Clazz_defineMethod (c$, "getNormalizedComponents", -function (components, offset, normComponents, normOffset) { -if (this.colorSpace == null) { -throw new UnsupportedOperationException ("This method is not supported by this color model."); -}if (this.nBits == null) { -throw new UnsupportedOperationException ("This method is not supported. Unable to determine #bits per component."); -}if ((components.length - offset) < this.numComponents) { -throw new IllegalArgumentException ("Incorrect number of components. Expecting " + this.numComponents); -}if (normComponents == null) { -normComponents = Clazz_newFloatArray (this.numComponents + normOffset, 0); -}if (this.supportsAlpha && this.$isAlphaPremultiplied) { -var normAlpha = components[offset + this.numColorComponents]; -normAlpha /= ((1 << this.nBits[this.numColorComponents]) - 1); -if (normAlpha != 0.0) { -for (var i = 0; i < this.numColorComponents; i++) { -normComponents[normOffset + i] = (components[offset + i]) / (normAlpha * (((1 << this.nBits[i]) - 1))); -} -} else { -for (var i = 0; i < this.numColorComponents; i++) { -normComponents[normOffset + i] = 0.0; -} -}normComponents[normOffset + this.numColorComponents] = normAlpha; -} else { -for (var i = 0; i < this.numComponents; i++) { -normComponents[normOffset + i] = (components[offset + i]) / (((1 << this.nBits[i]) - 1)); -} -}return normComponents; -}, "~A,~N,~A,~N"); -Clazz_defineMethod (c$, "getDataElement", -function (components, offset) { -return this.getDataElementInt (components, offset); -}, "~A,~N"); -Clazz_defineMethod (c$, "getDataElementInt", -function (components, offset) { -throw new UnsupportedOperationException ("This method is not supported by this color model."); -}, "~A,~N"); -Clazz_defineMethod (c$, "getDataElement", -function (normComponents, normOffset) { -if (JU.AU.isAI (normComponents)) { -var ints = normComponents; -return this.getDataElementInt (ints, normOffset); -}var components = this.getUnnormalizedComponents (normComponents, normOffset, null, 0); -return this.getDataElement (components, 0); -}, "~A,~N"); -Clazz_defineMethod (c$, "getDataElements", -function (normComponents, normOffset, obj) { -var components = this.getUnnormalizedComponents (normComponents, normOffset, null, 0); -return this.getDataElements (components, 0, obj); -}, "~A,~N,~O"); -Clazz_defineMethod (c$, "getNormalizedComponents", -function (pixel, normComponents, normOffset) { -var components = this.getComponents (pixel, null, 0); -return this.getNormalizedComponents (components, 0, normComponents, normOffset); -}, "~O,~A,~N"); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (!(Clazz_instanceOf (obj, java.awt.image.ColorModel))) { -return false; -}var cm = obj; -if (this === cm) { -return true; -}if (this.supportsAlpha != cm.hasAlpha () || this.$isAlphaPremultiplied != cm.isAlphaPremultiplied () || this.pixel_bits != cm.getPixelSize () || this.transparency != cm.getTransparency () || this.numComponents != cm.getNumComponents ()) { -return false; -}var nb = cm.getComponentSize (); -if ((this.nBits != null) && (nb != null)) { -for (var i = 0; i < this.numComponents; i++) { -if (this.nBits[i] != nb[i]) { -return false; -}} -} else { -return ((this.nBits == null) && (nb == null)); -}return true; -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -var result = 0; -result = (this.supportsAlpha ? 2 : 3) + (this.$isAlphaPremultiplied ? 4 : 5) + this.pixel_bits * 6 + this.transparency * 7 + this.numComponents * 8; -if (this.nBits != null) { -for (var i = 0; i < this.numComponents; i++) { -result = result + this.nBits[i] * (i + 9); -} -}return result; -}); -Clazz_defineMethod (c$, "getColorSpace", -function () { -return this.colorSpace; -}); -Clazz_defineMethod (c$, "isCompatibleRaster", -function (raster) { -throw new UnsupportedOperationException ("This method has not been implemented for this ColorModel."); -}, "java.awt.image.Raster"); -Clazz_defineMethod (c$, "createCompatibleWritableRaster", -function (w, h) { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}, "~N,~N"); -Clazz_defineMethod (c$, "createCompatibleSampleModel", -function (w, h) { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}, "~N,~N"); -Clazz_defineMethod (c$, "isCompatibleSampleModel", -function (sm) { -throw new UnsupportedOperationException ("This method is not supported by this color model"); -}, "java.awt.image.SampleModel"); -Clazz_overrideMethod (c$, "finalize", -function () { -}); -Clazz_defineMethod (c$, "getAlphaRaster", -function (raster) { -return null; -}, "java.awt.image.WritableRaster"); -Clazz_overrideMethod (c$, "toString", -function () { -return String.instantialize ("ColorModel: #pixelBits = " + this.pixel_bits + " numComponents = " + this.numComponents + " color space = " + this.colorSpace + " transparency = " + this.transparency + " has alpha = " + this.supportsAlpha + " isAlphaPre = " + this.$isAlphaPremultiplied); -}); -c$.getDefaultTransferType = Clazz_defineMethod (c$, "getDefaultTransferType", -function (pixel_bits) { -if (pixel_bits <= 8) { -return 0; -}return 3; -}, "~N"); -c$.isLinearRGBspace = Clazz_defineMethod (c$, "isLinearRGBspace", -function (cs) { -return false; -}, "java.awt.color.ColorSpace"); -c$.isLinearGRAYspace = Clazz_defineMethod (c$, "isLinearGRAYspace", -function (cs) { -return false; -}, "java.awt.color.ColorSpace"); -Clazz_defineStatics (c$, -"RGBdefault", null, -"l8Tos8", null, -"s8Tol8", null, -"l16Tos8", null, -"s8Tol16", null, -"g8Tos8Map", null, -"lg16Toog8Map", null, -"g16Tos8Map", null, -"lg16Toog16Map", null); -}); -Clazz_declarePackage ("java.awt.color"); -Clazz_load (null, "java.awt.color.ColorSpace", ["java.lang.IllegalArgumentException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.type = 0; -this.numComponents = 0; -this.compName = null; -Clazz_instantialize (this, arguments); -}, java.awt.color, "ColorSpace"); -Clazz_makeConstructor (c$, -function (type, numcomponents) { -this.type = type; -this.numComponents = numcomponents; -}, "~N,~N"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function (colorspace) { -var theColorSpace; -switch (colorspace) { -default: -case 1000: -if (java.awt.color.ColorSpace.sRGBspace == null) { -java.awt.color.ColorSpace.sRGBspace = new java.awt.color.ColorSpace (5, 3); -}theColorSpace = java.awt.color.ColorSpace.sRGBspace; -break; -} -return theColorSpace; -}, "~N"); -Clazz_defineMethod (c$, "isCS_sRGB", -function () { -return (this === java.awt.color.ColorSpace.sRGBspace); -}); -Clazz_defineMethod (c$, "toRGB", -function (colorvalue) { -return colorvalue; -}, "~A"); -Clazz_defineMethod (c$, "fromRGB", -function (rgbvalue) { -return rgbvalue; -}, "~A"); -Clazz_defineMethod (c$, "getType", -function () { -return this.type; -}); -Clazz_defineMethod (c$, "getNumComponents", -function () { -return this.numComponents; -}); -Clazz_defineMethod (c$, "getName", -function (idx) { -if ((idx < 0) || (idx > this.numComponents - 1)) { -throw new IllegalArgumentException ("Component index out of range: " + idx); -}if (this.compName == null) { -switch (this.type) { -case 0: -this.compName = Clazz_newArray (-1, ["X", "Y", "Z"]); -break; -case 1: -this.compName = Clazz_newArray (-1, ["L", "a", "b"]); -break; -case 2: -this.compName = Clazz_newArray (-1, ["L", "u", "v"]); -break; -case 3: -this.compName = Clazz_newArray (-1, ["Y", "Cb", "Cr"]); -break; -case 4: -this.compName = Clazz_newArray (-1, ["Y", "x", "y"]); -break; -case 5: -this.compName = Clazz_newArray (-1, ["Red", "Green", "Blue"]); -break; -case 6: -this.compName = Clazz_newArray (-1, ["Gray"]); -break; -case 7: -this.compName = Clazz_newArray (-1, ["Hue", "Saturation", "Value"]); -break; -case 8: -this.compName = Clazz_newArray (-1, ["Hue", "Lightness", "Saturation"]); -break; -case 9: -this.compName = Clazz_newArray (-1, ["Cyan", "Magenta", "Yellow", "Black"]); -break; -case 11: -this.compName = Clazz_newArray (-1, ["Cyan", "Magenta", "Yellow"]); -break; -default: -var tmp = new Array (this.numComponents); -for (var i = 0; i < tmp.length; i++) { -tmp[i] = "Unnamed color component(" + i + ")"; -} -this.compName = tmp; -} -}return this.compName[idx]; -}, "~N"); -Clazz_defineMethod (c$, "getMinValue", -function (component) { -if ((component < 0) || (component > this.numComponents - 1)) { -throw new IllegalArgumentException ("Component index out of range: " + component); -}return 0.0; -}, "~N"); -Clazz_defineMethod (c$, "getMaxValue", -function (component) { -if ((component < 0) || (component > this.numComponents - 1)) { -throw new IllegalArgumentException ("Component index out of range: " + component); -}return 1.0; -}, "~N"); -Clazz_defineStatics (c$, -"sRGBspace", null, -"TYPE_XYZ", 0, -"TYPE_Lab", 1, -"TYPE_Luv", 2, -"TYPE_YCbCr", 3, -"TYPE_Yxy", 4, -"TYPE_RGB", 5, -"TYPE_GRAY", 6, -"TYPE_HSV", 7, -"TYPE_HLS", 8, -"TYPE_CMYK", 9, -"TYPE_CMY", 11, -"TYPE_2CLR", 12, -"TYPE_3CLR", 13, -"TYPE_4CLR", 14, -"TYPE_5CLR", 15, -"TYPE_6CLR", 16, -"TYPE_7CLR", 17, -"TYPE_8CLR", 18, -"TYPE_9CLR", 19, -"TYPE_ACLR", 20, -"TYPE_BCLR", 21, -"TYPE_CCLR", 22, -"TYPE_DCLR", 23, -"TYPE_ECLR", 24, -"TYPE_FCLR", 25, -"CS_sRGB", 1000, -"CS_LINEAR_RGB", 1004, -"CS_CIEXYZ", 1001, -"CS_PYCC", 1002, -"CS_GRAY", 1003); -}); -Clazz_declarePackage ("java.util"); -Clazz_load (["java.util.Arrays", "$.Collections", "$.HashMap"], "java.util.ResourceBundle", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "java.lang.ClassNotFoundException", "$.IllegalArgumentException", "$.InternalError", "$.InterruptedException", "$.NullPointerException", "$.StringBuilder", "$.Thread", "java.util.ArrayList", "$.HashSet", "java.util.Locale", "$.MissingResourceException", "swingjs.JSToolkit", "swingjs.api.Interface"], function () { -c$ = Clazz_decorateAsClass (function () { -this.parent = null; -this.locale = null; -this.expired = false; -this.$keySet = null; -Clazz_instantialize (this, arguments); -}, java.util, "ResourceBundle"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "getString", -function (key) { -return this.getObject (key); -}, "~S"); -Clazz_defineMethod (c$, "getStringArray", -function (key) { -return this.getObject (key); -}, "~S"); -Clazz_defineMethod (c$, "getObject", -function (key) { -var obj = this.handleGetObject (key); -if (obj == null) { -if (this.parent != null) { -obj = this.parent.getObject (key); -}if (obj == null) throw new java.util.MissingResourceException ("Can't find resource for bundle " + this.getClass ().getName () + ", key " + key, this.getClass ().getName (), key); -}return obj; -}, "~S"); -Clazz_defineMethod (c$, "getLocale", -function () { -return this.locale; -}); -Clazz_defineMethod (c$, "setParent", -function (parent) { -this.parent = parent; -}, "java.util.ResourceBundle"); -c$.getBundle = Clazz_defineMethod (c$, "getBundle", -function (baseName, targetLocale, loader, control) { -var n = 4; -{ -n = arguments.length; -}switch (n) { -case 2: -if ((Clazz_instanceOf (targetLocale, java.util.ResourceBundle.Control))) { -control = targetLocale; -targetLocale = null; -}break; -case 3: -if ((Clazz_instanceOf (loader, java.util.ResourceBundle.Control))) { -control = loader; -loader = null; -}break; -} -if (targetLocale == null) targetLocale = java.util.Locale.getDefault (); -if (control == null) control = java.util.ResourceBundle.Control.getControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); -return java.util.ResourceBundle.getBundleImpl (baseName, targetLocale, loader, control); -}, "~S,~O,~O,java.util.ResourceBundle.Control"); -c$.getBundleImpl = Clazz_defineMethod (c$, "getBundleImpl", - function (baseName, locale, loader, control) { -if (control == null) { -throw new NullPointerException ("ResourceBundle locale or control is null"); -}var cacheKey = new java.util.ResourceBundle.CacheKey (baseName, locale, loader); -var bundle = null; -var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); -if (bundleRef != null) { -bundle = bundleRef; -bundleRef = null; -}if (java.util.ResourceBundle.isValidBundle (bundle)) { -return bundle; -}var formats = control.getFormats (baseName); -var baseBundle = null; -for (var targetLocale = locale; targetLocale != null; targetLocale = control.getFallbackLocale (baseName, targetLocale)) { -var candidateLocales = control.getCandidateLocales (baseName, targetLocale); -bundle = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, 0, control, baseBundle); -if (java.util.ResourceBundle.isValidBundle (bundle)) { -var isBaseBundle = java.util.Locale.ROOT.equals (bundle.locale); -if (!isBaseBundle || bundle.locale.equals (locale) || (candidateLocales.size () == 1 && bundle.locale.equals (candidateLocales.get (0)))) { -break; -}if (isBaseBundle && baseBundle == null) { -baseBundle = bundle; -}}} -if (bundle == null) { -if (baseBundle == null) { -java.util.ResourceBundle.throwMissingResourceException (baseName, locale, cacheKey.getCause ()); -}bundle = baseBundle; -}return bundle; -}, "~S,java.util.Locale,~O,java.util.ResourceBundle.Control"); -c$.findBundle = Clazz_defineMethod (c$, "findBundle", - function (cacheKey, candidateLocales, formats, index, control, baseBundle) { -var targetLocale = candidateLocales.get (index); -var parent = null; -if (index != candidateLocales.size () - 1) { -parent = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, index + 1, control, baseBundle); -} else if (baseBundle != null && java.util.Locale.ROOT.equals (targetLocale)) { -return baseBundle; -}var expiredBundle = false; -cacheKey.setLocale (targetLocale); -var bundle = java.util.ResourceBundle.findBundleInCache (cacheKey, control); -if (java.util.ResourceBundle.isValidBundle (bundle)) { -expiredBundle = bundle.expired; -if (!expiredBundle) { -if (bundle.parent === parent) { -return bundle; -}var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); -if (bundleRef != null && bundleRef === bundle) { -java.util.ResourceBundle.cacheList.remove (cacheKey); -}}}if (bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE) { -var constKey = cacheKey.clone (); -try { -try { -bundle = java.util.ResourceBundle.loadBundle (cacheKey, formats, control, expiredBundle); -if (bundle != null) { -if (bundle.parent == null) { -bundle.setParent (parent); -}bundle.locale = targetLocale; -bundle = java.util.ResourceBundle.putBundleInCache (cacheKey, bundle, control); -return bundle; -}java.util.ResourceBundle.putBundleInCache (cacheKey, java.util.ResourceBundle.NONEXISTENT_BUNDLE, control); -} finally { -} -} finally { -if (Clazz_instanceOf (constKey.getCause (), InterruptedException)) { -Thread.currentThread ().interrupt (); -}} -}return parent; -}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.List,~N,java.util.ResourceBundle.Control,java.util.ResourceBundle"); -c$.loadBundle = Clazz_defineMethod (c$, "loadBundle", - function (cacheKey, formats, control, reload) { -var targetLocale = cacheKey.getLocale (); -var bundle = null; -var size = formats.size (); -for (var i = 0; i < size; i++) { -var format = formats.get (i); -try { -bundle = control.newBundle (cacheKey.getName (), targetLocale, format, null, reload); -} catch (e$$) { -if (Clazz_exceptionOf (e$$, LinkageError)) { -var error = e$$; -{ -cacheKey.setCause (error); -} -} else if (Clazz_exceptionOf (e$$, Exception)) { -var cause = e$$; -{ -cacheKey.setCause (cause); -} -} else { -throw e$$; -} -} -if (bundle != null) { -cacheKey.setFormat (format); -bundle.locale = targetLocale; -bundle.expired = false; -break; -}} -return bundle; -}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.ResourceBundle.Control,~B"); -c$.isValidBundle = Clazz_defineMethod (c$, "isValidBundle", - function (bundle) { -return bundle != null && bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE; -}, "java.util.ResourceBundle"); -c$.throwMissingResourceException = Clazz_defineMethod (c$, "throwMissingResourceException", - function (baseName, locale, cause) { -if (Clazz_instanceOf (cause, java.util.MissingResourceException)) { -cause = null; -}throw new java.util.MissingResourceException ("Can't find bundle for base name " + baseName + ", locale " + locale, baseName + "_" + locale, "", cause); -}, "~S,java.util.Locale,Throwable"); -c$.findBundleInCache = Clazz_defineMethod (c$, "findBundleInCache", - function (cacheKey, control) { -var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); -if (bundleRef == null) { -return null; -}var bundle = bundleRef; -return bundle; -}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle.Control"); -c$.putBundleInCache = Clazz_defineMethod (c$, "putBundleInCache", - function (cacheKey, bundle, control) { -var key = cacheKey.clone (); -java.util.ResourceBundle.cacheList.put (key, bundle); -return bundle; -}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle,java.util.ResourceBundle.Control"); -c$.clearCache = Clazz_defineMethod (c$, "clearCache", -function () { -java.util.ResourceBundle.cacheList.clear (); -}); -Clazz_defineMethod (c$, "containsKey", -function (key) { -if (key == null) { -throw new NullPointerException (); -}for (var rb = this; rb != null; rb = rb.parent) { -if (rb.handleKeySet ().contains (key)) { -return true; -}} -return false; -}, "~S"); -Clazz_defineMethod (c$, "keySet", -function () { -var keys = new java.util.HashSet (); -for (var rb = this; rb != null; rb = rb.parent) { -keys.addAll (rb.handleKeySet ()); -} -return keys; -}); -Clazz_defineMethod (c$, "handleKeySet", -function () { -if (this.$keySet == null) { -{ -if (this.$keySet == null) { -var keys = new java.util.HashSet (); -var enumKeys = this.getKeys (); -while (enumKeys.hasMoreElements ()) { -var key = enumKeys.nextElement (); -if (this.handleGetObject (key) != null) { -keys.add (key); -}} -this.$keySet = keys; -}}}return this.$keySet; -}); -c$.$ResourceBundle$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (java.util, "ResourceBundle$1", java.util.ResourceBundle); -Clazz_defineMethod (c$, "getKeys", -function () { -return null; -}); -Clazz_defineMethod (c$, "handleGetObject", -function (key) { -return null; -}, "~S"); -Clazz_overrideMethod (c$, "toString", -function () { -return "NONEXISTENT_BUNDLE"; -}); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.name = null; -this.locale = null; -this.format = null; -this.cause = null; -this.hashCodeCache = 0; -Clazz_instantialize (this, arguments); -}, java.util.ResourceBundle, "CacheKey", null, Cloneable); -Clazz_makeConstructor (c$, -function (a, b, c) { -this.name = a; -this.locale = b; -if (this.name != null) this.calculateHashCode (); -}, "~S,java.util.Locale,~O"); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getLocale", -function () { -return this.locale; -}); -Clazz_defineMethod (c$, "setLocale", -function (a) { -if (!this.locale.equals (a)) { -this.locale = a; -this.calculateHashCode (); -}return this; -}, "java.util.Locale"); -Clazz_overrideMethod (c$, "equals", -function (a) { -if (this === a) { -return true; -}try { -var b = a; -if (this.hashCodeCache != b.hashCodeCache) { -return false; -}if (!this.name.equals (b.name)) { -return false; -}if (!this.locale.equals (b.locale)) { -return false; -}return true; -} catch (e$$) { -if (Clazz_exceptionOf (e$$, NullPointerException)) { -var e = e$$; -{ -} -} else if (Clazz_exceptionOf (e$$, ClassCastException)) { -var e = e$$; -{ -} -} else { -throw e$$; -} -} -return false; -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -return this.hashCodeCache; -}); -Clazz_defineMethod (c$, "calculateHashCode", - function () { -this.hashCodeCache = this.name.hashCode () << 3; -this.hashCodeCache ^= this.locale.hashCode (); -}); -Clazz_defineMethod (c$, "clone", -function () { -try { -var a = Clazz_superCall (this, java.util.ResourceBundle.CacheKey, "clone", []); -a.cause = null; -return a; -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_defineMethod (c$, "setFormat", -function (a) { -this.format = a; -}, "~S"); -Clazz_defineMethod (c$, "setCause", - function (a) { -if (this.cause == null) { -this.cause = a; -} else { -if (Clazz_instanceOf (this.cause, ClassNotFoundException)) { -this.cause = a; -}}}, "Throwable"); -Clazz_defineMethod (c$, "getCause", - function () { -return this.cause; -}); -Clazz_overrideMethod (c$, "toString", -function () { -var a = this.locale.toString (); -if (a.length == 0) { -if (this.locale.getVariant ().length != 0) { -a = "__" + this.locale.getVariant (); -} else { -a = "\"\""; -}}return "CacheKey[" + this.name + ", lc=" + a + "(format=" + this.format + ")]"; -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.util.ResourceBundle, "Control"); -Clazz_makeConstructor (c$, -function () { -}); -c$.getControl = Clazz_defineMethod (c$, "getControl", -function (a) { -if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { -return java.util.ResourceBundle.SingleFormatControl.PROPERTIES_ONLY; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { -return java.util.ResourceBundle.SingleFormatControl.CLASS_ONLY; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { -return java.util.ResourceBundle.Control.INSTANCE; -}throw new IllegalArgumentException (); -}, "java.util.List"); -c$.getNoFallbackControl = Clazz_defineMethod (c$, "getNoFallbackControl", -function (a) { -if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { -return java.util.ResourceBundle.NoFallbackControl.NO_FALLBACK; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { -return java.util.ResourceBundle.NoFallbackControl.PROPERTIES_ONLY_NO_FALLBACK; -}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { -return java.util.ResourceBundle.NoFallbackControl.CLASS_ONLY_NO_FALLBACK; -}throw new IllegalArgumentException (); -}, "java.util.List"); -Clazz_defineMethod (c$, "getFormats", -function (a) { -if (a == null) { -throw new NullPointerException (); -}return java.util.ResourceBundle.Control.FORMAT_DEFAULT; -}, "~S"); -Clazz_defineMethod (c$, "getCandidateLocales", -function (a, b) { -if (a == null) { -throw new NullPointerException (); -}var c = b.getLanguage (); -var d = b.getCountry (); -var e = b.getVariant (); -var f = new java.util.ArrayList (4); -if (e.length > 0) { -f.add (b); -}if (d.length > 0) { -f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, d, "")); -}if (c.length > 0) { -f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, "", "")); -}f.add (java.util.Locale.ROOT); -return f; -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "getFallbackLocale", -function (a, b) { -if (a == null) { -throw new NullPointerException (); -}var c = java.util.Locale.getDefault (); -return b.equals (c) ? null : c; -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "newBundle", -function (a, b, c, d, e) { -var f = this.toBundleName (a, b); -var g = null; -if (c.equals ("java.class")) { -g = swingjs.api.Interface.getInstance (f, false); -} else if (c.equals ("java.properties")) { -var h = this.toResourceName0 (f, "properties"); -if (h == null) { -return null; -}var i = swingjs.JSToolkit.getJavaResource (h); -var j = null; -j = (i == null ? null : new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (i.getBytes ()))); -if (j != null) { -try { -g = this.newPropertyBundle (j); -} finally { -j.close (); -} -}} else { -throw new IllegalArgumentException ("unknown format: " + c); -}return g; -}, "~S,java.util.Locale,~S,~O,~B"); -Clazz_defineMethod (c$, "newPropertyBundle", - function (a) { -return (swingjs.api.Interface.getInstance ("java.util.PropertyResourceBundle", false)).setStream (a); -}, "java.io.InputStream"); -Clazz_defineMethod (c$, "getTimeToLive", -function (a, b) { -if (a == null || b == null) { -throw new NullPointerException (); -}return -2; -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "toBundleName", -function (a, b) { -if (b === java.util.Locale.ROOT) { -return a; -}var c = b.getLanguage (); -var d = b.getCountry (); -var e = b.getVariant (); -if (c === "" && d === "" && e === "") { -return a; -}var f = new StringBuilder (a); -f.append ('_'); -if (e !== "") { -f.append (c).append ('_').append (d).append ('_').append (e); -} else if (d !== "") { -f.append (c).append ('_').append (d); -} else { -f.append (c); -}return f.toString (); -}, "~S,java.util.Locale"); -Clazz_defineMethod (c$, "toResourceName", -function (a, b) { -var c = new StringBuilder (a.length + 1 + b.length); -c.append (a.$replace ('.', '/')).append ('.').append (b); -return c.toString (); -}, "~S,~S"); -Clazz_defineMethod (c$, "toResourceName0", - function (a, b) { -if (a.contains ("://")) { -return null; -} else { -return this.toResourceName (a, b); -}}, "~S,~S"); -c$.FORMAT_DEFAULT = c$.prototype.FORMAT_DEFAULT = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class", "java.properties"])); -c$.FORMAT_CLASS = c$.prototype.FORMAT_CLASS = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class"])); -c$.FORMAT_PROPERTIES = c$.prototype.FORMAT_PROPERTIES = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.properties"])); -Clazz_defineStatics (c$, -"TTL_DONT_CACHE", -1, -"TTL_NO_EXPIRATION_CONTROL", -2); -c$.INSTANCE = c$.prototype.INSTANCE = new java.util.ResourceBundle.Control (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.formats = null; -Clazz_instantialize (this, arguments); -}, java.util.ResourceBundle, "SingleFormatControl", java.util.ResourceBundle.Control); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.util.ResourceBundle.SingleFormatControl, []); -this.formats = a; -}, "java.util.List"); -Clazz_overrideMethod (c$, "getFormats", -function (a) { -if (a == null) { -throw new NullPointerException (); -}return this.formats; -}, "~S"); -c$.PROPERTIES_ONLY = c$.prototype.PROPERTIES_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); -c$.CLASS_ONLY = c$.prototype.CLASS_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_CLASS); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.util.ResourceBundle, "NoFallbackControl", java.util.ResourceBundle.SingleFormatControl); -Clazz_overrideMethod (c$, "getFallbackLocale", -function (a, b) { -if (a == null || b == null) { -throw new NullPointerException (); -}return null; -}, "~S,java.util.Locale"); -c$.NO_FALLBACK = c$.prototype.NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_DEFAULT); -c$.PROPERTIES_ONLY_NO_FALLBACK = c$.prototype.PROPERTIES_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); -c$.CLASS_ONLY_NO_FALLBACK = c$.prototype.CLASS_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_CLASS); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"INITIAL_CACHE_SIZE", 32); -c$.NONEXISTENT_BUNDLE = c$.prototype.NONEXISTENT_BUNDLE = ((Clazz_isClassDefined ("java.util.ResourceBundle$1") ? 0 : java.util.ResourceBundle.$ResourceBundle$1$ ()), Clazz_innerTypeInstance (java.util.ResourceBundle$1, this, null)); -c$.cacheList = c$.prototype.cacheList = new java.util.HashMap (32); -}); -Clazz_declarePackage ("java.applet"); -Clazz_load (["java.awt.Panel"], "java.applet.Applet", ["java.net.URL", "java.util.Locale"], function () { -c$ = Clazz_decorateAsClass (function () { -this.stub = null; -Clazz_instantialize (this, arguments); -}, java.applet, "Applet", java.awt.Panel); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.applet.Applet, []); -this.setPanel (); -}); -Clazz_defineMethod (c$, "setStub", -function (stub) { -this.stub = stub; -}, "java.applet.AppletStub"); -Clazz_defineMethod (c$, "isActive", -function () { -if (this.stub != null) { -return this.stub.isActive (); -} else { -return false; -}}); -Clazz_defineMethod (c$, "getDocumentBase", -function () { -return this.stub.getDocumentBase (); -}); -Clazz_defineMethod (c$, "getCodeBase", -function () { -return this.stub.getCodeBase (); -}); -Clazz_defineMethod (c$, "getParameter", -function (name) { -return this.stub.getParameter (name); -}, "~S"); -Clazz_defineMethod (c$, "getAppletContext", -function () { -return this.stub.getAppletContext (); -}); -Clazz_defineMethod (c$, "resize", -function (width, height) { -var d = this.size (); -if ((d.width != width) || (d.height != height)) { -Clazz_superCall (this, java.applet.Applet, "resize", [width, height]); -if (this.stub != null) { -this.stub.appletResize (width, height); -}}}, "~N,~N"); -Clazz_defineMethod (c$, "resize", -function (d) { -this.resize (d.width, d.height); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "showStatus", -function (msg) { -this.getAppletContext ().showStatus (msg); -}, "~S"); -Clazz_defineMethod (c$, "getImage", -function (url) { -return this.getAppletContext ().getImage (url); -}, "java.net.URL"); -Clazz_defineMethod (c$, "getImage", -function (url, name) { -try { -return this.getImage ( new java.net.URL (url, name)); -} catch (e) { -if (Clazz_exceptionOf (e, java.net.MalformedURLException)) { -return null; -} else { -throw e; -} -} -}, "java.net.URL,~S"); -Clazz_defineMethod (c$, "getAppletInfo", -function () { -return null; -}); -Clazz_defineMethod (c$, "getLocale", -function () { -var locale = Clazz_superCall (this, java.applet.Applet, "getLocale", []); -if (locale == null) { -return java.util.Locale.getDefault (); -}return locale; -}); -Clazz_defineMethod (c$, "getParameterInfo", -function () { -return null; -}); -Clazz_defineMethod (c$, "init", -function () { -}); -Clazz_defineMethod (c$, "start", -function () { -}); -Clazz_defineMethod (c$, "stop", -function () { -}); -Clazz_defineMethod (c$, "destroy", -function () { -}); -}); -Clazz_declarePackage ("java.net"); -Clazz_load (["java.util.Hashtable"], "java.net.URL", ["java.io.IOException", "java.lang.Character", "$.Error", "java.net.MalformedURLException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.protocol = null; -this.host = null; -this.port = -1; -this.file = null; -this.query = null; -this.authority = null; -this.path = null; -this.userInfo = null; -this.ref = null; -this.handler = null; -this.$hashCode = -1; -Clazz_instantialize (this, arguments); -}, java.net, "URL", null, java.io.Serializable); -Clazz_makeConstructor (c$, -function (context, spec, handler) { -{ -switch (arguments.length) { -case 1: -spec = context;context = handler = null; -break; -case 2: -handler = null; -break; -case 3: -if (context == null || Clazz_instanceOf(context, java.net.URL)) -break; -default: -alert("java.net.URL constructor format not supported"); -break; -} -context && context.valueOf && context.valueOf() == null && (context = null); -}var original = spec; -var i; -var limit; -var c; -var start = 0; -var newProtocol = null; -var aRef = false; -var isRelative = false; -try { -limit = spec.length; -while ((limit > 0) && (spec.charAt (limit - 1) <= ' ')) { -limit--; -} -while ((start < limit) && (spec.charAt (start) <= ' ')) { -start++; -} -if (spec.regionMatches (true, start, "url:", 0, 4)) { -start += 4; -}if (start < spec.length && spec.charAt (start) == '#') { -aRef = true; -}for (i = start; !aRef && (i < limit) && ((c = spec.charCodeAt (i)) != 47); i++) { -if (c == 58) { -var s = spec.substring (start, i).toLowerCase (); -if (this.isValidProtocol (s)) { -newProtocol = s; -start = i + 1; -}break; -}} -this.protocol = newProtocol; -if ((context != null) && ((newProtocol == null) || newProtocol.equalsIgnoreCase (context.protocol))) { -if (handler == null) { -handler = context.handler; -}if (context.path != null && context.path.startsWith ("/")) newProtocol = null; -if (newProtocol == null) { -this.protocol = context.protocol; -this.authority = context.authority; -this.userInfo = context.userInfo; -this.host = context.host; -this.port = context.port; -this.file = context.file; -this.path = context.path; -isRelative = true; -}}if (this.protocol == null) { -throw new java.net.MalformedURLException ("no protocol: " + original); -}if (handler == null && (handler = java.net.URL.getURLStreamHandler (this.protocol)) == null) { -throw new java.net.MalformedURLException ("unknown protocol: " + this.protocol); -}this.handler = handler; -i = spec.indexOf ('#', start); -if (i >= 0) { -this.ref = spec.substring (i + 1, limit); -limit = i; -}if (isRelative && start == limit) { -this.query = context.query; -if (this.ref == null) { -this.ref = context.ref; -}}handler.parseURL (this, spec, start, limit); -} catch (e$$) { -if (Clazz_exceptionOf (e$$, java.net.MalformedURLException)) { -var e = e$$; -{ -throw e; -} -} else if (Clazz_exceptionOf (e$$, Exception)) { -var e = e$$; -{ -var exception = new java.net.MalformedURLException (e.getMessage ()); -exception.initCause (e); -throw exception; -} -} else { -throw e$$; -} -} -}, "java.net.URL,~S,java.net.URLStreamHandler"); -Clazz_defineMethod (c$, "isValidProtocol", - function (protocol) { -var len = protocol.length; -if (len < 1) return false; -var c = protocol.charAt (0); -if (!Character.isLetter (c)) return false; -for (var i = 1; i < len; i++) { -c = protocol.charAt (i); -if (!Character.isLetterOrDigit (c) && c != '.' && c != '+' && c != '-') { -return false; -}} -return true; -}, "~S"); -Clazz_defineMethod (c$, "set5", -function (protocol, host, port, file, ref) { -{ -this.protocol = protocol; -this.host = host; -this.authority = port == -1 ? host : host + ":" + port; -this.port = port; -this.file = file; -this.ref = ref; -this.$hashCode = -1; -var q = file.lastIndexOf ('?'); -if (q != -1) { -this.query = file.substring (q + 1); -this.path = file.substring (0, q); -} else this.path = file; -}}, "~S,~S,~N,~S,~S"); -Clazz_defineMethod (c$, "set", -function (protocol, host, port, authority, userInfo, path, query, ref) { -{ -this.protocol = protocol; -this.host = host; -this.port = port; -this.file = query == null ? path : path + "?" + query; -this.userInfo = userInfo; -this.path = path; -this.ref = ref; -this.$hashCode = -1; -this.query = query; -this.authority = authority; -}}, "~S,~S,~N,~S,~S,~S,~S,~S"); -Clazz_defineMethod (c$, "getQuery", -function () { -return this.query; -}); -Clazz_defineMethod (c$, "getPath", -function () { -return this.path; -}); -Clazz_defineMethod (c$, "getUserInfo", -function () { -return this.userInfo; -}); -Clazz_defineMethod (c$, "getAuthority", -function () { -return this.authority; -}); -Clazz_defineMethod (c$, "getPort", -function () { -return this.port; -}); -Clazz_defineMethod (c$, "getDefaultPort", -function () { -return this.handler.getDefaultPort (); -}); -Clazz_defineMethod (c$, "getProtocol", -function () { -return this.protocol; -}); -Clazz_defineMethod (c$, "getHost", -function () { -return this.host; -}); -Clazz_defineMethod (c$, "getFile", -function () { -return this.file; -}); -Clazz_defineMethod (c$, "getRef", -function () { -return this.ref; -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (!(Clazz_instanceOf (obj, java.net.URL))) return false; -var u2 = obj; -return this.handler.equals2 (this, u2); -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -if (this.$hashCode != -1) return this.$hashCode; -this.$hashCode = this.handler.hashCode (this); -return this.$hashCode; -}); -Clazz_defineMethod (c$, "sameFile", -function (other) { -return this.handler.sameFile (this, other); -}, "java.net.URL"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.toExternalForm (); -}); -Clazz_defineMethod (c$, "toExternalForm", -function () { -return this.handler.toExternalForm (this); -}); -Clazz_defineMethod (c$, "openConnection", -function () { -return this.handler.openConnection (this); -}); -Clazz_defineMethod (c$, "openStream", -function () { -return this.openConnection ().getInputStream (); -}); -Clazz_defineMethod (c$, "getContent", -function () { -return this.openConnection ().getInputStream (); -}); -c$.setURLStreamHandlerFactory = Clazz_defineMethod (c$, "setURLStreamHandlerFactory", -function (fac) { -{ -if (java.net.URL.factory != null) { -throw new Error ("factory already defined"); -}var security = System.getSecurityManager (); -if (security != null) { -security.checkSetFactory (); -}java.net.URL.handlers.clear (); -java.net.URL.factory = fac; -}}, "java.net.URLStreamHandlerFactory"); -c$.getURLStreamHandler = Clazz_defineMethod (c$, "getURLStreamHandler", -function (protocol) { -var handler = java.net.URL.handlers.get (protocol); -if (handler == null) { -if (java.net.URL.factory != null) { -handler = java.net.URL.factory.createURLStreamHandler (protocol); -}}return handler; -}, "~S"); -Clazz_defineStatics (c$, -"factory", null); -c$.handlers = c$.prototype.handlers = new java.util.Hashtable (); -c$.streamHandlerLock = c$.prototype.streamHandlerLock = new Clazz._O (); -}); - -// modified by Bob Hanson 3/21/2014 6:44:21 AM to reduce this.b$[....] phrases to simply this.h$ -// BH added ability to use a non-Java key for HTML elements, for example. -// BH 8/24/2014 8:48:58 PM all synchronization and inner classes removed - - -Clazz_load([],"java.util.HashtableIterator",[],function(){ -c$=Clazz_decorateAsClass(function(){ -this.position=0; -this.expectedModCount=0; -this.type=null; -this.lastEntry=null; -this.lastPosition=0; -this.canRemove=false; -Clazz_instantialize(this,arguments); -},java.util,"HashtableIterator",null,java.util.Iterator); -Clazz_makeConstructor(c$, -function(a){ -this.type=a; -this.h$ = a.h$; -this.position=this.h$.lastSlot; -this.expectedModCount=this.h$.modCount; -},"java.util.AbstractSet"); -Clazz_overrideMethod(c$,"hasNext", -function(){ -if(this.lastEntry&&this.lastEntry.next){ -return true; -}while(this.position>=this.h$.firstSlot){ -if(this.h$.elementData[this.position]==null){ -this.position--; -}else{ -return true; -}} -return false; -}); -Clazz_overrideMethod(c$,"next", -function(){ -if(this.expectedModCount==this.h$.modCount){ -if(this.lastEntry){ -this.lastEntry=this.lastEntry.next; -}if(this.lastEntry==null){ -while(this.position>=this.h$.firstSlot&&(this.lastEntry=this.h$.elementData[this.position])==null){ -this.position--; -} -if(this.lastEntry){ -this.lastPosition=this.position; -this.position--; -}}if(this.lastEntry){ -this.canRemove=true; -return this.type.get(this.lastEntry); -}throw new java.util.NoSuchElementException(); -}throw new java.util.ConcurrentModificationException(); -}); -Clazz_overrideMethod(c$,"remove", -function(){ -if(this.expectedModCount==this.h$.modCount){ -if(this.canRemove){ -this.canRemove=false; -{ -var a=false; -var b=this.h$.elementData[this.lastPosition]; -if(b===this.lastEntry){ -this.h$.elementData[this.lastPosition]=b.next; -a=true; -}else{ -while(b&&b.next!==this.lastEntry){ -b=b.next; -} -if(b){ -b.next=this.lastEntry.next; -a=true; -}}if(a){ -this.h$.modCount++; -this.h$.elementCount--; -this.expectedModCount++; -return; -}}}else{ -throw new IllegalStateException(); -}}throw new java.util.ConcurrentModificationException(); -}); -}); - - - -//////////////////////////// - - -Clazz_load([],"java.util.HashtableEnumerator",[],function(){ -c$=Clazz_decorateAsClass(function(){ -this.key=false; -this.start=0; -this.entry=null; -Clazz_instantialize(this,arguments); -},java.util,"HashtableEnumerator",null,java.util.Enumeration); - -Clazz_makeConstructor(c$, -function(a, b){ -this.key = a; -this.h$ = b; -if (this.h$)this.start=this.h$.lastSlot+1; -},"~B,java.util.Hashtable"); -Clazz_overrideMethod(c$,"hasMoreElements", -function(){ -if (!this.h$)return false; -if(this.entry)return true; - -while(--this.start>=this.h$.firstSlot){ -if(this.h$.elementData[this.start]){ -this.entry=this.h$.elementData[this.start]; -return true; -}} -return false; -}); -Clazz_overrideMethod(c$,"nextElement", -function(){ -if(this.hasMoreElements()){ -var a=this.key?this.entry.key:this.entry.value; -this.entry=this.entry.next; -return a; -} -throw new java.util.NoSuchElementException(); -}); -}); - -//////////////////////////// - -Clazz_load([],"java.util.HashtableEntrySet",[],function(){ -c$=Clazz_decorateAsClass(function(){ -Clazz_instantialize(this,arguments); -},java.util,"HashtableEntrySet",java.util.AbstractSet); - -Clazz_makeConstructor(c$, -function(a){ -this.h$ = a; -},"java.util.Hashtable"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.h$.elementCount; -}); -Clazz_overrideMethod(c$,"clear", -function(){ -this.h$.clear(); -}); -Clazz_overrideMethod(c$,"remove", -function(object){ -if(this.contains(object)){ -this.h$.remove((object).getKey()); -return true; -}return false; -},"~O"); -Clazz_defineMethod(c$,"contains", -function(object){ -var entry=this.h$.getEntry((object).getKey()); -return object.equals(entry); -},"~O"); - -Clazz_overrideMethod(c$,"get", -function(entry){ -return entry; -},"java.util.MapEntry"); - -Clazz_defineMethod(c$,"iterator", -function(){ -return new java.util.HashtableIterator(this); -}); -}); - - -//////////////////////////// - -Clazz_load([],"java.util.HashtableKeySet",[],function(){ -c$=Clazz_decorateAsClass(function(){ -Clazz_instantialize(this,arguments); -},java.util,"HashtableKeySet",java.util.AbstractSet); - -Clazz_makeConstructor(c$, -function(a){ -this.h$ = a; -},"java.util.Hashtable"); - -Clazz_overrideMethod(c$,"contains", -function(object){ -return this.h$.containsKey(object); -},"~O"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.h$.elementCount; -}); -Clazz_overrideMethod(c$,"clear", -function(){ -this.h$.clear(); -}); -Clazz_overrideMethod(c$,"remove", -function(key){ -if(this.h$.containsKey(key)){ -this.h$.remove(key); -return true; -}return false; -},"~O"); - -Clazz_overrideMethod(c$,"get", -function(entry){ -return entry.key; -},"java.util.MapEntry"); - -Clazz_overrideMethod(c$,"iterator", -function(){ -return new java.util.HashtableIterator(this); -}); -}); - -//////////////////////////// - -Clazz_load([],"java.util.HashtableValueCollection",[],function(){ -c$=Clazz_decorateAsClass(function(){ -Clazz_instantialize(this,arguments); -},java.util,"HashtableValueCollection",null,java.util.AbstractCollection); - -Clazz_makeConstructor(c$, -function(a){ -this.h$ = a; -},"java.util.Hashtable"); -Clazz_overrideMethod(c$,"contains", -function(object){ -return this.h$.contains(object); -},"~O"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.h$.elementCount; -}); -Clazz_overrideMethod(c$,"clear", -function(){ -this.h$.clear(); -}); - -Clazz_overrideMethod(c$,"get", -function(entry){ -return entry.value; -},"java.util.MapEntry"); - -Clazz_overrideMethod(c$,"iterator", -function(){ -return new java.util.HashtableIterator(this); -}); -}); -//////////////////////////// - - -Clazz_load(["java.util.MapEntry"],"java.util.HashtableEntry",[],function(){ -c$=Clazz_decorateAsClass(function(){ -this.next=null; -this.hashcode=0; -Clazz_instantialize(this,arguments); -},java.util,"HashtableEntry",java.util.MapEntry); -Clazz_overrideConstructor(c$, -function(a,b){ -this.key = a; -this.value = b; -this.hashcode=a.hashCode(); -}); -Clazz_defineMethod(c$,"clone", -function(){ -var a=Clazz_superCall(this,java.util.HashtableEntry,"clone",[]); -if(this.next!=null){ -a.next=this.next.clone(); -} -return a; -}); -Clazz_overrideMethod(c$,"setValue", -function(a){ -if(a==null){ -throw new NullPointerException(); -}var b=this.value; -this.value=a; -return b; -},"~O"); -Clazz_defineMethod(c$,"getKeyHash", -function(){ -return this.key.hashCode(); -}); -Clazz_defineMethod(c$,"equalsKey", -function(a,b){ -return this.hashcode==(!a.hashCode || a.hashCode())&&this.key.equals(a); -},"~O,~N"); -Clazz_overrideMethod(c$,"toString", -function(){ -return this.key+"="+this.value; -}); -}); - - - -//////////////////////////// - - -Clazz_load(["java.util.Dictionary","$.Enumeration","$.HashtableEnumerator","$.Iterator","$.Map","$.MapEntry","$.NoSuchElementException"],"java.util.Hashtable",["java.lang.IllegalArgumentException","$.IllegalStateException","$.NullPointerException","$.StringBuilder","java.util.AbstractCollection","$.AbstractSet","$.Arrays","$.Collections","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.HashtableEntry"],function(){ -c$=Clazz_decorateAsClass(function(){ -this.elementCount=0; -this.elementData=null; -this.loadFactor=0; -this.threshold=0; -this.firstSlot=0; -this.lastSlot=-1; -this.modCount=0; -Clazz_instantialize(this,arguments); -},java.util,"Hashtable",java.util.Dictionary,[java.util.Map,Cloneable,java.io.Serializable]); -c$.newEntry=Clazz_defineMethod(c$,"newEntry", -($fz=function(key,value,hash){ -return new java.util.HashtableEntry(key,value); -},$fz.isPrivate=true,$fz),"~O,~O,~N"); -Clazz_overrideConstructor(c$, -function(){ -this.elementCount=0; -this.elementData=this.newElementArray(11); -this.firstSlot=this.elementData.length; -this.loadFactor=0.75; -this.computeMaxSize(); -}); -Clazz_defineMethod(c$,"newElementArray", -($fz=function(size){ -return new Array(size); -},$fz.isPrivate=true,$fz),"~N"); -Clazz_overrideMethod(c$,"clear", -function(){ -this.elementCount=0; -for (var i = this.elementData.length; --i >= 0;) - this.elementData[i] = null; -this.modCount++; -}); -Clazz_defineMethod(c$,"clone", -function(){ -try{ -var hashtable=Clazz_superCall(this,java.util.Hashtable,"clone",[]); -hashtable.elementData=this.elementData.clone(); -var entry; -for(var i=this.elementData.length;--i>=0;){ -if((entry=this.elementData[i])){ -hashtable.elementData[i]=entry.clone(); -}} -return hashtable; -}catch(e){ -if(Clazz_instanceOf(e,CloneNotSupportedException)){ -return null; -}else{ -throw e; -} -} -}); -Clazz_defineMethod(c$,"computeMaxSize", -($fz=function(){ -this.threshold=Math.round((this.elementData.length*this.loadFactor)); -},$fz.isPrivate=true,$fz)); -Clazz_defineMethod(c$,"contains", -function(value){ -if(value==null){ -throw new NullPointerException(); -}for(var i=this.elementData.length;--i>=0;){ -var entry=this.elementData[i]; -while(entry){ -if(value.equals(entry.value)){ -return true; -}entry=entry.next; -} -} -return false; -},"~O"); -Clazz_overrideMethod(c$,"containsKey", -function(key){ - if(!key.hashCode) { - key.hashCode = function(){return 1}; - if (!key.equals) - key.equals = function(a) {return this == a}; - } -return this.getEntry(key)!=null ; -},"~O"); -Clazz_overrideMethod(c$,"containsValue", -function(value){ -return this.contains(value); -},"~O"); -Clazz_overrideMethod(c$,"elements", -function(){ -if(this.elementCount==0){ -return java.util.Hashtable.EMPTY_ENUMERATION; -} -return new java.util.HashtableEnumerator(false, this); -}); -Clazz_overrideMethod(c$,"entrySet", -function(){ -return new java.util.HashtableEntrySet(this); -}); -Clazz_overrideMethod(c$,"equals", -function(object){ -if(this===object){ -return true; -}if(Clazz_instanceOf(object,java.util.Map)){ -var map=object; -if(this.size()!=map.size()){ -return false; -}var entries=this.entrySet(); -for(var e,$e=map.entrySet().iterator();$e.hasNext()&&((e=$e.next())||true);){ -if(!entries.contains(e)){ -return false; -}} -return true; -}return false; -},"~O"); -Clazz_overrideMethod(c$,"get", -function(key){ - if(!key.hashCode) { - key.hashCode = function(){return 1}; - if (!key.equals) - key.equals = function(a) {return this == a}; - } -var hash=key.hashCode(); -var index=(hash&0x7FFFFFFF)%this.elementData.length; -var entry=this.elementData[index]; -while(entry){ -if(entry.equalsKey(key,hash)){ -return entry.value; -}entry=entry.next; -} -return null; -},"~O"); -Clazz_defineMethod(c$,"getEntry", -function(key){ -var hash=key.hashCode(); -var index=(hash&0x7FFFFFFF)%this.elementData.length; -var entry=this.elementData[index]; -while(entry){ -if(entry.equalsKey(key,hash)){ -return entry; -}entry=entry.next; -} -return null; -},"~O"); -Clazz_overrideMethod(c$,"hashCode", -function(){ -var result=0; -var it=this.entrySet().iterator(); -while(it.hasNext()){ -var entry=it.next(); -var key=entry.getKey(); -var value=entry.getValue(); -var hash=(key!==this?key.hashCode():0)^(value!==this?(value!=null?value.hashCode():0):0); -result+=hash; -} -return result; -}); -Clazz_overrideMethod(c$,"isEmpty", -function(){ -return this.elementCount==0; -}); -Clazz_overrideMethod(c$,"keys", -function(){ -if(this.elementCount==0){ -return java.util.Hashtable.EMPTY_ENUMERATION; -} -return new java.util.HashtableEnumerator(true, this); -}); -Clazz_overrideMethod(c$,"keySet", -function(){ -return new java.util.HashtableKeySet(this); -}); -Clazz_overrideMethod(c$,"put", -function(key,value){ -if(key!=null&&value!=null){ - if(!key.hashCode) { - key.hashCode = function(){return 1}; - if (!key.equals) - key.equals = function(a) {return this == a}; - } - var hash=key.hashCode(); - var index=(hash&0x7FFFFFFF)%this.elementData.length; - var entry=this.elementData[index]; - while(entry!=null&&!entry.equalsKey(key,hash)){ - entry=entry.next; -} -if(entry==null){ -this.modCount++; -if(++this.elementCount>this.threshold){ -this.rehash(); -index=(hash&0x7FFFFFFF)%this.elementData.length; -}if(indexthis.lastSlot){ -this.lastSlot=index; -} - -entry=java.util.Hashtable.newEntry(key,value,hash); -entry.next=this.elementData[index]; -this.elementData[index]=entry; -return null; -}var result=entry.value; -entry.value=value; -return result; -}throw new NullPointerException(); -},"~O,~O"); -Clazz_overrideMethod(c$,"putAll", -function(map){ -for(var entry,$entry=map.entrySet().iterator();$entry.hasNext()&&((entry=$entry.next())||true);){ -this.put(entry.getKey(),entry.getValue()); -} -},"java.util.Map"); - -Clazz_defineMethod(c$,"rehash", -function(){ -var length=(this.elementData.length<<1)+1; -if(length==0){ -length=1; -}var newFirst=length; -var newLast=-1; -var newData=this.newElementArray(length); -for(var i=this.lastSlot+1;--i>=this.firstSlot;){ -var entry=this.elementData[i]; -while(entry!=null){ -var index=(entry.getKeyHash()&0x7FFFFFFF)%length; -if(indexnewLast){ -newLast=index; -}var next=entry.next; -entry.next=newData[index]; -newData[index]=entry; -entry=next; -} -} -this.firstSlot=newFirst; -this.lastSlot=newLast; -this.elementData=newData; -this.computeMaxSize(); -}); -Clazz_overrideMethod(c$,"remove", -function(key){ -var hash=key.hashCode(); -var index=(hash&0x7FFFFFFF)%this.elementData.length; -var last=null; -var entry=this.elementData[index]; -while(entry!=null&&!entry.equalsKey(key,hash)){ -last=entry; -entry=entry.next; -} -if(entry!=null){ -this.modCount++; -if(last==null){ -this.elementData[index]=entry.next; -}else{ -last.next=entry.next; -}this.elementCount--; -var result=entry.value; -entry.value=null; -return result; -}return null; -},"~O"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.elementCount; -}); -Clazz_overrideMethod(c$,"toString", -function(){ -if(this.isEmpty()){ -return"{}"; -}var buffer=new StringBuilder(this.size()*28); -buffer.append('{'); -for(var i=this.lastSlot;i>=this.firstSlot;i--){ -var entry=this.elementData[i]; -while(entry!=null){ -if(entry.key!==this){ -buffer.append(entry.key); -}else{ -buffer.append("(this Map)"); -}buffer.append('='); -if(entry.value!==this){ -buffer.append(entry.value); -}else{ -buffer.append("(this Map)"); -}buffer.append(", "); -entry=entry.next; -} -} -if(this.elementCount>0){ -buffer.setLength(buffer.length()-2); -}buffer.append('}'); -return buffer.toString(); -}); -Clazz_overrideMethod(c$,"values", -function(){ -return new java.util.HashtableValueCollection(this); -}); -java.util.Hashtable.EMPTY_ENUMERATION = new java.util.HashtableEnumerator(); -}); -c$=Clazz_declareType(java.util,"Dictionary"); -Clazz_makeConstructor(c$, -function(){ -}); -Clazz_declarePackage ("java.net"); -Clazz_load (["java.io.IOException"], "java.net.MalformedURLException", null, function () { -c$ = Clazz_declareType (java.net, "MalformedURLException", java.io.IOException); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.net.MalformedURLException, []); -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (null, "java.awt.GraphicsEnvironment", ["swingjs.JSToolkit"], function () { -c$ = Clazz_declareType (java.awt, "GraphicsEnvironment"); -Clazz_makeConstructor (c$, -function () { -}); -c$.getLocalGraphicsEnvironment = Clazz_defineMethod (c$, "getLocalGraphicsEnvironment", -function () { -if (java.awt.GraphicsEnvironment.localEnv == null) { -java.awt.GraphicsEnvironment.localEnv = swingjs.JSToolkit.getInstance ("swingjs.JSGraphicsEnvironment"); -}return java.awt.GraphicsEnvironment.localEnv; -}); -c$.isHeadless = Clazz_defineMethod (c$, "isHeadless", -function () { -return false; -}); -c$.getHeadlessProperty = Clazz_defineMethod (c$, "getHeadlessProperty", - function () { -return false; -}); -c$.checkHeadless = Clazz_defineMethod (c$, "checkHeadless", -function () { -}); -Clazz_defineMethod (c$, "isHeadlessInstance", -function () { -return java.awt.GraphicsEnvironment.getHeadlessProperty (); -}); -Clazz_defineMethod (c$, "registerFont", -function (font) { -return true; -}, "java.awt.Font"); -Clazz_defineMethod (c$, "preferLocaleFonts", -function () { -}); -Clazz_defineMethod (c$, "preferProportionalFonts", -function () { -}); -Clazz_defineMethod (c$, "getCenterPoint", -function () { -return null; -}); -Clazz_defineStatics (c$, -"localEnv", null); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.WindowEvent", ["java.awt.Window", "jssun.awt.AppContext", "$.SunToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.opposite = null; -this.oldState = 0; -this.newState = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "WindowEvent", java.awt.event.ComponentEvent); -Clazz_makeConstructor (c$, -function (source, id, opposite, oldState, newState) { -Clazz_superConstructor (this, java.awt.event.WindowEvent, [source, id]); -this.opposite = opposite; -this.oldState = oldState; -this.newState = newState; -}, "java.awt.Window,~N,java.awt.Window,~N,~N"); -Clazz_makeConstructor (c$, -function (source, id, opposite) { -this.construct (source, id, opposite, 0, 0); -}, "java.awt.Window,~N,java.awt.Window"); -Clazz_makeConstructor (c$, -function (source, id, oldState, newState) { -this.construct (source, id, null, oldState, newState); -}, "java.awt.Window,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (source, id) { -this.construct (source, id, null, 0, 0); -}, "java.awt.Window,~N"); -Clazz_defineMethod (c$, "getWindow", -function () { -return (Clazz_instanceOf (this.source, java.awt.Window)) ? this.source : null; -}); -Clazz_defineMethod (c$, "getOppositeWindow", -function () { -if (this.opposite == null) { -return null; -}return (jssun.awt.SunToolkit.targetToAppContext (this.opposite) === jssun.awt.AppContext.getAppContext ()) ? this.opposite : null; -}); -Clazz_defineMethod (c$, "getOldState", -function () { -return this.oldState; -}); -Clazz_defineMethod (c$, "getNewState", -function () { -return this.newState; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 200: -typeStr = "WINDOW_OPENED"; -break; -case 201: -typeStr = "WINDOW_CLOSING"; -break; -case 202: -typeStr = "WINDOW_CLOSED"; -break; -case 203: -typeStr = "WINDOW_ICONIFIED"; -break; -case 204: -typeStr = "WINDOW_DEICONIFIED"; -break; -case 205: -typeStr = "WINDOW_ACTIVATED"; -break; -case 206: -typeStr = "WINDOW_DEACTIVATED"; -break; -case 207: -typeStr = "WINDOW_GAINED_FOCUS"; -break; -case 208: -typeStr = "WINDOW_LOST_FOCUS"; -break; -case 209: -typeStr = "WINDOW_STATE_CHANGED"; -break; -default: -typeStr = "unknown type"; -} -typeStr += ",opposite=" + this.getOppositeWindow () + ",oldState=" + this.oldState + ",newState=" + this.newState; -return typeStr; -}); -Clazz_defineStatics (c$, -"WINDOW_FIRST", 200, -"WINDOW_OPENED", 200, -"WINDOW_CLOSING", 201, -"WINDOW_CLOSED", 202, -"WINDOW_ICONIFIED", 203, -"WINDOW_DEICONIFIED", 204, -"WINDOW_ACTIVATED", 205, -"WINDOW_DEACTIVATED", 206, -"WINDOW_GAINED_FOCUS", 207, -"WINDOW_LOST_FOCUS", 208, -"WINDOW_STATE_CHANGED", 209, -"WINDOW_LAST", 209); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Container", "javax.swing.Action", "java.util.ArrayList", "javax.swing.SwingUtilities", "javax.swing.event.EventListenerList", "jssun.awt.RequestFocusController"], "javax.swing.JComponent", ["java.lang.IllegalArgumentException", "java.util.HashSet", "$.Hashtable", "java.applet.Applet", "java.awt.Component", "$.Insets", "$.Rectangle", "$.Window", "java.beans.PropertyChangeListener", "java.util.Locale", "javax.swing.ActionMap", "$.AncestorNotifier", "$.ArrayTable", "$.CellRendererPane", "$.ClientPropertyKey", "$.ComponentInputMap", "$.InputMap", "$.JApplet", "$.JDialog", "$.JFrame", "$.JWindow", "$.KeyStroke", "$.KeyboardManager", "javax.swing.Popup.HeavyWeightWindow", "javax.swing.RepaintManager", "javax.swing.border.AbstractBorder", "javax.swing.event.AncestorListener", "jssun.font.FontDesignMetrics", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.isAlignmentXSet = false; -this.alignmentX = 0; -this.isAlignmentYSet = false; -this.alignmentY = 0; -this.ui = null; -this.listenerList = null; -this.clientProperties = null; -this.autoscrolls = false; -this.border = null; -this.flags = 0; -this.verifyInputWhenFocusTarget = true; -this.paintingChild = null; -this.popupMenu = null; -this.focusInputMap = null; -this.ancestorInputMap = null; -this.windowInputMap = null; -this.actionMap = null; -if (!Clazz_isClassDefined ("javax.swing.JComponent.ActionStandin")) { -javax.swing.JComponent.$JComponent$ActionStandin$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "JComponent", java.awt.Container); -Clazz_prepareFields (c$, function () { -this.listenerList = new javax.swing.event.EventListenerList (); -}); -c$.safelyGetGraphics = Clazz_defineMethod (c$, "safelyGetGraphics", -function (c, root) { -{ -javax.swing.JComponent.componentObtainingGraphicsFrom = root; -var g = c.getGraphics (); -javax.swing.JComponent.componentObtainingGraphicsFrom = null; -return g; -}}, "java.awt.Component,java.awt.Component"); -c$.getGraphicsInvoked = Clazz_defineMethod (c$, "getGraphicsInvoked", -function (root) { -if (!javax.swing.JComponent.isComponentObtainingGraphicsFrom (root)) { -var rootPane = (root).getRootPane (); -if (rootPane != null) { -rootPane.disableTrueDoubleBuffering (); -}}}, "java.awt.Component"); -c$.isComponentObtainingGraphicsFrom = Clazz_defineMethod (c$, "isComponentObtainingGraphicsFrom", - function (c) { -{ -return (javax.swing.JComponent.componentObtainingGraphicsFrom === c); -}}, "java.awt.Component"); -c$.getManagingFocusForwardTraversalKeys = Clazz_defineMethod (c$, "getManagingFocusForwardTraversalKeys", -function () { -{ -if (javax.swing.JComponent.managingFocusForwardTraversalKeys == null) { -javax.swing.JComponent.managingFocusForwardTraversalKeys = new java.util.HashSet (1); -javax.swing.JComponent.managingFocusForwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 2)); -}}return javax.swing.JComponent.managingFocusForwardTraversalKeys; -}); -c$.getManagingFocusBackwardTraversalKeys = Clazz_defineMethod (c$, "getManagingFocusBackwardTraversalKeys", -function () { -{ -if (javax.swing.JComponent.managingFocusBackwardTraversalKeys == null) { -javax.swing.JComponent.managingFocusBackwardTraversalKeys = new java.util.HashSet (1); -javax.swing.JComponent.managingFocusBackwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 3)); -}}return javax.swing.JComponent.managingFocusBackwardTraversalKeys; -}); -c$.fetchRectangle = Clazz_defineMethod (c$, "fetchRectangle", - function () { -{ -var rect; -var size = javax.swing.JComponent.tempRectangles.size (); -if (size > 0) { -rect = javax.swing.JComponent.tempRectangles.remove (size - 1); -} else { -rect = new java.awt.Rectangle (0, 0, 0, 0); -}return rect; -}}); -c$.recycleRectangle = Clazz_defineMethod (c$, "recycleRectangle", - function (rect) { -{ -javax.swing.JComponent.tempRectangles.add (rect); -}}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "setInheritsPopupMenu", -function (value) { -var oldValue = this.getFlag (23); -this.setFlag (23, value); -this.firePropertyChangeBool ("inheritsPopupMenu", oldValue, value); -}, "~B"); -Clazz_defineMethod (c$, "getInheritsPopupMenu", -function () { -return this.getFlag (23); -}); -Clazz_defineMethod (c$, "setComponentPopupMenu", -function (popup) { -if (popup != null) { -this.enableEvents (16); -}var oldPopup = this.popupMenu; -this.popupMenu = popup; -this.firePropertyChangeObject ("componentPopupMenu", oldPopup, popup); -}, "javax.swing.JPopupMenu"); -Clazz_defineMethod (c$, "getComponentPopupMenu", -function () { -if (!this.getInheritsPopupMenu ()) { -return this.popupMenu; -}if (this.popupMenu == null) { -var parent = this.getParent (); -while (parent != null) { -if (Clazz_instanceOf (parent, javax.swing.JComponent)) { -return (parent).getComponentPopupMenu (); -}if (Clazz_instanceOf (parent, java.awt.Window) || Clazz_instanceOf (parent, java.applet.Applet)) { -break; -}parent = parent.getParent (); -} -return null; -}return this.popupMenu; -}); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JComponent); -this.enableEvents (8); -Clazz_superCall (this, javax.swing.JComponent, "setLocale", [javax.swing.JComponent.getDefaultLocale ()]); -}); -Clazz_defineMethod (c$, "updateUI", -function () { -}); -Clazz_defineMethod (c$, "setUI", -function (newUI) { -this.uninstallUIAndProperties (); -this.ui = newUI; -if (this.ui != null) { -this.ui.installUI (this); -}this.revalidate (); -this.repaint (); -}, "javax.swing.plaf.ComponentUI"); -Clazz_defineMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_defineMethod (c$, "uninstallUIAndProperties", - function () { -if (this.ui != null) { -this.ui.uninstallUI (this); -}}); -Clazz_defineMethod (c$, "getUIClassID", -function () { -return "ComponentUI"; -}); -Clazz_defineMethod (c$, "getComponentGraphics", -function (g) { -var componentGraphics = g; -componentGraphics.setColor (this.getForeground ()); -componentGraphics.setFont (this.getFont ()); -return componentGraphics; -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintComponent", -function (g) { -if (this.ui != null) { -var scratchGraphics = (g == null) ? null : g.createSwingJS (); -try { -this.ui.update (scratchGraphics, this); -} finally { -scratchGraphics.dispose (); -} -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintChildren", -function (g) { -var isJComponent; -var sg = g; -{ -var i = this.getComponentCount () - 1; -if (i < 0) { -return; -}if (this.paintingChild != null && (Clazz_instanceOf (this.paintingChild, javax.swing.JComponent))) { -for (; i >= 0; i--) { -if (this.getComponent (i) === this.paintingChild) { -break; -}} -}var tmpRect = javax.swing.JComponent.fetchRectangle (); -for (; i >= 0; i--) { -var comp = this.getComponent (i); -isJComponent = (Clazz_instanceOf (comp, javax.swing.JComponent)); -if (comp != null && (isJComponent || javax.swing.JComponent.isLightweightComponent (comp)) && (comp.isVisible () == true)) { -var cr = comp.getBounds (tmpRect); -var cg = sg.create4 (cr.x, cr.y, cr.width, cr.height); -cg.setColor (comp.getForeground ()); -cg.setFont (comp.getFont ()); -var shouldSetFlagBack = false; -try { -if (isJComponent) { -(comp).paint (cg); -} else { -comp.paint (cg); -}} finally { -cg.dispose (); -if (shouldSetFlagBack) { -(comp).setFlag (1, false); -(comp).setFlag (2, false); -}} -}} -javax.swing.JComponent.recycleRectangle (tmpRect); -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintBorder", -function (g) { -var border = this.getBorder (); -if (border != null) { -border.paintBorder (this, g, 0, 0, this.getWidth (), this.getHeight ()); -}}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "paint", -function (g) { -var shouldClearPaintFlags = false; -if ((this.getWidth () <= 0) || (this.getHeight () <= 0)) { -return; -}var componentGraphics = this.getComponentGraphics (g); -var co = componentGraphics.createSwingJS (); -try { -if (this.getParent () != null && !(Clazz_instanceOf (this.getParent (), javax.swing.JComponent))) { -this.adjustPaintFlags (); -shouldClearPaintFlags = true; -}this.paintComponent (co); -this.paintBorder (co); -this.paintChildren (co); -} finally { -co.dispose (); -if (shouldClearPaintFlags) { -this.setFlag (1, false); -this.setFlag (2, false); -this.setFlag (11, false); -this.setFlag (12, false); -}} -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintForceDoubleBuffered", -function (g) { -var rm = javax.swing.RepaintManager.currentManager (this); -var clip = g.getClipBounds (); -rm.beginPaint (); -this.setFlag (13, true); -try { -rm.paint (this, this, g, clip.x, clip.y, clip.width, clip.height); -} finally { -rm.endPaint (); -this.setFlag (13, false); -} -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "isPainting", -function () { -var component = this; -while (component != null) { -if (Clazz_instanceOf (component, javax.swing.JComponent) && (component).getFlag (1)) { -return true; -}component = component.getParent (); -} -return false; -}); -Clazz_defineMethod (c$, "adjustPaintFlags", - function () { -var jparent = null; -var parent; -for (parent = this.getParent (); parent != null; parent = parent.getParent ()) { -if (Clazz_instanceOf (parent, javax.swing.JComponent)) { -jparent = parent; -if (jparent.getFlag (1)) this.setFlag (1, true); -if (jparent.getFlag (2)) this.setFlag (2, true); -if (jparent.getFlag (11)) this.setFlag (11, true); -if (jparent.getFlag (12)) this.setFlag (12, true); -break; -}} -}); -Clazz_overrideMethod (c$, "printAll", -function (g) { -this.setFlag (12, true); -try { -this.print (g); -} finally { -this.setFlag (12, false); -} -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "print", -function (g) { -this.setFlag (11, true); -this.firePropertyChangeBool ("paintingForPrint", false, true); -try { -this.paint (g); -} finally { -this.setFlag (11, false); -this.firePropertyChangeBool ("paintingForPrint", true, false); -} -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "printComponent", -function (g) { -this.paintComponent (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "printChildren", -function (g) { -this.paintChildren (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "printBorder", -function (g) { -this.paintBorder (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "isPaintingTile", -function () { -return this.getFlag (2); -}); -Clazz_defineMethod (c$, "isPaintingForPrint", -function () { -return this.getFlag (11); -}); -Clazz_defineMethod (c$, "isManagingFocus", -function () { -return false; -}); -Clazz_defineMethod (c$, "registerNextFocusableComponent", - function () { -this.registerNextFocusableComponent (this.getNextFocusableComponent ()); -}); -Clazz_defineMethod (c$, "registerNextFocusableComponent", - function (nextFocusableComponent) { -if (nextFocusableComponent == null) { -return; -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "deregisterNextFocusableComponent", - function () { -var nextFocusableComponent = this.getNextFocusableComponent (); -if (nextFocusableComponent == null) { -return; -}var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor (); -if (nearestRoot == null) { -return; -}}); -Clazz_defineMethod (c$, "setNextFocusableComponent", -function (aComponent) { -var displayable = this.isDisplayable (); -if (displayable) { -this.deregisterNextFocusableComponent (); -}this.putClientProperty ("nextFocus", aComponent); -if (displayable) { -this.registerNextFocusableComponent (aComponent); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "getNextFocusableComponent", -function () { -return this.getClientProperty ("nextFocus"); -}); -Clazz_defineMethod (c$, "setRequestFocusEnabled", -function (requestFocusEnabled) { -this.setFlag (22, !requestFocusEnabled); -}, "~B"); -Clazz_defineMethod (c$, "isRequestFocusEnabled", -function () { -return !this.getFlag (22); -}); -Clazz_defineMethod (c$, "requestFocus", -function (temporary) { -Clazz_superCall (this, javax.swing.JComponent, "requestFocus", []); -return true; -}, "~B"); -Clazz_defineMethod (c$, "requestFocusInWindow", -function (temporary) { -return Clazz_superCall (this, javax.swing.JComponent, "requestFocusInWindow", []); -}, "~B"); -Clazz_defineMethod (c$, "grabFocus", -function () { -this.requestFocus (); -}); -Clazz_defineMethod (c$, "setVerifyInputWhenFocusTarget", -function (verifyInputWhenFocusTarget) { -var oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget; -this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget; -this.firePropertyChangeBool ("verifyInputWhenFocusTarget", oldVerifyInputWhenFocusTarget, verifyInputWhenFocusTarget); -}, "~B"); -Clazz_defineMethod (c$, "getVerifyInputWhenFocusTarget", -function () { -return this.verifyInputWhenFocusTarget; -}); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -return jssun.font.FontDesignMetrics.getMetrics (font); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "getPreferredSize", -function () { -return this.getPrefSizeJComp (); -}); -Clazz_defineMethod (c$, "getPrefSizeJComp", -function () { -var size = (this.isPreferredSizeSet () || this.ui == null ? null : this.ui.getPreferredSize (this)); -return (size == null ? this.preferredSize () : size); -}); -Clazz_defineMethod (c$, "getMaximumSize", -function () { -if (this.isMaximumSizeSet ()) { -return Clazz_superCall (this, javax.swing.JComponent, "getMaximumSize", []); -}var size = null; -if (this.ui != null) { -size = this.ui.getMaximumSize (this); -}return (size != null) ? size : Clazz_superCall (this, javax.swing.JComponent, "getMaximumSize", []); -}); -Clazz_defineMethod (c$, "getMinimumSize", -function () { -if (this.isMinimumSizeSet ()) { -return Clazz_superCall (this, javax.swing.JComponent, "getMinimumSize", []); -}var size = null; -if (this.ui != null) { -size = this.ui.getMinimumSize (this); -}return (size != null) ? size : Clazz_superCall (this, javax.swing.JComponent, "getMinimumSize", []); -}); -Clazz_overrideMethod (c$, "contains", -function (x, y) { -return (this.ui != null) ? this.ui.contains (this, x, y) : this.inside (x, y); -}, "~N,~N"); -Clazz_defineMethod (c$, "setBorder", -function (border) { -var oldBorder = this.border; -this.border = border; -this.firePropertyChangeObject ("border", oldBorder, border); -if (border !== oldBorder) { -if (border == null || oldBorder == null || !(border.getBorderInsets (this).equals (oldBorder.getBorderInsets (this)))) { -this.revalidate (); -}this.repaint (); -}}, "javax.swing.border.Border"); -Clazz_defineMethod (c$, "getBorder", -function () { -return this.border; -}); -Clazz_defineMethod (c$, "getInsets", -function () { -if (this.border != null) { -return this.border.getBorderInsets (this); -}return Clazz_superCall (this, javax.swing.JComponent, "getInsets", []); -}); -Clazz_defineMethod (c$, "getInsets", -function (insets) { -if (insets == null) { -insets = new java.awt.Insets (0, 0, 0, 0); -}if (this.border != null) { -if (Clazz_instanceOf (this.border, javax.swing.border.AbstractBorder)) { -return (this.border).getBorderInsets (this, insets); -} else { -return this.border.getBorderInsets (this); -}} else { -insets.left = insets.top = insets.right = insets.bottom = 0; -return insets; -}}, "java.awt.Insets"); -Clazz_defineMethod (c$, "getAlignmentY", -function () { -if (this.isAlignmentYSet) { -return this.alignmentY; -}return Clazz_superCall (this, javax.swing.JComponent, "getAlignmentY", []); -}); -Clazz_defineMethod (c$, "setAlignmentY", -function (alignmentY) { -this.alignmentY = alignmentY > 1.0 ? 1.0 : alignmentY < 0.0 ? 0.0 : alignmentY; -this.isAlignmentYSet = true; -}, "~N"); -Clazz_defineMethod (c$, "getAlignmentX", -function () { -if (this.isAlignmentXSet) { -return this.alignmentX; -}return Clazz_superCall (this, javax.swing.JComponent, "getAlignmentX", []); -}); -Clazz_defineMethod (c$, "setAlignmentX", -function (alignmentX) { -this.alignmentX = alignmentX > 1.0 ? 1.0 : alignmentX < 0.0 ? 0.0 : alignmentX; -this.isAlignmentXSet = true; -}, "~N"); -Clazz_defineMethod (c$, "setInputVerifier", -function (inputVerifier) { -var oldInputVerifier = this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER); -this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER, inputVerifier); -this.firePropertyChangeObject ("inputVerifier", oldInputVerifier, inputVerifier); -}, "javax.swing.InputVerifier"); -Clazz_defineMethod (c$, "getInputVerifier", -function () { -return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER); -}); -Clazz_defineMethod (c$, "registerKeyboardAction", -function (anAction, aCommand, aKeyStroke, aCondition) { -var inputMap = this.getInputMap (aCondition, true); -if (inputMap != null) { -var actionMap = this.getActionMap (true); -var action = Clazz_innerTypeInstance (javax.swing.JComponent.ActionStandin, this, null, anAction, aCommand); -inputMap.put (aKeyStroke, action); -if (actionMap != null) { -actionMap.put (action, action); -}}}, "java.awt.event.ActionListener,~S,javax.swing.KeyStroke,~N"); -Clazz_defineMethod (c$, "registerWithKeyboardManager", - function (onlyIfNew) { -var inputMap = this.getInputMap (2, false); -var strokes; -var registered = this.getClientProperty ("_WhenInFocusedWindow"); -if (inputMap != null) { -strokes = inputMap.allKeys (); -if (strokes != null) { -for (var counter = strokes.length - 1; counter >= 0; counter--) { -if (!onlyIfNew || registered == null || registered.get (strokes[counter]) == null) { -this.registerWithKeyboardManager (strokes[counter]); -}if (registered != null) { -registered.remove (strokes[counter]); -}} -}} else { -strokes = null; -}if (registered != null && registered.size () > 0) { -var keys = registered.keys (); -while (keys.hasMoreElements ()) { -var ks = keys.nextElement (); -this.unregisterWithKeyboardManager (ks); -} -registered.clear (); -}if (strokes != null && strokes.length > 0) { -if (registered == null) { -registered = new java.util.Hashtable (strokes.length); -this.putClientProperty ("_WhenInFocusedWindow", registered); -}for (var counter = strokes.length - 1; counter >= 0; counter--) { -registered.put (strokes[counter], strokes[counter]); -} -} else { -this.putClientProperty ("_WhenInFocusedWindow", null); -}}, "~B"); -Clazz_defineMethod (c$, "unregisterWithKeyboardManager", - function () { -var registered = this.getClientProperty ("_WhenInFocusedWindow"); -if (registered != null && registered.size () > 0) { -var keys = registered.keys (); -while (keys.hasMoreElements ()) { -var ks = keys.nextElement (); -this.unregisterWithKeyboardManager (ks); -} -}this.putClientProperty ("_WhenInFocusedWindow", null); -}); -Clazz_defineMethod (c$, "componentInputMapChanged", -function (inputMap) { -var km = this.getInputMap (2, false); -while (km !== inputMap && km != null) { -km = km.getParent (); -} -if (km != null) { -this.registerWithKeyboardManager (false); -}}, "javax.swing.ComponentInputMap"); -Clazz_defineMethod (c$, "registerWithKeyboardManager", - function (aKeyStroke) { -javax.swing.KeyboardManager.getCurrentManager ().registerKeyStroke (aKeyStroke, this); -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "unregisterWithKeyboardManager", - function (aKeyStroke) { -javax.swing.KeyboardManager.getCurrentManager ().unregisterKeyStroke (aKeyStroke, this); -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "registerKeyboardAction", -function (anAction, aKeyStroke, aCondition) { -this.registerKeyboardAction (anAction, null, aKeyStroke, aCondition); -}, "java.awt.event.ActionListener,javax.swing.KeyStroke,~N"); -Clazz_defineMethod (c$, "unregisterKeyboardAction", -function (aKeyStroke) { -var am = this.getActionMap (false); -for (var counter = 0; counter < 3; counter++) { -var km = this.getInputMap (counter, false); -if (km != null) { -var actionID = km.get (aKeyStroke); -if (am != null && actionID != null) { -am.remove (actionID); -}km.remove (aKeyStroke); -}} -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "getRegisteredKeyStrokes", -function () { -var counts = Clazz_newIntArray (3, 0); -var strokes = new Array (3); -for (var counter = 0; counter < 3; counter++) { -var km = this.getInputMap (counter, false); -strokes[counter] = (km != null) ? km.allKeys () : null; -counts[counter] = (strokes[counter] != null) ? strokes[counter].length : 0; -} -var retValue = new Array (counts[0] + counts[1] + counts[2]); -for (var counter = 0, last = 0; counter < 3; counter++) { -if (counts[counter] > 0) { -System.arraycopy (strokes[counter], 0, retValue, last, counts[counter]); -last += counts[counter]; -}} -return retValue; -}); -Clazz_defineMethod (c$, "getConditionForKeyStroke", -function (aKeyStroke) { -for (var counter = 0; counter < 3; counter++) { -var inputMap = this.getInputMap (counter, false); -if (inputMap != null && inputMap.get (aKeyStroke) != null) { -return counter; -}} -return -1; -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "getActionForKeyStroke", -function (aKeyStroke) { -var am = this.getActionMap (false); -if (am == null) { -return null; -}for (var counter = 0; counter < 3; counter++) { -var inputMap = this.getInputMap (counter, false); -if (inputMap != null) { -var actionBinding = inputMap.get (aKeyStroke); -if (actionBinding != null) { -var action = am.get (actionBinding); -if (Clazz_instanceOf (action, javax.swing.JComponent.ActionStandin)) { -return (action).actionListener; -}return action; -}}} -return null; -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "resetKeyboardActions", -function () { -for (var counter = 0; counter < 3; counter++) { -var inputMap = this.getInputMap (counter, false); -if (inputMap != null) { -inputMap.clear (); -}} -var am = this.getActionMap (false); -if (am != null) { -am.clear (); -}}); -Clazz_defineMethod (c$, "setInputMap", -function (condition, map) { -switch (condition) { -case 2: -if (map != null && !(Clazz_instanceOf (map, javax.swing.ComponentInputMap))) { -throw new IllegalArgumentException ("WHEN_IN_FOCUSED_WINDOW InputMaps must be of type ComponentInputMap"); -}this.windowInputMap = map; -this.setFlag (7, true); -this.registerWithKeyboardManager (false); -break; -case 1: -this.ancestorInputMap = map; -this.setFlag (6, true); -break; -case 0: -this.focusInputMap = map; -this.setFlag (5, true); -break; -default: -throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"); -} -}, "~N,javax.swing.InputMap"); -Clazz_defineMethod (c$, "getInputMap", -function (condition) { -return this.getInputMap (condition, true); -}, "~N"); -Clazz_defineMethod (c$, "getInputMap", -function () { -return this.getInputMap (0, true); -}); -Clazz_defineMethod (c$, "setActionMap", -function (am) { -this.actionMap = am; -this.setFlag (8, true); -}, "javax.swing.ActionMap"); -Clazz_defineMethod (c$, "getActionMap", -function () { -return this.getActionMap (true); -}); -Clazz_defineMethod (c$, "getInputMap", -function (condition, create) { -switch (condition) { -case 0: -if (this.getFlag (5)) { -return this.focusInputMap; -}if (create) { -var km = new javax.swing.InputMap (); -this.setInputMap (condition, km); -return km; -}break; -case 1: -if (this.getFlag (6)) { -return this.ancestorInputMap; -}if (create) { -var km = new javax.swing.InputMap (); -this.setInputMap (condition, km); -return km; -}break; -case 2: -if (this.getFlag (7)) { -return this.windowInputMap; -}if (create) { -var km = new javax.swing.ComponentInputMap (this); -this.setInputMap (condition, km); -return km; -}break; -default: -throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"); -} -return null; -}, "~N,~B"); -Clazz_defineMethod (c$, "getActionMap", -function (create) { -{ -(arguments.length == 0) && (create = true); -}if (this.getFlag (8)) { -return this.actionMap; -}if (create) { -var am = new javax.swing.ActionMap (); -this.setActionMap (am); -return am; -}return null; -}, "~B"); -Clazz_defineMethod (c$, "getBaseline", -function (width, height) { -Clazz_superCall (this, javax.swing.JComponent, "getBaseline", [width, height]); -if (this.ui != null) { -return this.ui.getBaseline (this, width, height); -}return -1; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getBaselineResizeBehavior", -function () { -if (this.ui != null) { -return this.ui.getBaselineResizeBehavior (this); -}return java.awt.Component.BaselineResizeBehavior.OTHER; -}); -Clazz_defineMethod (c$, "requestDefaultFocus", -function () { -var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor (); -if (nearestRoot == null) { -return false; -}return false; -}); -Clazz_defineMethod (c$, "setVisible", -function (aFlag) { -if (aFlag != this.isVisible ()) { -Clazz_superCall (this, javax.swing.JComponent, "setVisible", [aFlag]); -var parent = this.getParent (); -if (parent != null) { -var r = this.getBounds (); -parent.repaint (r.x, r.y, r.width, r.height); -}this.revalidate (); -}}, "~B"); -Clazz_defineMethod (c$, "setEnabled", -function (enabled) { -var oldEnabled = this.isEnabled (); -Clazz_superCall (this, javax.swing.JComponent, "setEnabled", [enabled]); -this.firePropertyChangeBool ("enabled", oldEnabled, enabled); -if (enabled != oldEnabled) { -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "setForeground", -function (fg) { -var oldFg = this.getForeground (); -Clazz_superCall (this, javax.swing.JComponent, "setForeground", [fg]); -if ((oldFg != null) ? !oldFg.equals (fg) : ((fg != null) && !fg.equals (oldFg))) { -this.repaint (); -}}, "java.awt.Color"); -Clazz_defineMethod (c$, "setBackground", -function (bg) { -var oldBg = this.getBackground (); -Clazz_superCall (this, javax.swing.JComponent, "setBackground", [bg]); -if ((oldBg != null) ? !oldBg.equals (bg) : ((bg != null) && !bg.equals (oldBg))) { -this.repaint (); -}}, "java.awt.Color"); -Clazz_defineMethod (c$, "setFont", -function (font) { -var oldFont = this.getFont (); -Clazz_superCall (this, javax.swing.JComponent, "setFont", [font]); -if (font !== oldFont) { -this.revalidate (); -this.repaint (); -}}, "java.awt.Font"); -c$.getDefaultLocale = Clazz_defineMethod (c$, "getDefaultLocale", -function () { -var l = javax.swing.SwingUtilities.appContextGet ("JComponent.defaultLocale"); -if (l == null) { -l = java.util.Locale.getDefault (); -javax.swing.JComponent.setDefaultLocale (l); -}return l; -}); -c$.setDefaultLocale = Clazz_defineMethod (c$, "setDefaultLocale", -function (l) { -javax.swing.SwingUtilities.appContextPut ("JComponent.defaultLocale", l); -}, "java.util.Locale"); -Clazz_defineMethod (c$, "processComponentKeyEvent", -function (e) { -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "processKeyEvent", -function (e) { -var shouldProcessKey; -Clazz_superCall (this, javax.swing.JComponent, "processKeyEvent", [e]); -if (!e.isConsumed ()) { -this.processComponentKeyEvent (e); -}shouldProcessKey = javax.swing.JComponent.KeyboardState.shouldProcess (e); -if (e.isConsumed ()) { -return; -}if (shouldProcessKey && this.processKeyBindings (e, e.getID () == 401)) { -e.consume (); -}}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "processKeyBinding", -function (ks, e, condition, pressed) { -var map = this.getInputMap (condition, false); -var am = this.getActionMap (false); -if (map != null && am != null && this.isEnabled ()) { -var binding = map.get (ks); -var action = (binding == null) ? null : am.get (binding); -if (action != null) { -return javax.swing.SwingUtilities.notifyAction (action, ks, e, this, e.getModifiers ()); -}}return false; -}, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B"); -Clazz_defineMethod (c$, "processKeyBindings", -function (e, pressed) { -if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (e)) { -return false; -}var ks; -if (e.getID () == 400) { -ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ()); -} else { -ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), (pressed ? false : true)); -}if (this.processKeyBinding (ks, e, 0, pressed)) return true; -var parent = this; -while (parent != null && !(Clazz_instanceOf (parent, java.awt.Window)) && !(Clazz_instanceOf (parent, java.applet.Applet))) { -if (Clazz_instanceOf (parent, javax.swing.JComponent)) { -if ((parent).processKeyBinding (ks, e, 1, pressed)) return true; -}parent = parent.getParent (); -} -if (parent != null) { -return javax.swing.JComponent.processKeyBindingsForAllComponents (e, parent, pressed); -}return false; -}, "java.awt.event.KeyEvent,~B"); -c$.processKeyBindingsForAllComponents = Clazz_defineMethod (c$, "processKeyBindingsForAllComponents", -function (e, container, pressed) { -while (true) { -if (javax.swing.KeyboardManager.getCurrentManager ().fireKeyboardAction (e, pressed, container)) { -return true; -}if (Clazz_instanceOf (container, javax.swing.Popup.HeavyWeightWindow)) { -container = (container).getOwner (); -} else { -return false; -}} -}, "java.awt.event.KeyEvent,java.awt.Container,~B"); -Clazz_defineMethod (c$, "setToolTipText", -function (text) { -this.putClientProperty ("ToolTipText", text); -}, "~S"); -Clazz_defineMethod (c$, "getToolTipText", -function () { -return this.getClientProperty ("ToolTipText"); -}); -Clazz_defineMethod (c$, "getToolTipText", -function (event) { -return this.getToolTipText (); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "getToolTipLocation", -function (event) { -return null; -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "getPopupLocation", -function (event) { -return null; -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "createToolTip", -function () { -var tip = new javax.swing.JToolTip (); -tip.setComponent (this); -return tip; -}); -Clazz_defineMethod (c$, "scrollRectToVisible", -function (aRect) { -var parent; -var dx = this.getX (); -var dy = this.getY (); -for (parent = this.getParent (); !(parent == null) && !(Clazz_instanceOf (parent, javax.swing.JComponent)) && !(Clazz_instanceOf (parent, javax.swing.CellRendererPane)); parent = parent.getParent ()) { -var bounds = parent.getBounds (); -dx += bounds.x; -dy += bounds.y; -} -if (!(parent == null) && !(Clazz_instanceOf (parent, javax.swing.CellRendererPane))) { -aRect.x += dx; -aRect.y += dy; -(parent).scrollRectToVisible (aRect); -aRect.x -= dx; -aRect.y -= dy; -}}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "setAutoscrolls", -function (autoscrolls) { -}, "~B"); -Clazz_defineMethod (c$, "getAutoscrolls", -function () { -return this.autoscrolls; -}); -Clazz_defineMethod (c$, "superProcessMouseMotionEvent", -function (e) { -Clazz_superCall (this, javax.swing.JComponent, "processMouseMotionEvent", [e]); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "setCreatedDoubleBuffer", -function (newValue) { -this.setFlag (9, newValue); -}, "~B"); -Clazz_defineMethod (c$, "getCreatedDoubleBuffer", -function () { -return this.getFlag (9); -}); -Clazz_defineMethod (c$, "getClientProperties", - function () { -if (this.clientProperties == null) { -this.clientProperties = new javax.swing.ArrayTable (); -}return this.clientProperties; -}); -Clazz_defineMethod (c$, "getClientProperty", -function (key) { -if (this.clientProperties == null) { -return null; -} else { -{ -return this.clientProperties.get (key); -}}}, "~O"); -Clazz_defineMethod (c$, "putClientProperty", -function (key, value) { -if (value == null && this.clientProperties == null) { -return; -}var clientProperties = this.getClientProperties (); -var oldValue; -{ -oldValue = clientProperties.get (key); -if (value != null) { -clientProperties.put (key, value); -} else if (oldValue != null) { -clientProperties.remove (key); -} else { -return; -}}this.clientPropertyChanged (key, oldValue, value); -this.firePropertyChangeObject (key.toString (), oldValue, value); -}, "~O,~O"); -Clazz_defineMethod (c$, "clientPropertyChanged", -function (key, oldValue, newValue) { -}, "~O,~O,~O"); -Clazz_defineMethod (c$, "setUIProperty", -function (propertyName, value) { -if (propertyName === "opaque") { -if (!this.getFlag (24)) { -this.setOpaque ((value).booleanValue ()); -this.setFlag (24, false); -}} else if (propertyName === "autoscrolls") { -if (!this.getFlag (25)) { -this.setAutoscrolls ((value).booleanValue ()); -this.setFlag (25, false); -}} else if (propertyName === "focusTraversalKeysForward") { -} else if (propertyName === "focusTraversalKeysBackward") { -} else { -System.out.println (swingjs.JSToolkit.getClassName (this) + " property \"" + propertyName + "\" cannot be set using this method" + swingjs.JSToolkit.getStackTrace (5)); -}}, "~S,~O"); -c$.isLightweightComponent = Clazz_defineMethod (c$, "isLightweightComponent", -function (c) { -return !(Clazz_instanceOf (c, javax.swing.JApplet) || Clazz_instanceOf (c, javax.swing.JFrame) || Clazz_instanceOf (c, javax.swing.JWindow) || Clazz_instanceOf (c, javax.swing.JDialog)); -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "isOpaque", -function () { -return this.getFlag (3); -}); -Clazz_defineMethod (c$, "setOpaque", -function (isOpaque) { -var oldValue = this.getFlag (3); -this.setFlag (3, isOpaque); -this.setFlag (24, true); -this.firePropertyChangeBool ("opaque", oldValue, isOpaque); -}, "~B"); -Clazz_defineMethod (c$, "rectangleIsObscured", -function (x, y, width, height) { -var numChildren = this.getComponentCount (); -for (var i = 0; i < numChildren; i++) { -var child = this.getComponent (i); -var cx; -var cy; -var cw; -var ch; -cx = child.getX (); -cy = child.getY (); -cw = child.getWidth (); -ch = child.getHeight (); -if (x >= cx && (x + width) <= (cx + cw) && y >= cy && (y + height) <= (cy + ch) && child.isVisible ()) { -if (Clazz_instanceOf (child, javax.swing.JComponent)) { -return (child).isOpaque (); -} else { -return false; -}}} -return false; -}, "~N,~N,~N,~N"); -c$.computeVisibleRect = Clazz_defineMethod (c$, "computeVisibleRect", -function (c, visibleRect) { -var p = c.getParent (); -var bounds = c.getBounds (); -if (p == null || Clazz_instanceOf (p, java.awt.Window) || Clazz_instanceOf (p, java.applet.Applet)) { -visibleRect.reshape (0, 0, bounds.width, bounds.height); -} else { -javax.swing.JComponent.computeVisibleRect (p, visibleRect); -visibleRect.x -= bounds.x; -visibleRect.y -= bounds.y; -javax.swing.SwingUtilities.computeIntersection (0, 0, bounds.width, bounds.height, visibleRect); -}}, "java.awt.Component,java.awt.Rectangle"); -Clazz_defineMethod (c$, "computeVisibleRect", -function (visibleRect) { -javax.swing.JComponent.computeVisibleRect (this, visibleRect); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "getVisibleRect", -function () { -var visibleRect = new java.awt.Rectangle (); -this.computeVisibleRect (visibleRect); -return visibleRect; -}); -Clazz_defineMethod (c$, "getTopLevelAncestor", -function () { -for (var p = this; p != null; p = p.getParent ()) { -if (Clazz_instanceOf (p, java.awt.Window) || Clazz_instanceOf (p, java.applet.Applet)) { -return p; -}} -return null; -}); -Clazz_defineMethod (c$, "getAncestorNotifier", - function () { -return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER); -}); -Clazz_defineMethod (c$, "addAncestorListener", -function (listener) { -var ancestorNotifier = this.getAncestorNotifier (); -if (ancestorNotifier == null) { -ancestorNotifier = new javax.swing.AncestorNotifier (this); -this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, ancestorNotifier); -}ancestorNotifier.addAncestorListener (listener); -}, "javax.swing.event.AncestorListener"); -Clazz_defineMethod (c$, "removeAncestorListener", -function (listener) { -var ancestorNotifier = this.getAncestorNotifier (); -if (ancestorNotifier == null) { -return; -}ancestorNotifier.removeAncestorListener (listener); -if (ancestorNotifier.listenerList.getListenerList ().length == 0) { -ancestorNotifier.removeAllListeners (); -this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, null); -}}, "javax.swing.event.AncestorListener"); -Clazz_defineMethod (c$, "getAncestorListeners", -function () { -var ancestorNotifier = this.getAncestorNotifier (); -if (ancestorNotifier == null) { -return new Array (0); -}return ancestorNotifier.getAncestorListeners (); -}); -Clazz_defineMethod (c$, "getListeners", -function (listenerType) { -var result; -if (listenerType === javax.swing.event.AncestorListener) { -result = this.getAncestorListeners (); -} else if (listenerType === java.beans.PropertyChangeListener) { -result = this.getPropertyChangeListeners (); -} else { -result = this.listenerList.getListeners (listenerType); -}if (result.length == 0) { -return Clazz_superCall (this, javax.swing.JComponent, "getListeners", [listenerType]); -}return result; -}, "Class"); -Clazz_defineMethod (c$, "addNotify", -function () { -Clazz_superCall (this, javax.swing.JComponent, "addNotify", []); -this.firePropertyChangeObject ("ancestor", null, this.getParent ()); -this.registerWithKeyboardManager (false); -this.registerNextFocusableComponent (); -}); -Clazz_defineMethod (c$, "removeNotify", -function () { -Clazz_superCall (this, javax.swing.JComponent, "removeNotify", []); -this.firePropertyChangeObject ("ancestor", this.getParent (), null); -this.unregisterWithKeyboardManager (); -this.deregisterNextFocusableComponent (); -if (this.getCreatedDoubleBuffer ()) { -javax.swing.RepaintManager.currentManager (this).resetDoubleBuffer (); -this.setCreatedDoubleBuffer (false); -}}); -Clazz_defineMethod (c$, "repaint", -function (tm, x, y, width, height) { -javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "repaint", -function (r) { -this.repaint (0, r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "revalidate", -function () { -if (this.getParent () == null) { -return; -}if (javax.swing.SwingUtilities.isEventDispatchThread ()) { -this.invalidate (); -javax.swing.RepaintManager.currentManager (this).addInvalidComponent (this); -} else { -{ -if (this.getFlag (28)) { -return; -}this.setFlag (28, true); -}var callRevalidate = ((Clazz_isClassDefined ("javax.swing.JComponent$2") ? 0 : javax.swing.JComponent.$JComponent$2$ ()), Clazz_innerTypeInstance (javax.swing.JComponent$2, this, null)); -javax.swing.SwingUtilities.invokeLater (callRevalidate); -}}); -Clazz_defineMethod (c$, "isValidateRoot", -function () { -return false; -}); -Clazz_defineMethod (c$, "isOptimizedDrawingEnabled", -function () { -return true; -}); -Clazz_defineMethod (c$, "isPaintingOrigin", -function () { -return false; -}); -Clazz_defineMethod (c$, "paintImmediately", -function (x, y, w, h) { -{ -if (arguments.length == 1) { -var r = x; -x = r.x; -y = r.y; -w = r.width; -h = r.height; -} -}var c = this; -var parent; -if (!this.isShowing ()) { -return; -}while (!(c).isOpaque ()) { -parent = c.getParent (); -if (parent != null) { -x += c.getX (); -y += c.getY (); -c = parent; -} else { -break; -}if (!(Clazz_instanceOf (c, javax.swing.JComponent))) { -break; -}} -if (Clazz_instanceOf (c, javax.swing.JComponent)) { -(c)._paintImmediately (x, y, w, h); -} else { -c.repaint (x, y, w, h); -}}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paintImmediately", -function (r) { -this.paintImmediately (r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "alwaysOnTop", -function () { -return false; -}); -Clazz_defineMethod (c$, "setPaintingChild", -function (paintingChild) { -this.paintingChild = paintingChild; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "_paintImmediately", -function (x, y, w, h) { -var g; -var c; -var tmpX; -var tmpY; -var tmpWidth; -var tmpHeight; -var offsetX = 0; -var offsetY = 0; -var hasBuffer = false; -var bufferedComponent = null; -var paintingComponent = this; -var path = new java.util.ArrayList (7); -var pIndex = -1; -var pCount = 0; -tmpX = tmpY = tmpWidth = tmpHeight = 0; -var paintImmediatelyClip = javax.swing.JComponent.fetchRectangle (); -paintImmediatelyClip.x = x; -paintImmediatelyClip.y = y; -paintImmediatelyClip.width = w; -paintImmediatelyClip.height = h; -var ontop = this.alwaysOnTop () && this.isOpaque (); -if (ontop) { -javax.swing.SwingUtilities.computeIntersection (0, 0, this.getWidth (), this.getHeight (), paintImmediatelyClip); -if (paintImmediatelyClip.width == 0) { -javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); -return; -}}var child; -for (c = this, child = null; c != null && !(Clazz_instanceOf (c, java.awt.Window)) && !(Clazz_instanceOf (c, java.applet.Applet)); child = c, c = c.getParent ()) { -var jc = (Clazz_instanceOf (c, javax.swing.JComponent)) ? c : null; -path.add (c); -if (!ontop && jc != null && !jc.isOptimizedDrawingEnabled ()) { -var resetPC; -if (c !== this) { -if (jc.isPaintingOrigin ()) { -resetPC = true; -} else { -var children = c.getComponents (); -var i = 0; -for (; i < children.length; i++) { -if (children[i] === child) break; -} -switch (jc.getObscuredState (i, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height)) { -case 0: -resetPC = false; -break; -case 2: -javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); -return; -default: -resetPC = true; -break; -} -}} else { -resetPC = false; -}if (resetPC) { -paintingComponent = jc; -pIndex = pCount; -offsetX = offsetY = 0; -hasBuffer = false; -}}pCount++; -if (!ontop) { -var bx = c.getX (); -var by = c.getY (); -tmpWidth = c.getWidth (); -tmpHeight = c.getHeight (); -javax.swing.SwingUtilities.computeIntersection (tmpX, tmpY, tmpWidth, tmpHeight, paintImmediatelyClip); -paintImmediatelyClip.x += bx; -paintImmediatelyClip.y += by; -offsetX += bx; -offsetY += by; -}} -if (c == null || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) { -javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); -return; -}paintingComponent.setFlag (13, true); -paintImmediatelyClip.x -= offsetX; -paintImmediatelyClip.y -= offsetY; -if (paintingComponent !== this) { -var comp; -var i = pIndex; -for (; i > 0; i--) { -comp = path.get (i); -if (Clazz_instanceOf (comp, javax.swing.JComponent)) { -(comp).setPaintingChild (path.get (i - 1)); -}} -}try { -g = javax.swing.JComponent.safelyGetGraphics (paintingComponent, c).createSwingJS (); -try { -if (hasBuffer) { -var rm = javax.swing.RepaintManager.currentManager (bufferedComponent); -rm.beginPaint (); -try { -rm.paint (paintingComponent, bufferedComponent, g, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height); -} finally { -rm.endPaint (); -} -} else { -paintingComponent.paint (g); -}} finally { -g.dispose (); -} -} finally { -if (paintingComponent !== this) { -var comp; -var i = pIndex; -for (; i > 0; i--) { -comp = path.get (i); -if (Clazz_instanceOf (comp, javax.swing.JComponent)) { -(comp).setPaintingChild (null); -}} -}paintingComponent.setFlag (13, false); -} -javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paintToOffscreen", -function (g, x, y, w, h, maxX, maxY) { -try { -this.setFlag (1, true); -if ((y + h) < maxY || (x + w) < maxX) { -this.setFlag (2, true); -}if (this.getFlag (13)) { -this.paint (g); -} else { -if (!this.rectangleIsObscured (x, y, w, h)) { -this.paintComponent (g); -this.paintBorder (g); -}this.paintChildren (g); -}} finally { -this.setFlag (1, false); -this.setFlag (2, false); -} -}, "java.awt.Graphics,~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getObscuredState", - function (compIndex, x, y, width, height) { -var retValue = 0; -var tmpRect = javax.swing.JComponent.fetchRectangle (); -for (var i = compIndex - 1; i >= 0; i--) { -var sibling = this.getComponent (i); -if (!sibling.isVisible ()) { -continue; -}var siblingRect; -var opaque; -if (Clazz_instanceOf (sibling, javax.swing.JComponent)) { -opaque = (sibling).isOpaque (); -if (!opaque) { -if (retValue == 1) { -continue; -}}} else { -opaque = true; -}siblingRect = sibling.getBounds (tmpRect); -if (opaque && x >= siblingRect.x && (x + width) <= (siblingRect.x + siblingRect.width) && y >= siblingRect.y && (y + height) <= (siblingRect.y + siblingRect.height)) { -javax.swing.JComponent.recycleRectangle (tmpRect); -return 2; -} else if (retValue == 0 && !((x + width <= siblingRect.x) || (y + height <= siblingRect.y) || (x >= siblingRect.x + siblingRect.width) || (y >= siblingRect.y + siblingRect.height))) { -retValue = 1; -}} -javax.swing.JComponent.recycleRectangle (tmpRect); -return retValue; -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "checkIfChildObscuredBySibling", -function () { -return true; -}); -Clazz_defineMethod (c$, "setFlag", - function (aFlag, aValue) { -if (aValue) { -this.flags |= (1 << aFlag); -} else { -this.flags &= ~(1 << aFlag); -}}, "~N,~B"); -Clazz_defineMethod (c$, "getFlag", - function (aFlag) { -var mask = (1 << aFlag); -return ((this.flags & mask) == mask); -}, "~N"); -Clazz_defineMethod (c$, "setDoubleBuffered", -function (aFlag) { -}, "~B"); -Clazz_overrideMethod (c$, "isDoubleBuffered", -function () { -return this.getFlag (0); -}); -Clazz_defineMethod (c$, "getRootPane", -function () { -return javax.swing.SwingUtilities.getRootPane (this); -}); -Clazz_defineMethod (c$, "paramString", -function () { -var preferredSizeString = (this.isPreferredSizeSet () ? this.getPreferredSize ().toString () : ""); -var minimumSizeString = (this.isMinimumSizeSet () ? this.getMinimumSize ().toString () : ""); -var maximumSizeString = (this.isMaximumSizeSet () ? this.getMaximumSize ().toString () : ""); -var borderString = (this.border == null ? "" : (this.border === this ? "this" : this.border.toString ())); -return Clazz_superCall (this, javax.swing.JComponent, "paramString", []) + ",alignmentX=" + this.alignmentX + ",alignmentY=" + this.alignmentY + ",border=" + borderString + ",flags=" + this.flags + ",maximumSize=" + maximumSizeString + ",minimumSize=" + minimumSizeString + ",preferredSize=" + preferredSizeString; -}); -c$.$JComponent$ActionStandin$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -this.actionListener = null; -this.command = null; -this.action = null; -Clazz_instantialize (this, arguments); -}, javax.swing.JComponent, "ActionStandin", null, javax.swing.Action); -Clazz_makeConstructor (c$, -function (a, b) { -this.actionListener = a; -if (Clazz_instanceOf (a, javax.swing.Action)) { -this.action = a; -} else { -this.action = null; -}this.command = b; -}, "java.awt.event.ActionListener,~S"); -Clazz_defineMethod (c$, "getValue", -function (a) { -if (a != null) { -if (a.equals ("ActionCommandKey")) { -return this.command; -}if (this.action != null) { -return this.action.getValue (a); -}if (a.equals ("Name")) { -return "ActionStandin"; -}}return null; -}, "~S"); -Clazz_defineMethod (c$, "isEnabled", -function () { -if (this.actionListener == null) { -return false; -}if (this.action == null) { -return true; -}return this.action.isEnabled (); -}); -Clazz_defineMethod (c$, "actionPerformed", -function (a) { -if (this.actionListener != null) { -this.actionListener.actionPerformed (a); -}}, "java.awt.event.ActionEvent"); -Clazz_overrideMethod (c$, "putValue", -function (a, b) { -}, "~S,~O"); -Clazz_overrideMethod (c$, "setEnabled", -function (a) { -}, "~B"); -Clazz_overrideMethod (c$, "addPropertyChangeListener", -function (a) { -}, "java.beans.PropertyChangeListener"); -Clazz_overrideMethod (c$, "removePropertyChangeListener", -function (a) { -}, "java.beans.PropertyChangeListener"); -c$ = Clazz_p0p (); -}; -c$.$JComponent$2$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing, "JComponent$2", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -{ -this.b$["javax.swing.JComponent"].setFlag (28, false); -}this.b$["javax.swing.JComponent"].revalidate (); -}); -c$ = Clazz_p0p (); -}; -c$.$JComponent$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing, "JComponent$1", null, jssun.awt.RequestFocusController); -Clazz_overrideMethod (c$, "acceptRequestFocus", -function (from, to, temporary, focusedWindowChangeAllowed, cause) { -if ((to == null) || !(Clazz_instanceOf (to, javax.swing.JComponent))) { -return true; -}if ((from == null) || !(Clazz_instanceOf (from, javax.swing.JComponent))) { -return true; -}var target = to; -if (!target.getVerifyInputWhenFocusTarget ()) { -return true; -}var jFocusOwner = from; -var iv = jFocusOwner.getInputVerifier (); -if (iv == null) { -return true; -} else { -var currentSource = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY); -if (currentSource === jFocusOwner) { -return true; -}javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, jFocusOwner); -try { -return iv.shouldYieldFocus (jFocusOwner); -} finally { -if (currentSource != null) { -javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, currentSource); -} else { -javax.swing.SwingUtilities.appContextRemove (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY); -}} -}}, "java.awt.Component,java.awt.Component,~B,~B,jssun.awt.CausedFocusEvent.Cause"); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.array = null; -this.count = 0; -this.capacity = 0; -Clazz_instantialize (this, arguments); -}, javax.swing.JComponent, "IntVector"); -Clazz_defineMethod (c$, "size", -function () { -return this.count; -}); -Clazz_defineMethod (c$, "elementAt", -function (a) { -return this.array[a]; -}, "~N"); -Clazz_defineMethod (c$, "addElement", -function (a) { -if (this.count == this.capacity) { -this.capacity = (this.capacity + 2) * 2; -var b = Clazz_newIntArray (this.capacity, 0); -if (this.count > 0) { -System.arraycopy (this.array, 0, b, 0, this.count); -}this.array = b; -}this.array[this.count++] = a; -}, "~N"); -Clazz_defineMethod (c$, "setElementAt", -function (a, b) { -this.array[b] = a; -}, "~N,~N"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.JComponent, "KeyboardState"); -c$.getKeyCodeArray = Clazz_defineMethod (c$, "getKeyCodeArray", -function () { -var a = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.KeyboardState.keyCodesKey); -if (a == null) { -a = new javax.swing.JComponent.IntVector (); -javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.KeyboardState.keyCodesKey, a); -}return a; -}); -c$.registerKeyPressed = Clazz_defineMethod (c$, "registerKeyPressed", -function (a) { -var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray (); -var c = b.size (); -var d; -for (d = 0; d < c; d++) { -if (b.elementAt (d) == -1) { -b.setElementAt (a, d); -return; -}} -b.addElement (a); -}, "~N"); -c$.registerKeyReleased = Clazz_defineMethod (c$, "registerKeyReleased", -function (a) { -var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray (); -var c = b.size (); -var d; -for (d = 0; d < c; d++) { -if (b.elementAt (d) == a) { -b.setElementAt (-1, d); -return; -}} -}, "~N"); -c$.keyIsPressed = Clazz_defineMethod (c$, "keyIsPressed", -function (a) { -var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray (); -var c = b.size (); -var d; -for (d = 0; d < c; d++) { -if (b.elementAt (d) == a) { -return true; -}} -return false; -}, "~N"); -c$.shouldProcess = Clazz_defineMethod (c$, "shouldProcess", -function (a) { -switch (a.getID ()) { -case 401: -if (!javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ())) { -javax.swing.JComponent.KeyboardState.registerKeyPressed (a.getKeyCode ()); -}return true; -case 402: -if (javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ()) || a.getKeyCode () == 154) { -javax.swing.JComponent.KeyboardState.registerKeyReleased (a.getKeyCode ()); -return true; -}return false; -case 400: -return true; -default: -return false; -} -}, "java.awt.event.KeyEvent"); -c$.keyCodesKey = c$.prototype.keyCodesKey = javax.swing.JComponent.KeyboardState; -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"uiClassID", "ComponentUI", -"managingFocusForwardTraversalKeys", null, -"managingFocusBackwardTraversalKeys", null, -"NOT_OBSCURED", 0, -"PARTIALLY_OBSCURED", 1, -"COMPLETELY_OBSCURED", 2, -"DEBUG_GRAPHICS_LOADED", false); -c$.INPUT_VERIFIER_SOURCE_KEY = c$.prototype.INPUT_VERIFIER_SOURCE_KEY = new Clazz._O (); -Clazz_defineStatics (c$, -"WHEN_FOCUSED", 0, -"WHEN_ANCESTOR_OF_FOCUSED_COMPONENT", 1, -"WHEN_IN_FOCUSED_WINDOW", 2, -"UNDEFINED_CONDITION", -1, -"WHEN_IN_FOCUSED_WINDOW_BINDINGS", "_WhenInFocusedWindow", -"TOOL_TIP_TEXT_KEY", "ToolTipText", -"NEXT_FOCUS", "nextFocus", -"IS_DOUBLE_BUFFERED", 0, -"ANCESTOR_USING_BUFFER", 1, -"IS_PAINTING_TILE", 2, -"IS_OPAQUE", 3, -"FOCUS_INPUTMAP_CREATED", 5, -"ANCESTOR_INPUTMAP_CREATED", 6, -"WIF_INPUTMAP_CREATED", 7, -"ACTIONMAP_CREATED", 8, -"CREATED_DOUBLE_BUFFER", 9, -"IS_PRINTING", 11, -"IS_PRINTING_ALL", 12, -"IS_REPAINTING", 13, -"REQUEST_FOCUS_DISABLED", 22, -"INHERITS_POPUP_MENU", 23, -"OPAQUE_SET", 24, -"AUTOSCROLLS_SET", 25, -"REVALIDATE_RUNNABLE_SCHEDULED", 28); -c$.tempRectangles = c$.prototype.tempRectangles = new java.util.ArrayList (11); -Clazz_defineStatics (c$, -"defaultLocale", "JComponent.defaultLocale", -"componentObtainingGraphicsFrom", null); -c$.componentObtainingGraphicsFromLock = c$.prototype.componentObtainingGraphicsFromLock = new Clazz._O (); -c$.focusController = c$.prototype.focusController = ((Clazz_isClassDefined ("javax.swing.JComponent$1") ? 0 : javax.swing.JComponent.$JComponent$1$ ()), Clazz_innerTypeInstance (javax.swing.JComponent$1, this, null)); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.event.ActionListener"], "javax.swing.Action", null, function () { -c$ = Clazz_declareInterface (javax.swing, "Action", java.awt.event.ActionListener); -Clazz_defineStatics (c$, -"DEFAULT", "Default", -"NAME", "Name", -"SHORT_DESCRIPTION", "ShortDescription", -"LONG_DESCRIPTION", "LongDescription", -"SMALL_ICON", "SmallIcon", -"ACTION_COMMAND_KEY", "ActionCommandKey", -"ACCELERATOR_KEY", "AcceleratorKey", -"MNEMONIC_KEY", "MnemonicKey", -"SELECTED_KEY", "SwingSelectedKey", -"DISPLAYED_MNEMONIC_INDEX_KEY", "SwingDisplayedMnemonicIndexKey", -"LARGE_ICON_KEY", "SwingLargeIconKey"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Frame", "java.awt.event.WindowListener", "javax.swing.SwingConstants"], "javax.swing.SwingUtilities", ["java.lang.Character", "$.Error", "$.Thread", "java.applet.Applet", "java.awt.Component", "$.Container", "$.EventQueue", "$.Point", "$.Rectangle", "$.Window", "java.awt.event.ActionEvent", "$.MouseEvent", "$.MouseWheelEvent", "javax.swing.JComponent", "javax.swing.JComponent.ActionStandin", "javax.swing.JRootPane", "$.RootPaneContainer", "javax.swing.event.MenuDragMouseEvent", "javax.swing.plaf.UIResource", "jssun.awt.AppContext", "jssun.swing.UIAction", "swingjs.api.Interface"], function () { -c$ = Clazz_declareType (javax.swing, "SwingUtilities", null, javax.swing.SwingConstants); -c$.installSwingDropTargetAsNecessary = Clazz_defineMethod (c$, "installSwingDropTargetAsNecessary", -function (c, t) { -}, "java.awt.Component,javax.swing.TransferHandler"); -c$.isRectangleContainingRectangle = Clazz_defineMethod (c$, "isRectangleContainingRectangle", -function (a, b) { -if (b.x >= a.x && (b.x + b.width) <= (a.x + a.width) && b.y >= a.y && (b.y + b.height) <= (a.y + a.height)) { -return true; -}return false; -}, "java.awt.Rectangle,java.awt.Rectangle"); -c$.getLocalBounds = Clazz_defineMethod (c$, "getLocalBounds", -function (aComponent) { -var b = new java.awt.Rectangle (aComponent.getBounds ()); -b.x = b.y = 0; -return b; -}, "java.awt.Component"); -c$.getWindowAncestor = Clazz_defineMethod (c$, "getWindowAncestor", -function (c) { -for (var p = c.getParent (); p != null; p = p.getParent ()) { -if (Clazz_instanceOf (p, java.awt.Window)) { -return p; -}} -return null; -}, "java.awt.Component"); -c$.convertScreenLocationToParent = Clazz_defineMethod (c$, "convertScreenLocationToParent", -function (parent, x, y) { -for (var p = parent; p != null; p = p.getParent ()) { -if (Clazz_instanceOf (p, java.awt.Window)) { -var point = new java.awt.Point (x, y); -javax.swing.SwingUtilities.convertPointFromScreen (point, parent); -return point; -}} -throw new Error ("convertScreenLocationToParent: no window ancestor"); -}, "java.awt.Container,~N,~N"); -c$.convertPoint = Clazz_defineMethod (c$, "convertPoint", -function (source, aPoint, destination) { -var p; -if (source == null && destination == null) return aPoint; -if (source == null) { -source = javax.swing.SwingUtilities.getWindowAncestor (destination); -if (source == null) throw new Error ("Source component not connected to component tree hierarchy"); -}p = new java.awt.Point (aPoint); -javax.swing.SwingUtilities.convertPointToScreen (p, source); -if (destination == null) { -destination = javax.swing.SwingUtilities.getWindowAncestor (source); -if (destination == null) throw new Error ("Destination component not connected to component tree hierarchy"); -}javax.swing.SwingUtilities.convertPointFromScreen (p, destination); -return p; -}, "java.awt.Component,java.awt.Point,java.awt.Component"); -c$.convertPoint = Clazz_defineMethod (c$, "convertPoint", -function (source, x, y, destination) { -var point = new java.awt.Point (x, y); -return javax.swing.SwingUtilities.convertPoint (source, point, destination); -}, "java.awt.Component,~N,~N,java.awt.Component"); -c$.convertRectangle = Clazz_defineMethod (c$, "convertRectangle", -function (source, aRectangle, destination) { -var point = new java.awt.Point (aRectangle.x, aRectangle.y); -point = javax.swing.SwingUtilities.convertPoint (source, point, destination); -return new java.awt.Rectangle (point.x, point.y, aRectangle.width, aRectangle.height); -}, "java.awt.Component,java.awt.Rectangle,java.awt.Component"); -c$.getAncestorOfClass = Clazz_defineMethod (c$, "getAncestorOfClass", -function (c, comp) { -if (comp == null || c == null) return null; -var parent = comp.getParent (); -while (parent != null && !(c.isInstance (parent))) parent = parent.getParent (); - -return parent; -}, "Class,java.awt.Component"); -c$.getAncestorNamed = Clazz_defineMethod (c$, "getAncestorNamed", -function (name, comp) { -if (comp == null || name == null) return null; -var parent = comp.getParent (); -while (parent != null && !(name.equals (parent.getName ()))) parent = parent.getParent (); - -return parent; -}, "~S,java.awt.Component"); -c$.getDeepestComponentAt = Clazz_defineMethod (c$, "getDeepestComponentAt", -function (parent, x, y) { -if (!parent.contains (x, y)) { -return null; -}if (Clazz_instanceOf (parent, java.awt.Container)) { -var components = (parent).getComponents (); -for (var i = 0; i < components.length; i++) { -var comp = components[i]; -if (comp != null && comp.isVisible ()) { -var loc = comp.getLocation (); -if (Clazz_instanceOf (comp, java.awt.Container)) { -comp = javax.swing.SwingUtilities.getDeepestComponentAt (comp, x - loc.x, y - loc.y); -} else { -comp = comp.getComponentAt (x - loc.x, y - loc.y); -}if (comp != null && comp.isVisible ()) { -return comp; -}}} -}return parent; -}, "java.awt.Component,~N,~N"); -c$.convertMouseEvent = Clazz_defineMethod (c$, "convertMouseEvent", -function (source, sourceEvent, destination) { -var p = javax.swing.SwingUtilities.convertPoint (source, new java.awt.Point (sourceEvent.getX (), sourceEvent.getY ()), destination); -var newSource; -if (destination != null) newSource = destination; - else newSource = source; -var newEvent; -if (Clazz_instanceOf (sourceEvent, java.awt.event.MouseWheelEvent)) { -var sourceWheelEvent = sourceEvent; -newEvent = new java.awt.event.MouseWheelEvent (newSource, sourceWheelEvent.getID (), sourceWheelEvent.getWhen (), sourceWheelEvent.getModifiers (), p.x, p.y, sourceWheelEvent.getXOnScreen (), sourceWheelEvent.getYOnScreen (), sourceWheelEvent.getClickCount (), sourceWheelEvent.isPopupTrigger (), sourceWheelEvent.getScrollType (), sourceWheelEvent.getScrollAmount (), sourceWheelEvent.getWheelRotation ()); -} else if (Clazz_instanceOf (sourceEvent, javax.swing.event.MenuDragMouseEvent)) { -var sourceMenuDragEvent = sourceEvent; -newEvent = new javax.swing.event.MenuDragMouseEvent (newSource, sourceMenuDragEvent.getID (), sourceMenuDragEvent.getWhen (), sourceMenuDragEvent.getModifiers (), p.x, p.y, sourceMenuDragEvent.getXOnScreen (), sourceMenuDragEvent.getYOnScreen (), sourceMenuDragEvent.getClickCount (), sourceMenuDragEvent.isPopupTrigger (), sourceMenuDragEvent.getPath (), sourceMenuDragEvent.getMenuSelectionManager ()); -} else { -newEvent = new java.awt.event.MouseEvent (newSource, sourceEvent.getID (), sourceEvent.getWhen (), sourceEvent.getModifiers (), p.x, p.y, sourceEvent.getXOnScreen (), sourceEvent.getYOnScreen (), sourceEvent.getClickCount (), sourceEvent.isPopupTrigger (), 0); -}return newEvent; -}, "java.awt.Component,java.awt.event.MouseEvent,java.awt.Component"); -c$.convertPointToScreen = Clazz_defineMethod (c$, "convertPointToScreen", -function (p, c) { -var x; -var y; -do { -if (Clazz_instanceOf (c, javax.swing.JComponent)) { -x = (c).getX (); -y = (c).getY (); -} else if (Clazz_instanceOf (c, java.applet.Applet) || Clazz_instanceOf (c, java.awt.Window)) { -try { -var pp = c.getLocationOnScreen (); -x = pp.x; -y = pp.y; -} catch (icse) { -if (Clazz_exceptionOf (icse, java.awt.IllegalComponentStateException)) { -x = c.getX (); -y = c.getY (); -} else { -throw icse; -} -} -} else { -x = c.getX (); -y = c.getY (); -}p.x += x; -p.y += y; -if (Clazz_instanceOf (c, java.awt.Window) || Clazz_instanceOf (c, java.applet.Applet)) break; -c = c.getParent (); -} while (c != null); -}, "java.awt.Point,java.awt.Component"); -c$.convertPointFromScreen = Clazz_defineMethod (c$, "convertPointFromScreen", -function (p, c) { -var x; -var y; -do { -if (Clazz_instanceOf (c, javax.swing.JComponent)) { -x = (c).getX (); -y = (c).getY (); -} else if (Clazz_instanceOf (c, java.applet.Applet) || Clazz_instanceOf (c, java.awt.Window)) { -try { -var pp = c.getLocationOnScreen (); -x = pp.x; -y = pp.y; -} catch (icse) { -if (Clazz_exceptionOf (icse, java.awt.IllegalComponentStateException)) { -x = c.getX (); -y = c.getY (); -} else { -throw icse; -} -} -} else { -x = c.getX (); -y = c.getY (); -}p.x -= x; -p.y -= y; -if (Clazz_instanceOf (c, java.awt.Window) || Clazz_instanceOf (c, java.applet.Applet)) break; -c = c.getParent (); -} while (c != null); -}, "java.awt.Point,java.awt.Component"); -c$.windowForComponent = Clazz_defineMethod (c$, "windowForComponent", -function (c) { -return javax.swing.SwingUtilities.getWindowAncestor (c); -}, "java.awt.Component"); -c$.isDescendingFrom = Clazz_defineMethod (c$, "isDescendingFrom", -function (a, b) { -if (a === b) return true; -for (var p = a.getParent (); p != null; p = p.getParent ()) if (p === b) return true; - -return false; -}, "java.awt.Component,java.awt.Component"); -c$.computeIntersection = Clazz_defineMethod (c$, "computeIntersection", -function (x, y, width, height, dest) { -var x1 = (x > dest.x) ? x : dest.x; -var x2 = ((x + width) < (dest.x + dest.width)) ? (x + width) : (dest.x + dest.width); -var y1 = (y > dest.y) ? y : dest.y; -var y2 = ((y + height) < (dest.y + dest.height) ? (y + height) : (dest.y + dest.height)); -dest.x = x1; -dest.y = y1; -dest.width = x2 - x1; -dest.height = y2 - y1; -if (dest.width < 0 || dest.height < 0) { -dest.x = dest.y = dest.width = dest.height = 0; -}return dest; -}, "~N,~N,~N,~N,java.awt.Rectangle"); -c$.computeUnion = Clazz_defineMethod (c$, "computeUnion", -function (x, y, width, height, dest) { -var x1 = (x < dest.x) ? x : dest.x; -var x2 = ((x + width) > (dest.x + dest.width)) ? (x + width) : (dest.x + dest.width); -var y1 = (y < dest.y) ? y : dest.y; -var y2 = ((y + height) > (dest.y + dest.height)) ? (y + height) : (dest.y + dest.height); -dest.x = x1; -dest.y = y1; -dest.width = (x2 - x1); -dest.height = (y2 - y1); -return dest; -}, "~N,~N,~N,~N,java.awt.Rectangle"); -c$.computeDifference = Clazz_defineMethod (c$, "computeDifference", -function (rectA, rectB) { -if (rectB == null || !rectA.intersects (rectB) || javax.swing.SwingUtilities.isRectangleContainingRectangle (rectB, rectA)) { -return new Array (0); -}var t = new java.awt.Rectangle (); -var a = null; -var b = null; -var c = null; -var d = null; -var result; -var rectCount = 0; -if (javax.swing.SwingUtilities.isRectangleContainingRectangle (rectA, rectB)) { -t.x = rectA.x; -t.y = rectA.y; -t.width = rectB.x - rectA.x; -t.height = rectA.height; -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.x = rectB.x; -t.y = rectA.y; -t.width = rectB.width; -t.height = rectB.y - rectA.y; -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}t.x = rectB.x; -t.y = rectB.y + rectB.height; -t.width = rectB.width; -t.height = rectA.y + rectA.height - (rectB.y + rectB.height); -if (t.width > 0 && t.height > 0) { -c = new java.awt.Rectangle (t); -rectCount++; -}t.x = rectB.x + rectB.width; -t.y = rectA.y; -t.width = rectA.x + rectA.width - (rectB.x + rectB.width); -t.height = rectA.height; -if (t.width > 0 && t.height > 0) { -d = new java.awt.Rectangle (t); -rectCount++; -}} else { -if (rectB.x <= rectA.x && rectB.y <= rectA.y) { -if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) { -t.x = rectA.x; -t.y = rectB.y + rectB.height; -t.width = rectA.width; -t.height = rectA.y + rectA.height - (rectB.y + rectB.height); -if (t.width > 0 && t.height > 0) { -a = t; -rectCount++; -}} else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) { -t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); -if (t.width > 0 && t.height > 0) { -a = t; -rectCount++; -}} else { -t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), (rectB.y + rectB.height) - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}}} else if (rectB.x <= rectA.x && (rectB.y + rectB.height) >= (rectA.y + rectA.height)) { -if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) { -t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -a = t; -rectCount++; -}} else { -t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape ((rectB.x + rectB.width), rectB.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), (rectA.y + rectA.height) - rectB.y); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}}} else if (rectB.x <= rectA.x) { -if ((rectB.x + rectB.width) >= (rectA.x + rectA.width)) { -t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}} else { -t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape ((rectB.x + rectB.width), rectB.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectB.height); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); -if (t.width > 0 && t.height > 0) { -c = new java.awt.Rectangle (t); -rectCount++; -}}} else if (rectB.x <= (rectA.x + rectA.width) && (rectB.x + rectB.width) > (rectA.x + rectA.width)) { -if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) { -t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); -if (t.width > 0 && t.height > 0) { -a = t; -rectCount++; -}} else if (rectB.y <= rectA.y) { -t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, (rectB.y + rectB.height) - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}} else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) { -t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, rectB.y, rectB.x - rectA.x, (rectA.y + rectA.height) - rectB.y); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}} else { -t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, rectB.y, rectB.x - rectA.x, rectB.height); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); -if (t.width > 0 && t.height > 0) { -c = new java.awt.Rectangle (t); -rectCount++; -}}} else if (rectB.x >= rectA.x && (rectB.x + rectB.width) <= (rectA.x + rectA.width)) { -if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) { -t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}} else if (rectB.y <= rectA.y) { -t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectB.x, (rectB.y + rectB.height), rectB.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); -if (t.width > 0 && t.height > 0) { -c = new java.awt.Rectangle (t); -rectCount++; -}} else { -t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); -if (t.width > 0 && t.height > 0) { -a = new java.awt.Rectangle (t); -rectCount++; -}t.reshape (rectB.x, rectA.y, rectB.width, rectB.y - rectA.y); -if (t.width > 0 && t.height > 0) { -b = new java.awt.Rectangle (t); -rectCount++; -}t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); -if (t.width > 0 && t.height > 0) { -c = new java.awt.Rectangle (t); -rectCount++; -}}}}result = new Array (rectCount); -rectCount = 0; -if (a != null) result[rectCount++] = a; -if (b != null) result[rectCount++] = b; -if (c != null) result[rectCount++] = c; -if (d != null) result[rectCount++] = d; -return result; -}, "java.awt.Rectangle,java.awt.Rectangle"); -c$.isLeftMouseButton = Clazz_defineMethod (c$, "isLeftMouseButton", -function (anEvent) { -return ((anEvent.getModifiers () & 16) != 0); -}, "java.awt.event.MouseEvent"); -c$.isMiddleMouseButton = Clazz_defineMethod (c$, "isMiddleMouseButton", -function (anEvent) { -return ((anEvent.getModifiers () & 8) == 8); -}, "java.awt.event.MouseEvent"); -c$.isRightMouseButton = Clazz_defineMethod (c$, "isRightMouseButton", -function (anEvent) { -return ((anEvent.getModifiers () & 4) == 4); -}, "java.awt.event.MouseEvent"); -c$.paintComponent = Clazz_defineMethod (c$, "paintComponent", -function (g, c, p, x, y, w, h) { -javax.swing.SwingUtilities.getCellRendererPane (c, p).paintComponent (g, c, p, x, y, w, h, false); -}, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N"); -c$.paintComponent = Clazz_defineMethod (c$, "paintComponent", -function (g, c, p, r) { -javax.swing.SwingUtilities.paintComponent (g, c, p, r.x, r.y, r.width, r.height); -}, "java.awt.Graphics,java.awt.Component,java.awt.Container,java.awt.Rectangle"); -c$.getCellRendererPane = Clazz_defineMethod (c$, "getCellRendererPane", - function (c, p) { -var shell = c.getParent (); -if (Clazz_instanceOf (shell, javax.swing.CellRendererPane)) { -if (shell.getParent () !== p) { -p.add (shell); -}} else { -shell = swingjs.api.Interface.getInstance ("javax.swing.CellRendererPane", false); -shell.add (c); -p.add (shell); -}return shell; -}, "java.awt.Component,java.awt.Container"); -c$.updateComponentTreeUI = Clazz_defineMethod (c$, "updateComponentTreeUI", -function (c) { -javax.swing.SwingUtilities.updateComponentTreeUI0 (c); -c.invalidate (); -c.validate (); -c.repaint (); -}, "java.awt.Component"); -c$.updateComponentTreeUI0 = Clazz_defineMethod (c$, "updateComponentTreeUI0", - function (c) { -if (Clazz_instanceOf (c, javax.swing.JComponent)) { -var jc = c; -jc.updateUI (); -var jpm = jc.getComponentPopupMenu (); -if (jpm != null) { -javax.swing.SwingUtilities.updateComponentTreeUI (jpm); -}}var children = null; -if (Clazz_instanceOf (c, javax.swing.JMenu)) { -children = (c).getMenuComponents (); -} else if (Clazz_instanceOf (c, java.awt.Container)) { -children = (c).getComponents (); -}if (children != null) { -for (var i = 0; i < children.length; i++) { -javax.swing.SwingUtilities.updateComponentTreeUI0 (children[i]); -} -}}, "java.awt.Component"); -c$.invokeLater = Clazz_defineMethod (c$, "invokeLater", -function (doRun) { -java.awt.EventQueue.invokeLater (doRun); -}, "Runnable"); -c$.invokeAndWait = Clazz_defineMethod (c$, "invokeAndWait", -function (doRun) { -java.awt.EventQueue.invokeAndWait (doRun); -}, "Runnable"); -c$.isEventDispatchThread = Clazz_defineMethod (c$, "isEventDispatchThread", -function () { -return java.awt.EventQueue.isDispatchThread (); -}); -c$.getRootPane = Clazz_defineMethod (c$, "getRootPane", -function (c) { -if (Clazz_instanceOf (c, javax.swing.RootPaneContainer)) { -return (c).getRootPane (); -}for (; c != null; c = c.getParent ()) { -if (Clazz_instanceOf (c, javax.swing.JRootPane)) { -return c; -}} -return null; -}, "java.awt.Component"); -c$.getRoot = Clazz_defineMethod (c$, "getRoot", -function (c) { -var applet = null; -for (var p = c; p != null; p = p.getParent ()) { -if (Clazz_instanceOf (p, java.awt.Window)) { -return p; -}if (Clazz_instanceOf (p, java.applet.Applet)) { -applet = p; -}} -return applet; -}, "java.awt.Component"); -c$.processKeyBindings = Clazz_defineMethod (c$, "processKeyBindings", -function (event) { -if (event != null) { -if (event.isConsumed ()) { -return false; -}var component = event.getComponent (); -var pressed = (event.getID () == 401); -if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (event)) { -return false; -}while (component != null) { -if (Clazz_instanceOf (component, javax.swing.JComponent)) { -return (component).processKeyBindings (event, pressed); -}if ((Clazz_instanceOf (component, java.applet.Applet)) || (Clazz_instanceOf (component, java.awt.Window))) { -return javax.swing.JComponent.processKeyBindingsForAllComponents (event, component, pressed); -}component = component.getParent (); -} -}return false; -}, "java.awt.event.KeyEvent"); -c$.isValidKeyEventForKeyBindings = Clazz_defineMethod (c$, "isValidKeyEventForKeyBindings", -function (e) { -if (e.getID () == 400) { -var mod = e.getModifiers (); -if (((mod & 8) != 0) && ((mod & 2) == 0)) { -return false; -}}return true; -}, "java.awt.event.KeyEvent"); -c$.notifyAction = Clazz_defineMethod (c$, "notifyAction", -function (action, ks, event, sender, modifiers) { -if (action == null) { -return false; -}if (Clazz_instanceOf (action, jssun.swing.UIAction)) { -if (!(action).isEnabled (sender)) { -return false; -}} else if (!action.isEnabled ()) { -return false; -}var commandO; -var stayNull; -commandO = action.getValue ("ActionCommandKey"); -if (commandO == null && (Clazz_instanceOf (action, javax.swing.JComponent.ActionStandin))) { -stayNull = true; -} else { -stayNull = false; -}var command; -if (commandO != null) { -command = commandO.toString (); -} else if (!stayNull && event.getKeyChar () != '\uffff') { -command = String.valueOf (event.getKeyChar ()); -} else { -command = null; -}action.actionPerformed ( new java.awt.event.ActionEvent (sender, 1001, command, event.getWhen (), modifiers)); -return true; -}, "javax.swing.Action,javax.swing.KeyStroke,java.awt.event.KeyEvent,~O,~N"); -c$.replaceUIInputMap = Clazz_defineMethod (c$, "replaceUIInputMap", -function (component, type, uiInputMap) { -var map = component.getInputMap (type, (uiInputMap != null)); -while (map != null) { -var parent = map.getParent (); -if (parent == null || (Clazz_instanceOf (parent, javax.swing.plaf.UIResource))) { -map.setParent (uiInputMap); -return; -}map = parent; -} -}, "javax.swing.JComponent,~N,javax.swing.InputMap"); -c$.replaceUIActionMap = Clazz_defineMethod (c$, "replaceUIActionMap", -function (component, uiActionMap) { -var map = component.getActionMap ((uiActionMap != null)); -;while (map != null) { -var parent = map.getParent (); -if (parent == null || (Clazz_instanceOf (parent, javax.swing.plaf.UIResource))) { -map.setParent (uiActionMap); -return; -}map = parent; -} -}, "javax.swing.JComponent,javax.swing.ActionMap"); -c$.getUIInputMap = Clazz_defineMethod (c$, "getUIInputMap", -function (component, condition) { -var map = component.getInputMap (condition, false); -while (map != null) { -var parent = map.getParent (); -if (Clazz_instanceOf (parent, javax.swing.plaf.UIResource)) { -return parent; -}map = parent; -} -return null; -}, "javax.swing.JComponent,~N"); -c$.getUIActionMap = Clazz_defineMethod (c$, "getUIActionMap", -function (component) { -var map = component.getActionMap (false); -while (map != null) { -var parent = map.getParent (); -if (Clazz_instanceOf (parent, javax.swing.plaf.UIResource)) { -return parent; -}map = parent; -} -return null; -}, "javax.swing.JComponent"); -c$.getSharedOwnerFrame = Clazz_defineMethod (c$, "getSharedOwnerFrame", -function () { -var sharedOwnerFrame = javax.swing.SwingUtilities.appContextGet (javax.swing.SwingUtilities.sharedOwnerFrameKey); -if (sharedOwnerFrame == null) { -sharedOwnerFrame = new javax.swing.SwingUtilities.SharedOwnerFrame (); -javax.swing.SwingUtilities.appContextPut (javax.swing.SwingUtilities.sharedOwnerFrameKey, sharedOwnerFrame); -}return sharedOwnerFrame; -}); -c$.getSharedOwnerFrameShutdownListener = Clazz_defineMethod (c$, "getSharedOwnerFrameShutdownListener", -function () { -var sharedOwnerFrame = javax.swing.SwingUtilities.getSharedOwnerFrame (); -return sharedOwnerFrame; -}); -c$.appContextGet = Clazz_defineMethod (c$, "appContextGet", -function (key) { -return jssun.awt.AppContext.getAppContext ().get (key); -}, "~O"); -c$.appContextPut = Clazz_defineMethod (c$, "appContextPut", -function (key, value) { -jssun.awt.AppContext.getAppContext ().put (key, value); -}, "~O,~O"); -c$.appContextRemove = Clazz_defineMethod (c$, "appContextRemove", -function (key) { -jssun.awt.AppContext.getAppContext ().remove (key); -}, "~O"); -c$.loadSystemClass = Clazz_defineMethod (c$, "loadSystemClass", -function (className) { -return Clazz._4Name (className, true, Thread.currentThread ().getContextClassLoader ()); -}, "~S"); -c$.isLeftToRight = Clazz_defineMethod (c$, "isLeftToRight", -function (c) { -return c.getComponentOrientation ().isLeftToRight (); -}, "java.awt.Component"); -c$.doesIconReferenceImage = Clazz_defineMethod (c$, "doesIconReferenceImage", -function (icon, image) { -var iconImage = (icon != null && (Clazz_instanceOf (icon, javax.swing.ImageIcon))) ? (icon).getImage () : null; -return (iconImage === image); -}, "javax.swing.Icon,java.awt.Image"); -c$.findDisplayedMnemonicIndex = Clazz_defineMethod (c$, "findDisplayedMnemonicIndex", -function (text, mnemonic) { -if (text == null || mnemonic == 0) { -return -1; -}var uc = Character.toUpperCase (String.fromCharCode (mnemonic)); -var lc = Character.toLowerCase (String.fromCharCode (mnemonic)); -var uci = text.indexOf (uc); -var lci = text.indexOf (lc); -if (uci == -1) { -return lci; -} else if (lci == -1) { -return uci; -} else { -return (lci < uci) ? lci : uci; -}}, "~S,~N"); -c$.calculateInnerArea = Clazz_defineMethod (c$, "calculateInnerArea", -function (c, r) { -if (c == null) { -return null; -}var rect = r; -var insets = c.getInsets (); -if (rect == null) { -rect = new java.awt.Rectangle (); -}rect.x = insets.left; -rect.y = insets.top; -rect.width = c.getWidth () - insets.left - insets.right; -rect.height = c.getHeight () - insets.top - insets.bottom; -return rect; -}, "javax.swing.JComponent,java.awt.Rectangle"); -c$.updateRendererOrEditorUI = Clazz_defineMethod (c$, "updateRendererOrEditorUI", -function (rendererOrEditor) { -if (rendererOrEditor == null) { -return; -}var component = null; -if (Clazz_instanceOf (rendererOrEditor, java.awt.Component)) { -component = rendererOrEditor; -}if (Clazz_instanceOf (rendererOrEditor, javax.swing.DefaultCellEditor)) { -component = (rendererOrEditor).getComponent (); -}if (component != null) { -javax.swing.SwingUtilities.updateComponentTreeUI (component); -}}, "~O"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.SwingUtilities, "SharedOwnerFrame", java.awt.Frame, java.awt.event.WindowListener); -Clazz_defineMethod (c$, "addNotify", -function () { -Clazz_superCall (this, javax.swing.SwingUtilities.SharedOwnerFrame, "addNotify", []); -this.installListeners (); -}); -Clazz_defineMethod (c$, "installListeners", -function () { -var a = this.getOwnedWindows (); -for (var b = 0; b < a.length; b++) { -var c = a[b]; -if (c != null) { -c.removeWindowListener (this); -c.addWindowListener (this); -}} -}); -Clazz_overrideMethod (c$, "windowClosed", -function (a) { -var b = this.getOwnedWindows (); -for (var c = 0; c < b.length; c++) { -var d = b[c]; -if (d != null) { -if (d.isDisplayable ()) { -return; -}d.removeWindowListener (this); -}this.dispose (); -} -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowOpened", -function (a) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowClosing", -function (a) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowIconified", -function (a) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowDeiconified", -function (a) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowActivated", -function (a) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowDeactivated", -function (a) { -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "show", -function () { -}); -Clazz_overrideMethod (c$, "dispose", -function () { -}); -c$ = Clazz_p0p (); -c$.sharedOwnerFrameKey = c$.prototype.sharedOwnerFrameKey = new Clazz._O (); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.Window"], "java.awt.Frame", ["java.lang.IllegalArgumentException", "java.awt.Cursor", "$.IllegalComponentStateException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.maximizedBounds = null; -this.title = "Untitled"; -this.resizable = true; -this.undecorated = false; -this.mbManagement = false; -this.$state = 0; -this.ownedWindows = null; -this.menuBar = null; -Clazz_instantialize (this, arguments); -}, java.awt, "Frame", java.awt.Window); -Clazz_makeConstructor (c$, -function () { -this.construct (""); -}); -Clazz_makeConstructor (c$, -function (gc) { -this.construct ("", gc); -}, "java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (title) { -Clazz_superConstructor (this, java.awt.Frame, []); -this.initFrame (title, null); -}, "~S"); -Clazz_makeConstructor (c$, -function (title, gc) { -Clazz_superConstructor (this, java.awt.Frame, [gc]); -this.initFrame (title, gc); -}, "~S,java.awt.GraphicsConfiguration"); -Clazz_defineMethod (c$, "initFrame", - function (title, gc) { -this.title = title; -}, "~S,java.awt.GraphicsConfiguration"); -Clazz_overrideMethod (c$, "constructComponentName", -function () { -{ -return "frame" + java.awt.Frame.$nameCounter++; -}}); -Clazz_defineMethod (c$, "addNotify", -function () { -if (this.peer == null) { -this.peer = this.getToolkit ().createFrame (this); -}var p = this.peer; -p.setMaximizedBounds (this.maximizedBounds); -Clazz_superCall (this, java.awt.Frame, "addNotify", []); -}); -Clazz_defineMethod (c$, "getTitle", -function () { -return this.title; -}); -Clazz_defineMethod (c$, "setTitle", -function (title) { -var oldTitle = this.title; -if (title == null) { -title = ""; -}{ -this.title = title; -}this.firePropertyChangeObject ("title", oldTitle, title); -}, "~S"); -Clazz_defineMethod (c$, "getIconImage", -function () { -var icons = this.icons; -if (icons != null) { -if (icons.size () > 0) { -return icons.get (0); -}}return null; -}); -Clazz_defineMethod (c$, "isResizable", -function () { -return this.resizable; -}); -Clazz_defineMethod (c$, "setResizable", -function (resizable) { -var oldResizable = this.resizable; -{ -this.resizable = resizable; -}this.firePropertyChangeBool ("resizable", oldResizable, resizable); -}, "~B"); -Clazz_defineMethod (c$, "setState", -function (state) { -var current = this.getExtendedState (); -if (state == 1 && (current & 1) == 0) { -this.setExtendedState (current | 1); -} else if (state == 0 && (current & 1) != 0) { -this.setExtendedState (current & -2); -}}, "~N"); -Clazz_defineMethod (c$, "setExtendedState", -function (state) { -if (!this.isFrameStateSupported (state)) { -return; -}this.$state = state; -}, "~N"); -Clazz_defineMethod (c$, "isFrameStateSupported", - function (state) { -if (!this.getToolkit ().isFrameStateSupported (state)) { -if (((state & 1) != 0) && !this.getToolkit ().isFrameStateSupported (1)) { -return false; -} else { -state &= -2; -}return this.getToolkit ().isFrameStateSupported (state); -}return true; -}, "~N"); -Clazz_defineMethod (c$, "getState", -function () { -return (this.getExtendedState () & 1) != 0 ? 1 : 0; -}); -Clazz_defineMethod (c$, "getExtendedState", -function () { -return this.$state; -}); -Clazz_defineMethod (c$, "setMaximizedBounds", -function (bounds) { -this.maximizedBounds = bounds; -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "getMaximizedBounds", -function () { -return this.maximizedBounds; -}); -Clazz_defineMethod (c$, "setUndecorated", -function (undecorated) { -{ -if (this.isDisplayable ()) { -throw new java.awt.IllegalComponentStateException ("The frame is displayable."); -}this.undecorated = undecorated; -}}, "~B"); -Clazz_defineMethod (c$, "isUndecorated", -function () { -return this.undecorated; -}); -Clazz_overrideMethod (c$, "removeNotify", -function () { -}); -Clazz_defineMethod (c$, "paramString", -function () { -var str = Clazz_superCall (this, java.awt.Frame, "paramString", []); -if (this.title != null) { -str += ",title=" + this.title; -}if (this.resizable) { -str += ",resizable"; -}this.getExtendedState (); -if (this.$state == 0) { -str += ",normal"; -} else { -if ((this.$state & 1) != 0) { -str += ",iconified"; -}if ((this.$state & 6) == 6) { -str += ",maximized"; -} else if ((this.$state & 2) != 0) { -str += ",maximized_horiz"; -} else if ((this.$state & 4) != 0) { -str += ",maximized_vert"; -}}return str; -}); -Clazz_defineMethod (c$, "setCursor", -function (cursorType) { -if (cursorType < 0 || cursorType > 13) { -throw new IllegalArgumentException ("illegal cursor type"); -}this.setCursor (java.awt.Cursor.getPredefinedCursor (cursorType)); -}, "~N"); -Clazz_defineMethod (c$, "getCursorType", -function () { -return (this.getCursor ().getType ()); -}); -c$.getFrames = Clazz_defineMethod (c$, "getFrames", -function () { -var allWindows = java.awt.Window.getWindows (); -var frameCount = 0; -for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) { -if (Clazz_instanceOf (w, java.awt.Frame)) { -frameCount++; -}} -var frames = new Array (frameCount); -var c = 0; -for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) { -if (Clazz_instanceOf (w, java.awt.Frame)) { -frames[c++] = w; -}} -return frames; -}); -Clazz_defineStatics (c$, -"DEFAULT_CURSOR", 0, -"CROSSHAIR_CURSOR", 1, -"TEXT_CURSOR", 2, -"WAIT_CURSOR", 3, -"SW_RESIZE_CURSOR", 4, -"SE_RESIZE_CURSOR", 5, -"NW_RESIZE_CURSOR", 6, -"NE_RESIZE_CURSOR", 7, -"N_RESIZE_CURSOR", 8, -"S_RESIZE_CURSOR", 9, -"W_RESIZE_CURSOR", 10, -"E_RESIZE_CURSOR", 11, -"HAND_CURSOR", 12, -"MOVE_CURSOR", 13, -"NORMAL", 0, -"ICONIFIED", 1, -"MAXIMIZED_HORIZ", 2, -"MAXIMIZED_VERT", 4, -"MAXIMIZED_BOTH", 6, -"$base", "frame", -"$nameCounter", 0); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.lang.IllegalStateException"], "java.awt.IllegalComponentStateException", null, function () { -c$ = Clazz_declareType (java.awt, "IllegalComponentStateException", IllegalStateException); -}); -Clazz_declarePackage ("javax.swing"); -c$ = Clazz_declareInterface (javax.swing, "SwingConstants"); -Clazz_defineStatics (c$, -"CENTER", 0, -"TOP", 1, -"LEFT", 2, -"BOTTOM", 3, -"RIGHT", 4, -"NORTH", 1, -"NORTH_EAST", 2, -"EAST", 3, -"SOUTH_EAST", 4, -"SOUTH", 5, -"SOUTH_WEST", 6, -"WEST", 7, -"NORTH_WEST", 8, -"HORIZONTAL", 0, -"VERTICAL", 1, -"LEADING", 10, -"TRAILING", 11, -"NEXT", 12, -"PREVIOUS", 13); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.Shape", "java.awt.geom.Rectangle2D"], "java.awt.Rectangle", ["java.awt.Dimension", "$.Point"], function () { -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.width = 0; -this.height = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "Rectangle", java.awt.geom.Rectangle2D, java.awt.Shape); -Clazz_makeConstructor (c$, -function () { -this.construct (0, 0, 0, 0); -}); -Clazz_makeConstructor (c$, -function (r) { -this.construct (r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_makeConstructor (c$, -function (x, y, width, height) { -Clazz_superConstructor (this, java.awt.Rectangle, []); -this.x = x; -this.y = y; -this.width = width; -this.height = height; -}, "~N,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (width, height) { -this.construct (0, 0, width, height); -}, "~N,~N"); -Clazz_makeConstructor (c$, -function (p, d) { -this.construct (p.x, p.y, d.width, d.height); -}, "java.awt.Point,java.awt.Dimension"); -Clazz_makeConstructor (c$, -function (p) { -this.construct (p.x, p.y, 0, 0); -}, "java.awt.Point"); -Clazz_makeConstructor (c$, -function (d) { -this.construct (0, 0, d.width, d.height); -}, "java.awt.Dimension"); -Clazz_overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_overrideMethod (c$, "getWidth", -function () { -return this.width; -}); -Clazz_overrideMethod (c$, "getHeight", -function () { -return this.height; -}); -Clazz_overrideMethod (c$, "getBounds", -function () { -return new java.awt.Rectangle (this.x, this.y, this.width, this.height); -}); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -return new java.awt.Rectangle (this.x, this.y, this.width, this.height); -}); -Clazz_defineMethod (c$, "setBounds", -function (r) { -this.reshape (r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "setBounds", -function (x, y, width, height) { -this.reshape (x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setRect", -function (x, y, width, height) { -var newx; -var newy; -var neww; -var newh; -if (x > 4.294967294E9) { -newx = 2147483647; -neww = -1; -} else { -newx = java.awt.Rectangle.clip (x, false); -if (width >= 0) width += x - newx; -neww = java.awt.Rectangle.clip (width, width >= 0); -}if (y > 4.294967294E9) { -newy = 2147483647; -newh = -1; -} else { -newy = java.awt.Rectangle.clip (y, false); -if (height >= 0) height += y - newy; -newh = java.awt.Rectangle.clip (height, height >= 0); -}this.reshape (newx, newy, neww, newh); -}, "~N,~N,~N,~N"); -c$.clip = Clazz_defineMethod (c$, "clip", - function (v, doceil) { -if (v <= -2147483648) { -return -2147483648; -}if (v >= 2147483647) { -return 2147483647; -}return Clazz_doubleToInt (doceil ? Math.ceil (v) : Math.floor (v)); -}, "~N,~B"); -Clazz_defineMethod (c$, "reshape", -function (x, y, width, height) { -this.x = x; -this.y = y; -this.width = width; -this.height = height; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getLocation", -function () { -return new java.awt.Point (this.x, this.y); -}); -Clazz_defineMethod (c$, "setLocation", -function (p) { -this.setLocation (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "setLocation", -function (x, y) { -this.move (x, y); -}, "~N,~N"); -Clazz_defineMethod (c$, "move", -function (x, y) { -this.x = x; -this.y = y; -}, "~N,~N"); -Clazz_defineMethod (c$, "translate", -function (dx, dy) { -var oldv = this.x; -var newv = oldv + dx; -if (dx < 0) { -if (newv > oldv) { -if (this.width >= 0) { -this.width += newv - -2147483648; -}newv = -2147483648; -}} else { -if (newv < oldv) { -if (this.width >= 0) { -this.width += newv - 2147483647; -if (this.width < 0) this.width = 2147483647; -}newv = 2147483647; -}}this.x = newv; -oldv = this.y; -newv = oldv + dy; -if (dy < 0) { -if (newv > oldv) { -if (this.height >= 0) { -this.height += newv - -2147483648; -}newv = -2147483648; -}} else { -if (newv < oldv) { -if (this.height >= 0) { -this.height += newv - 2147483647; -if (this.height < 0) this.height = 2147483647; -}newv = 2147483647; -}}this.y = newv; -}, "~N,~N"); -Clazz_defineMethod (c$, "getSize", -function () { -return new java.awt.Dimension (this.width, this.height); -}); -Clazz_defineMethod (c$, "setSize", -function (d) { -this.setSize (d.width, d.height); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "setSize", -function (width, height) { -this.resize (width, height); -}, "~N,~N"); -Clazz_defineMethod (c$, "resize", -function (width, height) { -this.width = width; -this.height = height; -}, "~N,~N"); -Clazz_defineMethod (c$, "contains", -function (p) { -return this.contains (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "contains", -function (x, y) { -return this.inside (x, y); -}, "~N,~N"); -Clazz_defineMethod (c$, "contains", -function (r) { -return this.contains (r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "contains", -function (X, Y, W, H) { -var w = this.width; -var h = this.height; -if ((w | h | W | H) < 0) { -return false; -}var x = this.x; -var y = this.y; -if (X < x || Y < y) { -return false; -}w += x; -W += X; -if (W <= X) { -if (w >= x || W > w) return false; -} else { -if (w >= x && W > w) return false; -}h += y; -H += Y; -if (H <= Y) { -if (h >= y || H > h) return false; -} else { -if (h >= y && H > h) return false; -}return true; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "inside", -function (X, Y) { -var w = this.width; -var h = this.height; -if ((w | h) < 0) { -return false; -}var x = this.x; -var y = this.y; -if (X < x || Y < y) { -return false; -}w += x; -h += y; -return ((w < x || w > X) && (h < y || h > Y)); -}, "~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (r) { -var tw = this.width; -var th = this.height; -var rw = r.width; -var rh = r.height; -if (rw <= 0 || rh <= 0 || tw <= 0 || th <= 0) { -return false; -}var tx = this.x; -var ty = this.y; -var rx = r.x; -var ry = r.y; -rw += rx; -rh += ry; -tw += tx; -th += ty; -return ((rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry)); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "intersection", -function (r) { -var tx1 = this.x; -var ty1 = this.y; -var rx1 = r.x; -var ry1 = r.y; -var tx2 = tx1; -tx2 += this.width; -var ty2 = ty1; -ty2 += this.height; -var rx2 = rx1; -rx2 += r.width; -var ry2 = ry1; -ry2 += r.height; -if (tx1 < rx1) tx1 = rx1; -if (ty1 < ry1) ty1 = ry1; -if (tx2 > rx2) tx2 = rx2; -if (ty2 > ry2) ty2 = ry2; -tx2 -= tx1; -ty2 -= ty1; -if (tx2 < -2147483648) tx2 = -2147483648; -if (ty2 < -2147483648) ty2 = -2147483648; -return new java.awt.Rectangle (tx1, ty1, tx2, ty2); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "union", -function (r) { -var tx2 = this.width; -var ty2 = this.height; -if ((tx2 | ty2) < 0) { -return new java.awt.Rectangle (r); -}var rx2 = r.width; -var ry2 = r.height; -if ((rx2 | ry2) < 0) { -return new java.awt.Rectangle (this); -}var tx1 = this.x; -var ty1 = this.y; -tx2 += tx1; -ty2 += ty1; -var rx1 = r.x; -var ry1 = r.y; -rx2 += rx1; -ry2 += ry1; -if (tx1 > rx1) tx1 = rx1; -if (ty1 > ry1) ty1 = ry1; -if (tx2 < rx2) tx2 = rx2; -if (ty2 < ry2) ty2 = ry2; -tx2 -= tx1; -ty2 -= ty1; -if (tx2 > 2147483647) tx2 = 2147483647; -if (ty2 > 2147483647) ty2 = 2147483647; -return new java.awt.Rectangle (tx1, ty1, tx2, ty2); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "add", -function (newx, newy) { -if ((this.width | this.height) < 0) { -this.x = newx; -this.y = newy; -this.width = this.height = 0; -return; -}var x1 = this.x; -var y1 = this.y; -var x2 = this.width; -var y2 = this.height; -x2 += x1; -y2 += y1; -if (x1 > newx) x1 = newx; -if (y1 > newy) y1 = newy; -if (x2 < newx) x2 = newx; -if (y2 < newy) y2 = newy; -x2 -= x1; -y2 -= y1; -if (x2 > 2147483647) x2 = 2147483647; -if (y2 > 2147483647) y2 = 2147483647; -this.reshape (x1, y1, x2, y2); -}, "~N,~N"); -Clazz_defineMethod (c$, "add", -function (pt) { -this.add (pt.x, pt.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "add", -function (r) { -var tx2 = this.width; -var ty2 = this.height; -if ((tx2 | ty2) < 0) { -this.reshape (r.x, r.y, r.width, r.height); -}var rx2 = r.width; -var ry2 = r.height; -if ((rx2 | ry2) < 0) { -return; -}var tx1 = this.x; -var ty1 = this.y; -tx2 += tx1; -ty2 += ty1; -var rx1 = r.x; -var ry1 = r.y; -rx2 += rx1; -ry2 += ry1; -if (tx1 > rx1) tx1 = rx1; -if (ty1 > ry1) ty1 = ry1; -if (tx2 < rx2) tx2 = rx2; -if (ty2 < ry2) ty2 = ry2; -tx2 -= tx1; -ty2 -= ty1; -if (tx2 > 2147483647) tx2 = 2147483647; -if (ty2 > 2147483647) ty2 = 2147483647; -this.reshape (tx1, ty1, tx2, ty2); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "grow", -function (h, v) { -var x0 = this.x; -var y0 = this.y; -var x1 = this.width; -var y1 = this.height; -x1 += x0; -y1 += y0; -x0 -= h; -y0 -= v; -x1 += h; -y1 += v; -if (x1 < x0) { -x1 -= x0; -if (x1 < -2147483648) x1 = -2147483648; -if (x0 < -2147483648) x0 = -2147483648; - else if (x0 > 2147483647) x0 = 2147483647; -} else { -if (x0 < -2147483648) x0 = -2147483648; - else if (x0 > 2147483647) x0 = 2147483647; -x1 -= x0; -if (x1 < -2147483648) x1 = -2147483648; - else if (x1 > 2147483647) x1 = 2147483647; -}if (y1 < y0) { -y1 -= y0; -if (y1 < -2147483648) y1 = -2147483648; -if (y0 < -2147483648) y0 = -2147483648; - else if (y0 > 2147483647) y0 = 2147483647; -} else { -if (y0 < -2147483648) y0 = -2147483648; - else if (y0 > 2147483647) y0 = 2147483647; -y1 -= y0; -if (y1 < -2147483648) y1 = -2147483648; - else if (y1 > 2147483647) y1 = 2147483647; -}this.reshape (x0, y0, x1, y1); -}, "~N,~N"); -Clazz_overrideMethod (c$, "isEmpty", -function () { -return (this.width <= 0) || (this.height <= 0); -}); -Clazz_defineMethod (c$, "outcode", -function (x, y) { -var out = 0; -if (this.width <= 0) { -out |= 5; -} else if (x < this.x) { -out |= 1; -} else if (x > this.x + this.width) { -out |= 4; -}if (this.height <= 0) { -out |= 10; -} else if (y < this.y) { -out |= 2; -} else if (y > this.y + this.height) { -out |= 8; -}return out; -}, "~N,~N"); -Clazz_overrideMethod (c$, "createIntersection", -function (r) { -if (Clazz_instanceOf (r, java.awt.Rectangle)) { -return this.intersection (r); -}var dest = new java.awt.geom.Rectangle2D.Double (); -java.awt.geom.Rectangle2D.intersect (this, r, dest); -return dest; -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "createUnion", -function (r) { -if (Clazz_instanceOf (r, java.awt.Rectangle)) { -return this.union (r); -}var dest = new java.awt.geom.Rectangle2D.Double (); -java.awt.geom.Rectangle2D.union (this, r, dest); -return dest; -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "equals", -function (obj) { -if (Clazz_instanceOf (obj, java.awt.Rectangle)) { -var r = obj; -return ((this.x == r.x) && (this.y == r.y) && (this.width == r.width) && (this.height == r.height)); -}return Clazz_superCall (this, java.awt.Rectangle, "equals", [obj]); -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + ",width=" + this.width + ",height=" + this.height + "]"; -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "Shape"); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.geom.RectangularShape"], "java.awt.geom.Rectangle2D", ["java.lang.Double", "java.awt.geom.RectIterator"], function () { -c$ = Clazz_declareType (java.awt.geom, "Rectangle2D", java.awt.geom.RectangularShape); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.Rectangle2D, []); -}); -Clazz_defineMethod (c$, "setRect", -function (r) { -this.setRect (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "intersectsLine", -function (x1, y1, x2, y2) { -var out1; -var out2; -if ((out2 = this.outcode (x2, y2)) == 0) { -return true; -}while ((out1 = this.outcode (x1, y1)) != 0) { -if ((out1 & out2) != 0) { -return false; -}if ((out1 & (5)) != 0) { -var x = this.getX (); -if ((out1 & 4) != 0) { -x += this.getWidth (); -}y1 = y1 + (x - x1) * (y2 - y1) / (x2 - x1); -x1 = x; -} else { -var y = this.getY (); -if ((out1 & 8) != 0) { -y += this.getHeight (); -}x1 = x1 + (y - y1) * (x2 - x1) / (y2 - y1); -y1 = y; -}} -return true; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersectsLine", -function (l) { -return this.intersectsLine (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 ()); -}, "java.awt.geom.Line2D"); -Clazz_defineMethod (c$, "outcode", -function (p) { -return this.outcode (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "setFrame", -function (x, y, w, h) { -this.setRect (x, y, w, h); -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -return this.clone (); -}); -Clazz_defineMethod (c$, "contains", -function (x, y) { -var x0 = this.getX (); -var y0 = this.getY (); -return (x >= x0 && y >= y0 && x < x0 + this.getWidth () && y < y0 + this.getHeight ()); -}, "~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (x, y, w, h) { -if (this.isEmpty () || w <= 0 || h <= 0) { -return false; -}var x0 = this.getX (); -var y0 = this.getY (); -return (x + w > x0 && y + h > y0 && x < x0 + this.getWidth () && y < y0 + this.getHeight ()); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "contains", -function (x, y, w, h) { -if (this.isEmpty () || w <= 0 || h <= 0) { -return false; -}var x0 = this.getX (); -var y0 = this.getY (); -return (x >= x0 && y >= y0 && (x + w) <= x0 + this.getWidth () && (y + h) <= y0 + this.getHeight ()); -}, "~N,~N,~N,~N"); -c$.intersect = Clazz_defineMethod (c$, "intersect", -function (src1, src2, dest) { -var x1 = Math.max (src1.getMinX (), src2.getMinX ()); -var y1 = Math.max (src1.getMinY (), src2.getMinY ()); -var x2 = Math.min (src1.getMaxX (), src2.getMaxX ()); -var y2 = Math.min (src1.getMaxY (), src2.getMaxY ()); -dest.setFrame (x1, y1, x2 - x1, y2 - y1); -}, "java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D"); -c$.union = Clazz_defineMethod (c$, "union", -function (src1, src2, dest) { -var x1 = Math.min (src1.getMinX (), src2.getMinX ()); -var y1 = Math.min (src1.getMinY (), src2.getMinY ()); -var x2 = Math.max (src1.getMaxX (), src2.getMaxX ()); -var y2 = Math.max (src1.getMaxY (), src2.getMaxY ()); -dest.setFrameFromDiagonal (x1, y1, x2, y2); -}, "java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "add", -function (newx, newy) { -var x1 = Math.min (this.getMinX (), newx); -var x2 = Math.max (this.getMaxX (), newx); -var y1 = Math.min (this.getMinY (), newy); -var y2 = Math.max (this.getMaxY (), newy); -this.setRect (x1, y1, x2 - x1, y2 - y1); -}, "~N,~N"); -Clazz_defineMethod (c$, "add", -function (pt) { -this.add (pt.getX (), pt.getY ()); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "add", -function (r) { -var x1 = Math.min (this.getMinX (), r.getMinX ()); -var x2 = Math.max (this.getMaxX (), r.getMaxX ()); -var y1 = Math.min (this.getMinY (), r.getMinY ()); -var y2 = Math.max (this.getMaxY (), r.getMaxY ()); -this.setRect (x1, y1, x2 - x1, y2 - y1); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "getPathIterator", -function (at) { -return new java.awt.geom.RectIterator (this, at); -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "getPathIterator", -function (at, flatness) { -return new java.awt.geom.RectIterator (this, at); -}, "java.awt.geom.AffineTransform,~N"); -Clazz_overrideMethod (c$, "hashCode", -function () { -var bits = java.lang.Double.doubleToLongBits (this.getX ()); -bits += java.lang.Double.doubleToLongBits (this.getY ()) * 37; -bits += java.lang.Double.doubleToLongBits (this.getWidth ()) * 43; -bits += java.lang.Double.doubleToLongBits (this.getHeight ()) * 47; -return ((bits) ^ ((bits >> 32))); -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (obj === this) { -return true; -}if (Clazz_instanceOf (obj, java.awt.geom.Rectangle2D)) { -var r2d = obj; -return ((this.getX () == r2d.getX ()) && (this.getY () == r2d.getY ()) && (this.getWidth () == r2d.getWidth ()) && (this.getHeight () == r2d.getHeight ())); -}return false; -}, "~O"); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.width = 0; -this.height = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Rectangle2D, "Float", java.awt.geom.Rectangle2D); -Clazz_makeConstructor (c$, -function (a, b, c, d) { -Clazz_superConstructor (this, java.awt.geom.Rectangle2D.Float, []); -{ -if (arguments.length == 0) -return; -}this.setRect (a, b, c, d); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_defineMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "getWidth", -function () { -return this.width; -}); -Clazz_defineMethod (c$, "getHeight", -function () { -return this.height; -}); -Clazz_overrideMethod (c$, "isEmpty", -function () { -return (this.width <= 0.0) || (this.height <= 0.0); -}); -Clazz_defineMethod (c$, "setRect", -function (a, b, c, d) { -this.x = a; -this.y = b; -this.width = c; -this.height = d; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setRect", -function (a, b, c, d) { -this.x = a; -this.y = b; -this.width = c; -this.height = d; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setRect", -function (a) { -this.x = a.getX (); -this.y = a.getY (); -this.width = a.getWidth (); -this.height = a.getHeight (); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "outcode", -function (a, b) { -var c = 0; -if (this.width <= 0) { -c |= 5; -} else if (a < this.x) { -c |= 1; -} else if (a > this.x + this.width) { -c |= 4; -}if (this.height <= 0) { -c |= 10; -} else if (b < this.y) { -c |= 2; -} else if (b > this.y + this.height) { -c |= 8; -}return c; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -return new java.awt.geom.Rectangle2D.Float (this.x, this.y, this.width, this.height); -}); -Clazz_overrideMethod (c$, "createIntersection", -function (a) { -var b; -if (Clazz_instanceOf (a, java.awt.geom.Rectangle2D.Float)) { -b = new java.awt.geom.Rectangle2D.Float (); -} else { -b = new java.awt.geom.Rectangle2D.Double (); -}java.awt.geom.Rectangle2D.intersect (this, a, b); -return b; -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "createUnion", -function (a) { -var b; -if (Clazz_instanceOf (a, java.awt.geom.Rectangle2D.Float)) { -b = new java.awt.geom.Rectangle2D.Float (); -} else { -b = new java.awt.geom.Rectangle2D.Double (); -}java.awt.geom.Rectangle2D.union (this, a, b); -return b; -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + ",w=" + this.width + ",h=" + this.height + "]"; -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.width = 0; -this.height = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Rectangle2D, "Double", java.awt.geom.Rectangle2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.Rectangle2D.Double, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d) { -Clazz_superConstructor (this, java.awt.geom.Rectangle2D.Double, []); -this.setRect (a, b, c, d); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_defineMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "getWidth", -function () { -return this.width; -}); -Clazz_defineMethod (c$, "getHeight", -function () { -return this.height; -}); -Clazz_overrideMethod (c$, "isEmpty", -function () { -return (this.width <= 0.0) || (this.height <= 0.0); -}); -Clazz_defineMethod (c$, "setRect", -function (a, b, c, d) { -this.x = a; -this.y = b; -this.width = c; -this.height = d; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setRect", -function (a) { -this.x = a.getX (); -this.y = a.getY (); -this.width = a.getWidth (); -this.height = a.getHeight (); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "outcode", -function (a, b) { -var c = 0; -if (this.width <= 0) { -c |= 5; -} else if (a < this.x) { -c |= 1; -} else if (a > this.x + this.width) { -c |= 4; -}if (this.height <= 0) { -c |= 10; -} else if (b < this.y) { -c |= 2; -} else if (b > this.y + this.height) { -c |= 8; -}return c; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -return new java.awt.geom.Rectangle2D.Double (this.x, this.y, this.width, this.height); -}); -Clazz_overrideMethod (c$, "createIntersection", -function (a) { -var b = new java.awt.geom.Rectangle2D.Double (); -java.awt.geom.Rectangle2D.intersect (this, a, b); -return b; -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "createUnion", -function (a) { -var b = new java.awt.geom.Rectangle2D.Double (); -java.awt.geom.Rectangle2D.union (this, a, b); -return b; -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + ",w=" + this.width + ",h=" + this.height + "]"; -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"OUT_LEFT", 1, -"OUT_TOP", 2, -"OUT_RIGHT", 4, -"OUT_BOTTOM", 8); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.Shape"], "java.awt.geom.RectangularShape", ["java.lang.InternalError", "java.awt.geom.FlatteningPathIterator"], function () { -c$ = Clazz_declareType (java.awt.geom, "RectangularShape", null, [java.awt.Shape, Cloneable]); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "getMinX", -function () { -return this.getX (); -}); -Clazz_defineMethod (c$, "getMinY", -function () { -return this.getY (); -}); -Clazz_defineMethod (c$, "getMaxX", -function () { -return this.getX () + this.getWidth (); -}); -Clazz_defineMethod (c$, "getMaxY", -function () { -return this.getY () + this.getHeight (); -}); -Clazz_defineMethod (c$, "getCenterX", -function () { -return this.getX () + this.getWidth () / 2.0; -}); -Clazz_defineMethod (c$, "getCenterY", -function () { -return this.getY () + this.getHeight () / 2.0; -}); -Clazz_defineMethod (c$, "getFrame", -function () { -return new java.awt.geom.Rectangle2D.Double (this.getX (), this.getY (), this.getWidth (), this.getHeight ()); -}); -Clazz_defineMethod (c$, "setFrame", -function (loc, size) { -this.setFrame (loc.getX (), loc.getY (), size.getWidth (), size.getHeight ()); -}, "java.awt.geom.Point2D,java.awt.geom.Dimension2D"); -Clazz_defineMethod (c$, "setFrame", -function (r) { -this.setFrame (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "setFrameFromDiagonal", -function (x1, y1, x2, y2) { -if (x2 < x1) { -var t = x1; -x1 = x2; -x2 = t; -}if (y2 < y1) { -var t = y1; -y1 = y2; -y2 = t; -}this.setFrame (x1, y1, x2 - x1, y2 - y1); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setFrameFromDiagonal", -function (p1, p2) { -this.setFrameFromDiagonal (p1.getX (), p1.getY (), p2.getX (), p2.getY ()); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "setFrameFromCenter", -function (centerX, centerY, cornerX, cornerY) { -var halfW = Math.abs (cornerX - centerX); -var halfH = Math.abs (cornerY - centerY); -this.setFrame (centerX - halfW, centerY - halfH, halfW * 2.0, halfH * 2.0); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setFrameFromCenter", -function (center, corner) { -this.setFrameFromCenter (center.getX (), center.getY (), corner.getX (), corner.getY ()); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "contains", -function (p) { -return this.contains (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -Clazz_overrideMethod (c$, "intersects", -function (r) { -return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "contains", -function (r) { -return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "getBounds", -function () { -var width = this.getWidth (); -var height = this.getHeight (); -if (width < 0 || height < 0) { -return new java.awt.Rectangle (); -}var x = this.getX (); -var y = this.getY (); -var x1 = Math.floor (x); -var y1 = Math.floor (y); -var x2 = Math.ceil (x + width); -var y2 = Math.ceil (y + height); -return new java.awt.Rectangle (Clazz_doubleToInt (x1), Clazz_doubleToInt (y1), Clazz_doubleToInt (x2 - x1), Clazz_doubleToInt (y2 - y1)); -}); -Clazz_overrideMethod (c$, "getPathIterator", -function (at, flatness) { -return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); -}, "java.awt.geom.AffineTransform,~N"); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.RectangularShape, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.FlatteningPathIterator", ["java.lang.IllegalArgumentException", "java.util.NoSuchElementException", "java.awt.geom.CubicCurve2D", "$.QuadCurve2D"], function () { -c$ = Clazz_decorateAsClass (function () { -this.src = null; -this.squareflat = 0; -this.limit = 0; -this.hold = null; -this.curx = 0; -this.cury = 0; -this.movx = 0; -this.movy = 0; -this.holdType = 0; -this.holdEnd = 0; -this.holdIndex = 0; -this.levels = null; -this.levelIndex = 0; -this.done = false; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "FlatteningPathIterator", null, java.awt.geom.PathIterator); -Clazz_prepareFields (c$, function () { -this.hold = Clazz_newDoubleArray (14, 0); -}); -Clazz_makeConstructor (c$, -function (src, flatness) { -this.construct (src, flatness, 10); -}, "java.awt.geom.PathIterator,~N"); -Clazz_makeConstructor (c$, -function (src, flatness, limit) { -if (flatness < 0.0) { -throw new IllegalArgumentException ("flatness must be >= 0"); -}if (limit < 0) { -throw new IllegalArgumentException ("limit must be >= 0"); -}this.src = src; -this.squareflat = flatness * flatness; -this.limit = limit; -this.levels = Clazz_newIntArray (limit + 1, 0); -this.next (false); -}, "java.awt.geom.PathIterator,~N,~N"); -Clazz_defineMethod (c$, "getFlatness", -function () { -return Math.sqrt (this.squareflat); -}); -Clazz_defineMethod (c$, "getRecursionLimit", -function () { -return this.limit; -}); -Clazz_defineMethod (c$, "getWindingRule", -function () { -return this.src.getWindingRule (); -}); -Clazz_defineMethod (c$, "isDone", -function () { -return this.done; -}); -Clazz_defineMethod (c$, "ensureHoldCapacity", -function (want) { -if (this.holdIndex - want < 0) { -var have = this.hold.length - this.holdIndex; -var newsize = this.hold.length + 24; -var newhold = Clazz_newDoubleArray (newsize, 0); -System.arraycopy (this.hold, this.holdIndex, newhold, this.holdIndex + 24, have); -this.hold = newhold; -this.holdIndex += 24; -this.holdEnd += 24; -}}, "~N"); -Clazz_defineMethod (c$, "next", -function () { -this.next (true); -}); -Clazz_defineMethod (c$, "next", - function (doNext) { -var level; -if (this.holdIndex >= this.holdEnd) { -if (doNext) { -this.src.next (); -}if (this.src.isDone ()) { -this.done = true; -return; -}this.holdType = this.src.currentSegment (this.hold); -this.levelIndex = 0; -this.levels[0] = 0; -}switch (this.holdType) { -case 0: -case 1: -this.curx = this.hold[0]; -this.cury = this.hold[1]; -if (this.holdType == 0) { -this.movx = this.curx; -this.movy = this.cury; -}this.holdIndex = 0; -this.holdEnd = 0; -break; -case 4: -this.curx = this.movx; -this.cury = this.movy; -this.holdIndex = 0; -this.holdEnd = 0; -break; -case 2: -if (this.holdIndex >= this.holdEnd) { -this.holdIndex = this.hold.length - 6; -this.holdEnd = this.hold.length - 2; -this.hold[this.holdIndex + 0] = this.curx; -this.hold[this.holdIndex + 1] = this.cury; -this.hold[this.holdIndex + 2] = this.hold[0]; -this.hold[this.holdIndex + 3] = this.hold[1]; -this.hold[this.holdIndex + 4] = this.curx = this.hold[2]; -this.hold[this.holdIndex + 5] = this.cury = this.hold[3]; -}level = this.levels[this.levelIndex]; -while (level < this.limit) { -if (java.awt.geom.QuadCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) { -break; -}this.ensureHoldCapacity (4); -java.awt.geom.QuadCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 4, this.hold, this.holdIndex); -this.holdIndex -= 4; -level++; -this.levels[this.levelIndex] = level; -this.levelIndex++; -this.levels[this.levelIndex] = level; -} -this.holdIndex += 4; -this.levelIndex--; -break; -case 3: -if (this.holdIndex >= this.holdEnd) { -this.holdIndex = this.hold.length - 8; -this.holdEnd = this.hold.length - 2; -this.hold[this.holdIndex + 0] = this.curx; -this.hold[this.holdIndex + 1] = this.cury; -this.hold[this.holdIndex + 2] = this.hold[0]; -this.hold[this.holdIndex + 3] = this.hold[1]; -this.hold[this.holdIndex + 4] = this.hold[2]; -this.hold[this.holdIndex + 5] = this.hold[3]; -this.hold[this.holdIndex + 6] = this.curx = this.hold[4]; -this.hold[this.holdIndex + 7] = this.cury = this.hold[5]; -}level = this.levels[this.levelIndex]; -while (level < this.limit) { -if (java.awt.geom.CubicCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) { -break; -}this.ensureHoldCapacity (6); -java.awt.geom.CubicCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 6, this.hold, this.holdIndex); -this.holdIndex -= 6; -level++; -this.levels[this.levelIndex] = level; -this.levelIndex++; -this.levels[this.levelIndex] = level; -} -this.holdIndex += 6; -this.levelIndex--; -break; -} -}, "~B"); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("flattening iterator out of bounds"); -}var type = this.holdType; -if (type != 4) { -coords[0] = this.hold[this.holdIndex + 0]; -coords[1] = this.hold[this.holdIndex + 1]; -if (type != 0) { -type = 1; -}}return type; -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("flattening iterator out of bounds"); -}var type = this.holdType; -if (type != 4) { -coords[0] = this.hold[this.holdIndex + 0]; -coords[1] = this.hold[this.holdIndex + 1]; -if (type != 0) { -type = 1; -}}return type; -}, "~A"); -Clazz_defineStatics (c$, -"GROW_SIZE", 24); -}); -Clazz_declarePackage ("java.awt.geom"); -c$ = Clazz_declareInterface (java.awt.geom, "PathIterator"); -Clazz_defineStatics (c$, -"WIND_EVEN_ODD", 0, -"WIND_NON_ZERO", 1, -"SEG_MOVETO", 0, -"SEG_LINETO", 1, -"SEG_QUADTO", 2, -"SEG_CUBICTO", 3, -"SEG_CLOSE", 4); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.Shape"], "java.awt.geom.CubicCurve2D", ["java.lang.InternalError", "java.util.Arrays", "java.awt.geom.FlatteningPathIterator", "$.Line2D", "$.Point2D", "$.QuadCurve2D", "$.Rectangle2D", "jssun.awt.geom.Curve", "swingjs.api.Interface"], function () { -c$ = Clazz_declareType (java.awt.geom, "CubicCurve2D", null, [java.awt.Shape, Cloneable]); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setCurve", -function (coords, offset) { -this.setCurve (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); -}, "~A,~N"); -Clazz_defineMethod (c$, "setCurve", -function (p1, cp1, cp2, p2) { -this.setCurve (p1.getX (), p1.getY (), cp1.getX (), cp1.getY (), cp2.getX (), cp2.getY (), p2.getX (), p2.getY ()); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D,java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "setCurve", -function (pts, offset) { -this.setCurve (pts[offset + 0].getX (), pts[offset + 0].getY (), pts[offset + 1].getX (), pts[offset + 1].getY (), pts[offset + 2].getX (), pts[offset + 2].getY (), pts[offset + 3].getX (), pts[offset + 3].getY ()); -}, "~A,~N"); -Clazz_defineMethod (c$, "setCurve", -function (c) { -this.setCurve (c.getX1 (), c.getY1 (), c.getCtrlX1 (), c.getCtrlY1 (), c.getCtrlX2 (), c.getCtrlY2 (), c.getX2 (), c.getY2 ()); -}, "java.awt.geom.CubicCurve2D"); -c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", -function (x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2) { -return Math.max (java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, ctrlx1, ctrly1), java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, ctrlx2, ctrly2)); -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", -function (x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2) { -return Math.sqrt (java.awt.geom.CubicCurve2D.getFlatnessSq (x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2)); -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", -function (coords, offset) { -return java.awt.geom.CubicCurve2D.getFlatnessSq (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); -}, "~A,~N"); -c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", -function (coords, offset) { -return java.awt.geom.CubicCurve2D.getFlatness (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); -}, "~A,~N"); -Clazz_defineMethod (c$, "getFlatnessSq", -function () { -return java.awt.geom.CubicCurve2D.getFlatnessSq (this.getX1 (), this.getY1 (), this.getCtrlX1 (), this.getCtrlY1 (), this.getCtrlX2 (), this.getCtrlY2 (), this.getX2 (), this.getY2 ()); -}); -Clazz_defineMethod (c$, "getFlatness", -function () { -return java.awt.geom.CubicCurve2D.getFlatness (this.getX1 (), this.getY1 (), this.getCtrlX1 (), this.getCtrlY1 (), this.getCtrlX2 (), this.getCtrlY2 (), this.getX2 (), this.getY2 ()); -}); -Clazz_defineMethod (c$, "subdivide", -function (left, right) { -java.awt.geom.CubicCurve2D.subdivide (this, left, right); -}, "java.awt.geom.CubicCurve2D,java.awt.geom.CubicCurve2D"); -c$.subdivide = Clazz_defineMethod (c$, "subdivide", -function (src, left, right) { -var x1 = src.getX1 (); -var y1 = src.getY1 (); -var ctrlx1 = src.getCtrlX1 (); -var ctrly1 = src.getCtrlY1 (); -var ctrlx2 = src.getCtrlX2 (); -var ctrly2 = src.getCtrlY2 (); -var x2 = src.getX2 (); -var y2 = src.getY2 (); -var centerx = (ctrlx1 + ctrlx2) / 2.0; -var centery = (ctrly1 + ctrly2) / 2.0; -ctrlx1 = (x1 + ctrlx1) / 2.0; -ctrly1 = (y1 + ctrly1) / 2.0; -ctrlx2 = (x2 + ctrlx2) / 2.0; -ctrly2 = (y2 + ctrly2) / 2.0; -var ctrlx12 = (ctrlx1 + centerx) / 2.0; -var ctrly12 = (ctrly1 + centery) / 2.0; -var ctrlx21 = (ctrlx2 + centerx) / 2.0; -var ctrly21 = (ctrly2 + centery) / 2.0; -centerx = (ctrlx12 + ctrlx21) / 2.0; -centery = (ctrly12 + ctrly21) / 2.0; -if (left != null) { -left.setCurve (x1, y1, ctrlx1, ctrly1, ctrlx12, ctrly12, centerx, centery); -}if (right != null) { -right.setCurve (centerx, centery, ctrlx21, ctrly21, ctrlx2, ctrly2, x2, y2); -}}, "java.awt.geom.CubicCurve2D,java.awt.geom.CubicCurve2D,java.awt.geom.CubicCurve2D"); -c$.subdivide = Clazz_defineMethod (c$, "subdivide", -function (src, srcoff, left, leftoff, right, rightoff) { -var x1 = src[srcoff + 0]; -var y1 = src[srcoff + 1]; -var ctrlx1 = src[srcoff + 2]; -var ctrly1 = src[srcoff + 3]; -var ctrlx2 = src[srcoff + 4]; -var ctrly2 = src[srcoff + 5]; -var x2 = src[srcoff + 6]; -var y2 = src[srcoff + 7]; -if (left != null) { -left[leftoff + 0] = x1; -left[leftoff + 1] = y1; -}if (right != null) { -right[rightoff + 6] = x2; -right[rightoff + 7] = y2; -}x1 = (x1 + ctrlx1) / 2.0; -y1 = (y1 + ctrly1) / 2.0; -x2 = (x2 + ctrlx2) / 2.0; -y2 = (y2 + ctrly2) / 2.0; -var centerx = (ctrlx1 + ctrlx2) / 2.0; -var centery = (ctrly1 + ctrly2) / 2.0; -ctrlx1 = (x1 + centerx) / 2.0; -ctrly1 = (y1 + centery) / 2.0; -ctrlx2 = (x2 + centerx) / 2.0; -ctrly2 = (y2 + centery) / 2.0; -centerx = (ctrlx1 + ctrlx2) / 2.0; -centery = (ctrly1 + ctrly2) / 2.0; -if (left != null) { -left[leftoff + 2] = x1; -left[leftoff + 3] = y1; -left[leftoff + 4] = ctrlx1; -left[leftoff + 5] = ctrly1; -left[leftoff + 6] = centerx; -left[leftoff + 7] = centery; -}if (right != null) { -right[rightoff + 0] = centerx; -right[rightoff + 1] = centery; -right[rightoff + 2] = ctrlx2; -right[rightoff + 3] = ctrly2; -right[rightoff + 4] = x2; -right[rightoff + 5] = y2; -}}, "~A,~N,~A,~N,~A,~N"); -c$.solveCubic = Clazz_defineMethod (c$, "solveCubic", -function (eqn) { -return java.awt.geom.CubicCurve2D.solveCubic (eqn, eqn); -}, "~A"); -c$.solveCubic = Clazz_defineMethod (c$, "solveCubic", -function (eqn, res) { -var d = eqn[3]; -if (d == 0.0) { -return java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res); -}var a = eqn[2] / d; -var b = eqn[1] / d; -var c = eqn[0] / d; -var roots = 0; -var Q = (a * a - 3.0 * b) / 9.0; -var R = (2.0 * a * a * a - 9.0 * a * b + 27.0 * c) / 54.0; -var R2 = R * R; -var Q3 = Q * Q * Q; -a = a / 3.0; -if (R2 < Q3) { -var theta = Math.acos (R / Math.sqrt (Q3)); -Q = -2.0 * Math.sqrt (Q); -if (res === eqn) { -eqn = Clazz_newDoubleArray (4, 0); -System.arraycopy (res, 0, eqn, 0, 4); -}res[roots++] = Q * Math.cos (theta / 3.0) - a; -res[roots++] = Q * Math.cos ((theta + 6.283185307179586) / 3.0) - a; -res[roots++] = Q * Math.cos ((theta - 6.283185307179586) / 3.0) - a; -java.awt.geom.CubicCurve2D.fixRoots (res, eqn); -} else { -var neg = (R < 0.0); -var S = Math.sqrt (R2 - Q3); -if (neg) { -R = -R; -}var A = Math.pow (R + S, 0.3333333333333333); -if (!neg) { -A = -A; -}var B = (A == 0.0) ? 0.0 : (Q / A); -res[roots++] = (A + B) - a; -}return roots; -}, "~A,~A"); -c$.fixRoots = Clazz_defineMethod (c$, "fixRoots", - function (res, eqn) { -var EPSILON = 1E-5; -for (var i = 0; i < 3; i++) { -var t = res[i]; -if (Math.abs (t) < 1.0E-5) { -res[i] = java.awt.geom.CubicCurve2D.findZero (t, 0, eqn); -} else if (Math.abs (t - 1) < 1.0E-5) { -res[i] = java.awt.geom.CubicCurve2D.findZero (t, 1, eqn); -}} -}, "~A,~A"); -c$.solveEqn = Clazz_defineMethod (c$, "solveEqn", - function (eqn, order, t) { -var v = eqn[order]; -while (--order >= 0) { -v = v * t + eqn[order]; -} -return v; -}, "~A,~N,~N"); -c$.findZero = Clazz_defineMethod (c$, "findZero", - function (t, target, eqn) { -var slopeqn = Clazz_newDoubleArray (-1, [eqn[1], 2 * eqn[2], 3 * eqn[3]]); -var slope; -var origdelta = 0; -var origt = t; -while (true) { -slope = java.awt.geom.CubicCurve2D.solveEqn (slopeqn, 2, t); -if (slope == 0) { -return t; -}var y = java.awt.geom.CubicCurve2D.solveEqn (eqn, 3, t); -if (y == 0) { -return t; -}var delta = -(y / slope); -if (origdelta == 0) { -origdelta = delta; -}if (t < target) { -if (delta < 0) return t; -} else if (t > target) { -if (delta > 0) return t; -} else { -return (delta > 0 ? (target + 4.9E-324) : (target - 4.9E-324)); -}var newt = t + delta; -if (t == newt) { -return t; -}if (delta * origdelta < 0) { -var tag = (origt < t ? java.awt.geom.CubicCurve2D.getTag (target, origt, t) : java.awt.geom.CubicCurve2D.getTag (target, t, origt)); -if (tag != 0) { -return (origt + t) / 2; -}t = target; -} else { -t = newt; -}} -}, "~N,~N,~A"); -Clazz_defineMethod (c$, "contains", -function (x, y) { -if (!(x * 0.0 + y * 0.0 == 0.0)) { -return false; -}var x1 = this.getX1 (); -var y1 = this.getY1 (); -var x2 = this.getX2 (); -var y2 = this.getY2 (); -var crossings = (jssun.awt.geom.Curve.pointCrossingsForLine (x, y, x1, y1, x2, y2) + jssun.awt.geom.Curve.pointCrossingsForCubic (x, y, x1, y1, this.getCtrlX1 (), this.getCtrlY1 (), this.getCtrlX2 (), this.getCtrlY2 (), x2, y2, 0)); -return ((crossings & 1) == 1); -}, "~N,~N"); -Clazz_defineMethod (c$, "contains", -function (p) { -return this.contains (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -c$.fillEqn = Clazz_defineMethod (c$, "fillEqn", - function (eqn, val, c1, cp1, cp2, c2) { -eqn[0] = c1 - val; -eqn[1] = (cp1 - c1) * 3.0; -eqn[2] = (cp2 - cp1 - cp1 + c1) * 3.0; -eqn[3] = c2 + (cp1 - cp2) * 3.0 - c1; -return; -}, "~A,~N,~N,~N,~N,~N"); -c$.evalCubic = Clazz_defineMethod (c$, "evalCubic", - function (vals, num, include0, include1, inflect, c1, cp1, cp2, c2) { -var j = 0; -for (var i = 0; i < num; i++) { -var t = vals[i]; -if ((include0 ? t >= 0 : t > 0) && (include1 ? t <= 1 : t < 1) && (inflect == null || inflect[1] + (2 * inflect[2] + 3 * inflect[3] * t) * t != 0)) { -var u = 1 - t; -vals[j++] = c1 * u * u * u + 3 * cp1 * t * u * u + 3 * cp2 * t * t * u + c2 * t * t * t; -}} -return j; -}, "~A,~N,~B,~B,~A,~N,~N,~N,~N"); -c$.getTag = Clazz_defineMethod (c$, "getTag", - function (coord, low, high) { -if (coord <= low) { -return (coord < low ? -2 : -1); -}if (coord >= high) { -return (coord > high ? 2 : 1); -}return 0; -}, "~N,~N,~N"); -c$.inwards = Clazz_defineMethod (c$, "inwards", - function (pttag, opt1tag, opt2tag) { -switch (pttag) { -case -2: -case 2: -default: -return false; -case -1: -return (opt1tag >= 0 || opt2tag >= 0); -case 0: -return true; -case 1: -return (opt1tag <= 0 || opt2tag <= 0); -} -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (x, y, w, h) { -if (w <= 0 || h <= 0) { -return false; -}var x1 = this.getX1 (); -var y1 = this.getY1 (); -var x1tag = java.awt.geom.CubicCurve2D.getTag (x1, x, x + w); -var y1tag = java.awt.geom.CubicCurve2D.getTag (y1, y, y + h); -if (x1tag == 0 && y1tag == 0) { -return true; -}var x2 = this.getX2 (); -var y2 = this.getY2 (); -var x2tag = java.awt.geom.CubicCurve2D.getTag (x2, x, x + w); -var y2tag = java.awt.geom.CubicCurve2D.getTag (y2, y, y + h); -if (x2tag == 0 && y2tag == 0) { -return true; -}var ctrlx1 = this.getCtrlX1 (); -var ctrly1 = this.getCtrlY1 (); -var ctrlx2 = this.getCtrlX2 (); -var ctrly2 = this.getCtrlY2 (); -var ctrlx1tag = java.awt.geom.CubicCurve2D.getTag (ctrlx1, x, x + w); -var ctrly1tag = java.awt.geom.CubicCurve2D.getTag (ctrly1, y, y + h); -var ctrlx2tag = java.awt.geom.CubicCurve2D.getTag (ctrlx2, x, x + w); -var ctrly2tag = java.awt.geom.CubicCurve2D.getTag (ctrly2, y, y + h); -if (x1tag < 0 && x2tag < 0 && ctrlx1tag < 0 && ctrlx2tag < 0) { -return false; -}if (y1tag < 0 && y2tag < 0 && ctrly1tag < 0 && ctrly2tag < 0) { -return false; -}if (x1tag > 0 && x2tag > 0 && ctrlx1tag > 0 && ctrlx2tag > 0) { -return false; -}if (y1tag > 0 && y2tag > 0 && ctrly1tag > 0 && ctrly2tag > 0) { -return false; -}if (java.awt.geom.CubicCurve2D.inwards (x1tag, x2tag, ctrlx1tag) && java.awt.geom.CubicCurve2D.inwards (y1tag, y2tag, ctrly1tag)) { -return true; -}if (java.awt.geom.CubicCurve2D.inwards (x2tag, x1tag, ctrlx2tag) && java.awt.geom.CubicCurve2D.inwards (y2tag, y1tag, ctrly2tag)) { -return true; -}var xoverlap = (x1tag * x2tag <= 0); -var yoverlap = (y1tag * y2tag <= 0); -if (x1tag == 0 && x2tag == 0 && yoverlap) { -return true; -}if (y1tag == 0 && y2tag == 0 && xoverlap) { -return true; -}var eqn = Clazz_newDoubleArray (4, 0); -var res = Clazz_newDoubleArray (4, 0); -if (!yoverlap) { -java.awt.geom.CubicCurve2D.fillEqn (eqn, (y1tag < 0 ? y : y + h), y1, ctrly1, ctrly2, y2); -var num = java.awt.geom.CubicCurve2D.solveCubic (eqn, res); -num = java.awt.geom.CubicCurve2D.evalCubic (res, num, true, true, null, x1, ctrlx1, ctrlx2, x2); -return (num == 2 && java.awt.geom.CubicCurve2D.getTag (res[0], x, x + w) * java.awt.geom.CubicCurve2D.getTag (res[1], x, x + w) <= 0); -}if (!xoverlap) { -java.awt.geom.CubicCurve2D.fillEqn (eqn, (x1tag < 0 ? x : x + w), x1, ctrlx1, ctrlx2, x2); -var num = java.awt.geom.CubicCurve2D.solveCubic (eqn, res); -num = java.awt.geom.CubicCurve2D.evalCubic (res, num, true, true, null, y1, ctrly1, ctrly2, y2); -return (num == 2 && java.awt.geom.CubicCurve2D.getTag (res[0], y, y + h) * java.awt.geom.CubicCurve2D.getTag (res[1], y, y + h) <= 0); -}var dx = x2 - x1; -var dy = y2 - y1; -var k = y2 * x1 - x2 * y1; -var c1tag; -var c2tag; -if (y1tag == 0) { -c1tag = x1tag; -} else { -c1tag = java.awt.geom.CubicCurve2D.getTag ((k + dx * (y1tag < 0 ? y : y + h)) / dy, x, x + w); -}if (y2tag == 0) { -c2tag = x2tag; -} else { -c2tag = java.awt.geom.CubicCurve2D.getTag ((k + dx * (y2tag < 0 ? y : y + h)) / dy, x, x + w); -}if (c1tag * c2tag <= 0) { -return true; -}c1tag = ((c1tag * x1tag <= 0) ? y1tag : y2tag); -java.awt.geom.CubicCurve2D.fillEqn (eqn, (c2tag < 0 ? x : x + w), x1, ctrlx1, ctrlx2, x2); -var num = java.awt.geom.CubicCurve2D.solveCubic (eqn, res); -num = java.awt.geom.CubicCurve2D.evalCubic (res, num, true, true, null, y1, ctrly1, ctrly2, y2); -var tags = Clazz_newIntArray (num + 1, 0); -for (var i = 0; i < num; i++) { -tags[i] = java.awt.geom.CubicCurve2D.getTag (res[i], y, y + h); -} -tags[num] = c1tag; -java.util.Arrays.sort (tags); -return ((num >= 1 && tags[0] * tags[1] <= 0) || (num >= 3 && tags[2] * tags[3] <= 0)); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (r) { -return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "contains", -function (x, y, w, h) { -if (w <= 0 || h <= 0) { -return false; -}if (!(this.contains (x, y) && this.contains (x + w, y) && this.contains (x + w, y + h) && this.contains (x, y + h))) { -return false; -}var rect = new java.awt.geom.Rectangle2D.Double (x, y, w, h); -return !rect.intersectsLine (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "contains", -function (r) { -return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "getBounds", -function () { -return this.getBounds2D ().getBounds (); -}); -Clazz_defineMethod (c$, "getPathIterator", -function (at) { -return (swingjs.api.Interface.getInstance ("java.awt.geom.CubicInterator", false)).set (this, at); -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "getPathIterator", -function (at, flatness) { -return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); -}, "java.awt.geom.AffineTransform,~N"); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.CubicCurve2D, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x1 = 0; -this.y1 = 0; -this.ctrlx1 = 0; -this.ctrly1 = 0; -this.ctrlx2 = 0; -this.ctrly2 = 0; -this.x2 = 0; -this.y2 = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.CubicCurve2D, "Float", java.awt.geom.CubicCurve2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Float, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d, e, f, g, h) { -Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Float, []); -this.setCurve (a, b, c, d, e, f, g, h); -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getX1", -function () { -return this.x1; -}); -Clazz_overrideMethod (c$, "getY1", -function () { -return this.y1; -}); -Clazz_overrideMethod (c$, "getP1", -function () { -return new java.awt.geom.Point2D.Float (this.x1, this.y1); -}); -Clazz_overrideMethod (c$, "getCtrlX1", -function () { -return this.ctrlx1; -}); -Clazz_overrideMethod (c$, "getCtrlY1", -function () { -return this.ctrly1; -}); -Clazz_overrideMethod (c$, "getCtrlP1", -function () { -return new java.awt.geom.Point2D.Float (this.ctrlx1, this.ctrly1); -}); -Clazz_overrideMethod (c$, "getCtrlX2", -function () { -return this.ctrlx2; -}); -Clazz_overrideMethod (c$, "getCtrlY2", -function () { -return this.ctrly2; -}); -Clazz_overrideMethod (c$, "getCtrlP2", -function () { -return new java.awt.geom.Point2D.Float (this.ctrlx2, this.ctrly2); -}); -Clazz_overrideMethod (c$, "getX2", -function () { -return this.x2; -}); -Clazz_overrideMethod (c$, "getY2", -function () { -return this.y2; -}); -Clazz_overrideMethod (c$, "getP2", -function () { -return new java.awt.geom.Point2D.Float (this.x2, this.y2); -}); -Clazz_defineMethod (c$, "setCurve", -function (a, b, c, d, e, f, g, h) { -this.x1 = a; -this.y1 = b; -this.ctrlx1 = c; -this.ctrly1 = d; -this.ctrlx2 = e; -this.ctrly2 = f; -this.x2 = g; -this.y2 = h; -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setCurve", -function (a, b, c, d, e, f, g, h) { -this.x1 = a; -this.y1 = b; -this.ctrlx1 = c; -this.ctrly1 = d; -this.ctrlx2 = e; -this.ctrly2 = f; -this.x2 = g; -this.y2 = h; -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a = Math.min (Math.min (this.x1, this.x2), Math.min (this.ctrlx1, this.ctrlx2)); -var b = Math.min (Math.min (this.y1, this.y2), Math.min (this.ctrly1, this.ctrly2)); -var c = Math.max (Math.max (this.x1, this.x2), Math.max (this.ctrlx1, this.ctrlx2)); -var d = Math.max (Math.max (this.y1, this.y2), Math.max (this.ctrly1, this.ctrly2)); -return new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b); -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x1 = 0; -this.y1 = 0; -this.ctrlx1 = 0; -this.ctrly1 = 0; -this.ctrlx2 = 0; -this.ctrly2 = 0; -this.x2 = 0; -this.y2 = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.CubicCurve2D, "Double", java.awt.geom.CubicCurve2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Double, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d, e, f, g, h) { -Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Double, []); -this.setCurve (a, b, c, d, e, f, g, h); -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getX1", -function () { -return this.x1; -}); -Clazz_overrideMethod (c$, "getY1", -function () { -return this.y1; -}); -Clazz_overrideMethod (c$, "getP1", -function () { -return new java.awt.geom.Point2D.Double (this.x1, this.y1); -}); -Clazz_overrideMethod (c$, "getCtrlX1", -function () { -return this.ctrlx1; -}); -Clazz_overrideMethod (c$, "getCtrlY1", -function () { -return this.ctrly1; -}); -Clazz_overrideMethod (c$, "getCtrlP1", -function () { -return new java.awt.geom.Point2D.Double (this.ctrlx1, this.ctrly1); -}); -Clazz_overrideMethod (c$, "getCtrlX2", -function () { -return this.ctrlx2; -}); -Clazz_overrideMethod (c$, "getCtrlY2", -function () { -return this.ctrly2; -}); -Clazz_overrideMethod (c$, "getCtrlP2", -function () { -return new java.awt.geom.Point2D.Double (this.ctrlx2, this.ctrly2); -}); -Clazz_overrideMethod (c$, "getX2", -function () { -return this.x2; -}); -Clazz_overrideMethod (c$, "getY2", -function () { -return this.y2; -}); -Clazz_overrideMethod (c$, "getP2", -function () { -return new java.awt.geom.Point2D.Double (this.x2, this.y2); -}); -Clazz_defineMethod (c$, "setCurve", -function (a, b, c, d, e, f, g, h) { -this.x1 = a; -this.y1 = b; -this.ctrlx1 = c; -this.ctrly1 = d; -this.ctrlx2 = e; -this.ctrly2 = f; -this.x2 = g; -this.y2 = h; -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a = Math.min (Math.min (this.x1, this.x2), Math.min (this.ctrlx1, this.ctrlx2)); -var b = Math.min (Math.min (this.y1, this.y2), Math.min (this.ctrly1, this.ctrly2)); -var c = Math.max (Math.max (this.x1, this.x2), Math.max (this.ctrlx1, this.ctrlx2)); -var d = Math.max (Math.max (this.y1, this.y2), Math.max (this.ctrly1, this.ctrly2)); -return new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b); -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"BELOW", -2, -"LOWEDGE", -1, -"INSIDE", 0, -"HIGHEDGE", 1, -"ABOVE", 2); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.CubicIterator", ["java.util.NoSuchElementException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.cubic = null; -this.affine = null; -this.index = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "CubicIterator", null, java.awt.geom.PathIterator); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_makeConstructor (c$, -function (q, at) { -this.set (q, at); -}, "java.awt.geom.CubicCurve2D,java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "set", -function (q, at) { -this.cubic = q; -this.affine = at; -return this; -}, "java.awt.geom.CubicCurve2D,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getWindingRule", -function () { -return 1; -}); -Clazz_overrideMethod (c$, "isDone", -function () { -return (this.index > 1); -}); -Clazz_overrideMethod (c$, "next", -function () { -this.index++; -}); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("cubic iterator iterator out of bounds"); -}var type; -if (this.index == 0) { -coords[0] = this.cubic.getX1 (); -coords[1] = this.cubic.getY1 (); -type = 0; -} else { -coords[0] = this.cubic.getCtrlX1 (); -coords[1] = this.cubic.getCtrlY1 (); -coords[2] = this.cubic.getCtrlX2 (); -coords[3] = this.cubic.getCtrlY2 (); -coords[4] = this.cubic.getX2 (); -coords[5] = this.cubic.getY2 (); -type = 3; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 3); -}return type; -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("cubic iterator iterator out of bounds"); -}var type; -if (this.index == 0) { -coords[0] = this.cubic.getX1 (); -coords[1] = this.cubic.getY1 (); -type = 0; -} else { -coords[0] = this.cubic.getCtrlX1 (); -coords[1] = this.cubic.getCtrlY1 (); -coords[2] = this.cubic.getCtrlX2 (); -coords[3] = this.cubic.getCtrlY2 (); -coords[4] = this.cubic.getX2 (); -coords[5] = this.cubic.getY2 (); -type = 3; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 3); -}return type; -}, "~A"); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.Shape"], "java.awt.geom.Line2D", ["java.lang.InternalError", "java.awt.geom.LineIterator", "$.Point2D", "$.Rectangle2D"], function () { -c$ = Clazz_declareType (java.awt.geom, "Line2D", null, [java.awt.Shape, Cloneable]); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setLine", -function (p1, p2) { -this.setLine (p1.getX (), p1.getY (), p2.getX (), p2.getY ()); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "setLine", -function (l) { -this.setLine (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 ()); -}, "java.awt.geom.Line2D"); -c$.relativeCCW = Clazz_defineMethod (c$, "relativeCCW", -function (x1, y1, x2, y2, px, py) { -x2 -= x1; -y2 -= y1; -px -= x1; -py -= y1; -var ccw = px * y2 - py * x2; -if (ccw == 0.0) { -ccw = px * x2 + py * y2; -if (ccw > 0.0) { -px -= x2; -py -= y2; -ccw = px * x2 + py * y2; -if (ccw < 0.0) { -ccw = 0.0; -}}}return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "relativeCCW", -function (px, py) { -return java.awt.geom.Line2D.relativeCCW (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); -}, "~N,~N"); -Clazz_defineMethod (c$, "relativeCCW", -function (p) { -return java.awt.geom.Line2D.relativeCCW (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -c$.linesIntersect = Clazz_defineMethod (c$, "linesIntersect", -function (x1, y1, x2, y2, x3, y3, x4, y4) { -return ((java.awt.geom.Line2D.relativeCCW (x1, y1, x2, y2, x3, y3) * java.awt.geom.Line2D.relativeCCW (x1, y1, x2, y2, x4, y4) <= 0) && (java.awt.geom.Line2D.relativeCCW (x3, y3, x4, y4, x1, y1) * java.awt.geom.Line2D.relativeCCW (x3, y3, x4, y4, x2, y2) <= 0)); -}, "~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersectsLine", -function (x1, y1, x2, y2) { -return java.awt.geom.Line2D.linesIntersect (x1, y1, x2, y2, this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersectsLine", -function (l) { -return java.awt.geom.Line2D.linesIntersect (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 (), this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); -}, "java.awt.geom.Line2D"); -c$.ptSegDistSq = Clazz_defineMethod (c$, "ptSegDistSq", -function (x1, y1, x2, y2, px, py) { -x2 -= x1; -y2 -= y1; -px -= x1; -py -= y1; -var dotprod = px * x2 + py * y2; -var projlenSq; -if (dotprod <= 0.0) { -projlenSq = 0.0; -} else { -px = x2 - px; -py = y2 - py; -dotprod = px * x2 + py * y2; -if (dotprod <= 0.0) { -projlenSq = 0.0; -} else { -projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2); -}}var lenSq = px * px + py * py - projlenSq; -if (lenSq < 0) { -lenSq = 0; -}return lenSq; -}, "~N,~N,~N,~N,~N,~N"); -c$.ptSegDist = Clazz_defineMethod (c$, "ptSegDist", -function (x1, y1, x2, y2, px, py) { -return Math.sqrt (java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, px, py)); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "ptSegDistSq", -function (px, py) { -return java.awt.geom.Line2D.ptSegDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); -}, "~N,~N"); -Clazz_defineMethod (c$, "ptSegDistSq", -function (pt) { -return java.awt.geom.Line2D.ptSegDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "ptSegDist", -function (px, py) { -return java.awt.geom.Line2D.ptSegDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); -}, "~N,~N"); -Clazz_defineMethod (c$, "ptSegDist", -function (pt) { -return java.awt.geom.Line2D.ptSegDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); -}, "java.awt.geom.Point2D"); -c$.ptLineDistSq = Clazz_defineMethod (c$, "ptLineDistSq", -function (x1, y1, x2, y2, px, py) { -x2 -= x1; -y2 -= y1; -px -= x1; -py -= y1; -var dotprod = px * x2 + py * y2; -var projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2); -var lenSq = px * px + py * py - projlenSq; -if (lenSq < 0) { -lenSq = 0; -}return lenSq; -}, "~N,~N,~N,~N,~N,~N"); -c$.ptLineDist = Clazz_defineMethod (c$, "ptLineDist", -function (x1, y1, x2, y2, px, py) { -return Math.sqrt (java.awt.geom.Line2D.ptLineDistSq (x1, y1, x2, y2, px, py)); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "ptLineDistSq", -function (px, py) { -return java.awt.geom.Line2D.ptLineDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); -}, "~N,~N"); -Clazz_defineMethod (c$, "ptLineDistSq", -function (pt) { -return java.awt.geom.Line2D.ptLineDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "ptLineDist", -function (px, py) { -return java.awt.geom.Line2D.ptLineDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); -}, "~N,~N"); -Clazz_defineMethod (c$, "ptLineDist", -function (pt) { -return java.awt.geom.Line2D.ptLineDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "contains", -function (x, y) { -return false; -}, "~N,~N"); -Clazz_defineMethod (c$, "contains", -function (p) { -return false; -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "intersects", -function (x, y, w, h) { -return this.intersects ( new java.awt.geom.Rectangle2D.Double (x, y, w, h)); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (r) { -return r.intersectsLine (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "contains", -function (x, y, w, h) { -return false; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "contains", -function (r) { -return false; -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "getBounds", -function () { -return this.getBounds2D ().getBounds (); -}); -Clazz_defineMethod (c$, "getPathIterator", -function (at) { -return new java.awt.geom.LineIterator (this, at); -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "getPathIterator", -function (at, flatness) { -return new java.awt.geom.LineIterator (this, at); -}, "java.awt.geom.AffineTransform,~N"); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.Line2D, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x1 = 0; -this.y1 = 0; -this.x2 = 0; -this.y2 = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Line2D, "Float", java.awt.geom.Line2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.Line2D.Float, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d) { -Clazz_superConstructor (this, java.awt.geom.Line2D.Float, []); -this.setLine (a, b, c, d); -}, "~N,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Line2D.Float, []); -this.setLine (a, b); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_overrideMethod (c$, "getX1", -function () { -return this.x1; -}); -Clazz_overrideMethod (c$, "getY1", -function () { -return this.y1; -}); -Clazz_overrideMethod (c$, "getP1", -function () { -return new java.awt.geom.Point2D.Float (this.x1, this.y1); -}); -Clazz_overrideMethod (c$, "getX2", -function () { -return this.x2; -}); -Clazz_overrideMethod (c$, "getY2", -function () { -return this.y2; -}); -Clazz_overrideMethod (c$, "getP2", -function () { -return new java.awt.geom.Point2D.Float (this.x2, this.y2); -}); -Clazz_defineMethod (c$, "setLine", -function (a, b, c, d) { -this.x1 = a; -this.y1 = b; -this.x2 = c; -this.y2 = d; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setLine", -function (a, b, c, d) { -this.x1 = a; -this.y1 = b; -this.x2 = c; -this.y2 = d; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a; -var b; -var c; -var d; -if (this.x1 < this.x2) { -a = this.x1; -c = this.x2 - this.x1; -} else { -a = this.x2; -c = this.x1 - this.x2; -}if (this.y1 < this.y2) { -b = this.y1; -d = this.y2 - this.y1; -} else { -b = this.y2; -d = this.y1 - this.y2; -}return new java.awt.geom.Rectangle2D.Float (a, b, c, d); -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x1 = 0; -this.y1 = 0; -this.x2 = 0; -this.y2 = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Line2D, "Double", java.awt.geom.Line2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.Line2D.Double, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d) { -Clazz_superConstructor (this, java.awt.geom.Line2D.Double, []); -this.setLine (a, b, c, d); -}, "~N,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Line2D.Double, []); -this.setLine (a, b); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_overrideMethod (c$, "getX1", -function () { -return this.x1; -}); -Clazz_overrideMethod (c$, "getY1", -function () { -return this.y1; -}); -Clazz_overrideMethod (c$, "getP1", -function () { -return new java.awt.geom.Point2D.Double (this.x1, this.y1); -}); -Clazz_overrideMethod (c$, "getX2", -function () { -return this.x2; -}); -Clazz_overrideMethod (c$, "getY2", -function () { -return this.y2; -}); -Clazz_overrideMethod (c$, "getP2", -function () { -return new java.awt.geom.Point2D.Double (this.x2, this.y2); -}); -Clazz_defineMethod (c$, "setLine", -function (a, b, c, d) { -this.x1 = a; -this.y1 = b; -this.x2 = c; -this.y2 = d; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a; -var b; -var c; -var d; -if (this.x1 < this.x2) { -a = this.x1; -c = this.x2 - this.x1; -} else { -a = this.x2; -c = this.x1 - this.x2; -}if (this.y1 < this.y2) { -b = this.y1; -d = this.y2 - this.y1; -} else { -b = this.y2; -d = this.y1 - this.y2; -}return new java.awt.geom.Rectangle2D.Double (a, b, c, d); -}); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.LineIterator", ["java.util.NoSuchElementException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.line = null; -this.affine = null; -this.index = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "LineIterator", null, java.awt.geom.PathIterator); -Clazz_makeConstructor (c$, -function (l, at) { -this.line = l; -this.affine = at; -}, "java.awt.geom.Line2D,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getWindingRule", -function () { -return 1; -}); -Clazz_overrideMethod (c$, "isDone", -function () { -return (this.index > 1); -}); -Clazz_overrideMethod (c$, "next", -function () { -this.index++; -}); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("line iterator out of bounds"); -}var type; -if (this.index == 0) { -coords[0] = this.line.getX1 (); -coords[1] = this.line.getY1 (); -type = 0; -} else { -coords[0] = this.line.getX2 (); -coords[1] = this.line.getY2 (); -type = 1; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, 1); -}return type; -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("line iterator out of bounds"); -}var type; -if (this.index == 0) { -coords[0] = this.line.getX1 (); -coords[1] = this.line.getY1 (); -type = 0; -} else { -coords[0] = this.line.getX2 (); -coords[1] = this.line.getY2 (); -type = 1; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, 1); -}return type; -}, "~A"); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.Shape"], "java.awt.geom.QuadCurve2D", ["java.lang.InternalError", "java.awt.geom.FlatteningPathIterator", "$.Line2D", "$.Point2D", "$.QuadIterator", "$.Rectangle2D"], function () { -c$ = Clazz_declareType (java.awt.geom, "QuadCurve2D", null, [java.awt.Shape, Cloneable]); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setCurve", -function (coords, offset) { -this.setCurve (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5]); -}, "~A,~N"); -Clazz_defineMethod (c$, "setCurve", -function (p1, cp, p2) { -this.setCurve (p1.getX (), p1.getY (), cp.getX (), cp.getY (), p2.getX (), p2.getY ()); -}, "java.awt.geom.Point2D,java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "setCurve", -function (pts, offset) { -this.setCurve (pts[offset + 0].getX (), pts[offset + 0].getY (), pts[offset + 1].getX (), pts[offset + 1].getY (), pts[offset + 2].getX (), pts[offset + 2].getY ()); -}, "~A,~N"); -Clazz_defineMethod (c$, "setCurve", -function (c) { -this.setCurve (c.getX1 (), c.getY1 (), c.getCtrlX (), c.getCtrlY (), c.getX2 (), c.getY2 ()); -}, "java.awt.geom.QuadCurve2D"); -c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", -function (x1, y1, ctrlx, ctrly, x2, y2) { -return java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, ctrlx, ctrly); -}, "~N,~N,~N,~N,~N,~N"); -c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", -function (x1, y1, ctrlx, ctrly, x2, y2) { -return java.awt.geom.Line2D.ptSegDist (x1, y1, x2, y2, ctrlx, ctrly); -}, "~N,~N,~N,~N,~N,~N"); -c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", -function (coords, offset) { -return java.awt.geom.Line2D.ptSegDistSq (coords[offset + 0], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); -}, "~A,~N"); -c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", -function (coords, offset) { -return java.awt.geom.Line2D.ptSegDist (coords[offset + 0], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); -}, "~A,~N"); -Clazz_defineMethod (c$, "getFlatnessSq", -function () { -return java.awt.geom.Line2D.ptSegDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), this.getCtrlX (), this.getCtrlY ()); -}); -Clazz_defineMethod (c$, "getFlatness", -function () { -return java.awt.geom.Line2D.ptSegDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), this.getCtrlX (), this.getCtrlY ()); -}); -Clazz_defineMethod (c$, "subdivide", -function (left, right) { -java.awt.geom.QuadCurve2D.subdivide (this, left, right); -}, "java.awt.geom.QuadCurve2D,java.awt.geom.QuadCurve2D"); -c$.subdivide = Clazz_defineMethod (c$, "subdivide", -function (src, left, right) { -var x1 = src.getX1 (); -var y1 = src.getY1 (); -var ctrlx = src.getCtrlX (); -var ctrly = src.getCtrlY (); -var x2 = src.getX2 (); -var y2 = src.getY2 (); -var ctrlx1 = (x1 + ctrlx) / 2.0; -var ctrly1 = (y1 + ctrly) / 2.0; -var ctrlx2 = (x2 + ctrlx) / 2.0; -var ctrly2 = (y2 + ctrly) / 2.0; -ctrlx = (ctrlx1 + ctrlx2) / 2.0; -ctrly = (ctrly1 + ctrly2) / 2.0; -if (left != null) { -left.setCurve (x1, y1, ctrlx1, ctrly1, ctrlx, ctrly); -}if (right != null) { -right.setCurve (ctrlx, ctrly, ctrlx2, ctrly2, x2, y2); -}}, "java.awt.geom.QuadCurve2D,java.awt.geom.QuadCurve2D,java.awt.geom.QuadCurve2D"); -c$.subdivide = Clazz_defineMethod (c$, "subdivide", -function (src, srcoff, left, leftoff, right, rightoff) { -var x1 = src[srcoff + 0]; -var y1 = src[srcoff + 1]; -var ctrlx = src[srcoff + 2]; -var ctrly = src[srcoff + 3]; -var x2 = src[srcoff + 4]; -var y2 = src[srcoff + 5]; -if (left != null) { -left[leftoff + 0] = x1; -left[leftoff + 1] = y1; -}if (right != null) { -right[rightoff + 4] = x2; -right[rightoff + 5] = y2; -}x1 = (x1 + ctrlx) / 2.0; -y1 = (y1 + ctrly) / 2.0; -x2 = (x2 + ctrlx) / 2.0; -y2 = (y2 + ctrly) / 2.0; -ctrlx = (x1 + x2) / 2.0; -ctrly = (y1 + y2) / 2.0; -if (left != null) { -left[leftoff + 2] = x1; -left[leftoff + 3] = y1; -left[leftoff + 4] = ctrlx; -left[leftoff + 5] = ctrly; -}if (right != null) { -right[rightoff + 0] = ctrlx; -right[rightoff + 1] = ctrly; -right[rightoff + 2] = x2; -right[rightoff + 3] = y2; -}}, "~A,~N,~A,~N,~A,~N"); -c$.solveQuadratic = Clazz_defineMethod (c$, "solveQuadratic", -function (eqn) { -return java.awt.geom.QuadCurve2D.solveQuadratic (eqn, eqn); -}, "~A"); -c$.solveQuadratic = Clazz_defineMethod (c$, "solveQuadratic", -function (eqn, res) { -var a = eqn[2]; -var b = eqn[1]; -var c = eqn[0]; -var roots = 0; -if (a == 0.0) { -if (b == 0.0) { -return -1; -}res[roots++] = -c / b; -} else { -var d = b * b - 4.0 * a * c; -if (d < 0.0) { -return 0; -}d = Math.sqrt (d); -if (b < 0.0) { -d = -d; -}var q = (b + d) / -2.0; -res[roots++] = q / a; -if (q != 0.0) { -res[roots++] = c / q; -}}return roots; -}, "~A,~A"); -Clazz_defineMethod (c$, "contains", -function (x, y) { -var x1 = this.getX1 (); -var y1 = this.getY1 (); -var xc = this.getCtrlX (); -var yc = this.getCtrlY (); -var x2 = this.getX2 (); -var y2 = this.getY2 (); -var kx = x1 - 2 * xc + x2; -var ky = y1 - 2 * yc + y2; -var dx = x - x1; -var dy = y - y1; -var dxl = x2 - x1; -var dyl = y2 - y1; -var t0 = (dx * ky - dy * kx) / (dxl * ky - dyl * kx); -if (t0 < 0 || t0 > 1 || t0 != t0) { -return false; -}var xb = kx * t0 * t0 + 2 * (xc - x1) * t0 + x1; -var yb = ky * t0 * t0 + 2 * (yc - y1) * t0 + y1; -var xl = dxl * t0 + x1; -var yl = dyl * t0 + y1; -return (x >= xb && x < xl) || (x >= xl && x < xb) || (y >= yb && y < yl) || (y >= yl && y < yb); -}, "~N,~N"); -Clazz_defineMethod (c$, "contains", -function (p) { -return this.contains (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -c$.fillEqn = Clazz_defineMethod (c$, "fillEqn", - function (eqn, val, c1, cp, c2) { -eqn[0] = c1 - val; -eqn[1] = cp + cp - c1 - c1; -eqn[2] = c1 - cp - cp + c2; -return; -}, "~A,~N,~N,~N,~N"); -c$.evalQuadratic = Clazz_defineMethod (c$, "evalQuadratic", - function (vals, num, include0, include1, inflect, c1, ctrl, c2) { -var j = 0; -for (var i = 0; i < num; i++) { -var t = vals[i]; -if ((include0 ? t >= 0 : t > 0) && (include1 ? t <= 1 : t < 1) && (inflect == null || inflect[1] + 2 * inflect[2] * t != 0)) { -var u = 1 - t; -vals[j++] = c1 * u * u + 2 * ctrl * t * u + c2 * t * t; -}} -return j; -}, "~A,~N,~B,~B,~A,~N,~N,~N"); -c$.getTag = Clazz_defineMethod (c$, "getTag", - function (coord, low, high) { -if (coord <= low) { -return (coord < low ? -2 : -1); -}if (coord >= high) { -return (coord > high ? 2 : 1); -}return 0; -}, "~N,~N,~N"); -c$.inwards = Clazz_defineMethod (c$, "inwards", - function (pttag, opt1tag, opt2tag) { -switch (pttag) { -case -2: -case 2: -default: -return false; -case -1: -return (opt1tag >= 0 || opt2tag >= 0); -case 0: -return true; -case 1: -return (opt1tag <= 0 || opt2tag <= 0); -} -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (x, y, w, h) { -if (w <= 0 || h <= 0) { -return false; -}var x1 = this.getX1 (); -var y1 = this.getY1 (); -var x1tag = java.awt.geom.QuadCurve2D.getTag (x1, x, x + w); -var y1tag = java.awt.geom.QuadCurve2D.getTag (y1, y, y + h); -if (x1tag == 0 && y1tag == 0) { -return true; -}var x2 = this.getX2 (); -var y2 = this.getY2 (); -var x2tag = java.awt.geom.QuadCurve2D.getTag (x2, x, x + w); -var y2tag = java.awt.geom.QuadCurve2D.getTag (y2, y, y + h); -if (x2tag == 0 && y2tag == 0) { -return true; -}var ctrlx = this.getCtrlX (); -var ctrly = this.getCtrlY (); -var ctrlxtag = java.awt.geom.QuadCurve2D.getTag (ctrlx, x, x + w); -var ctrlytag = java.awt.geom.QuadCurve2D.getTag (ctrly, y, y + h); -if (x1tag < 0 && x2tag < 0 && ctrlxtag < 0) { -return false; -}if (y1tag < 0 && y2tag < 0 && ctrlytag < 0) { -return false; -}if (x1tag > 0 && x2tag > 0 && ctrlxtag > 0) { -return false; -}if (y1tag > 0 && y2tag > 0 && ctrlytag > 0) { -return false; -}if (java.awt.geom.QuadCurve2D.inwards (x1tag, x2tag, ctrlxtag) && java.awt.geom.QuadCurve2D.inwards (y1tag, y2tag, ctrlytag)) { -return true; -}if (java.awt.geom.QuadCurve2D.inwards (x2tag, x1tag, ctrlxtag) && java.awt.geom.QuadCurve2D.inwards (y2tag, y1tag, ctrlytag)) { -return true; -}var xoverlap = (x1tag * x2tag <= 0); -var yoverlap = (y1tag * y2tag <= 0); -if (x1tag == 0 && x2tag == 0 && yoverlap) { -return true; -}if (y1tag == 0 && y2tag == 0 && xoverlap) { -return true; -}var eqn = Clazz_newDoubleArray (3, 0); -var res = Clazz_newDoubleArray (3, 0); -if (!yoverlap) { -java.awt.geom.QuadCurve2D.fillEqn (eqn, (y1tag < 0 ? y : y + h), y1, ctrly, y2); -return (java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res) == 2 && java.awt.geom.QuadCurve2D.evalQuadratic (res, 2, true, true, null, x1, ctrlx, x2) == 2 && java.awt.geom.QuadCurve2D.getTag (res[0], x, x + w) * java.awt.geom.QuadCurve2D.getTag (res[1], x, x + w) <= 0); -}if (!xoverlap) { -java.awt.geom.QuadCurve2D.fillEqn (eqn, (x1tag < 0 ? x : x + w), x1, ctrlx, x2); -return (java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res) == 2 && java.awt.geom.QuadCurve2D.evalQuadratic (res, 2, true, true, null, y1, ctrly, y2) == 2 && java.awt.geom.QuadCurve2D.getTag (res[0], y, y + h) * java.awt.geom.QuadCurve2D.getTag (res[1], y, y + h) <= 0); -}var dx = x2 - x1; -var dy = y2 - y1; -var k = y2 * x1 - x2 * y1; -var c1tag; -var c2tag; -if (y1tag == 0) { -c1tag = x1tag; -} else { -c1tag = java.awt.geom.QuadCurve2D.getTag ((k + dx * (y1tag < 0 ? y : y + h)) / dy, x, x + w); -}if (y2tag == 0) { -c2tag = x2tag; -} else { -c2tag = java.awt.geom.QuadCurve2D.getTag ((k + dx * (y2tag < 0 ? y : y + h)) / dy, x, x + w); -}if (c1tag * c2tag <= 0) { -return true; -}c1tag = ((c1tag * x1tag <= 0) ? y1tag : y2tag); -java.awt.geom.QuadCurve2D.fillEqn (eqn, (c2tag < 0 ? x : x + w), x1, ctrlx, x2); -var num = java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res); -java.awt.geom.QuadCurve2D.evalQuadratic (res, num, true, true, null, y1, ctrly, y2); -c2tag = java.awt.geom.QuadCurve2D.getTag (res[0], y, y + h); -return (c1tag * c2tag <= 0); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (r) { -return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "contains", -function (x, y, w, h) { -if (w <= 0 || h <= 0) { -return false; -}return (this.contains (x, y) && this.contains (x + w, y) && this.contains (x + w, y + h) && this.contains (x, y + h)); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "contains", -function (r) { -return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "getBounds", -function () { -return this.getBounds2D ().getBounds (); -}); -Clazz_defineMethod (c$, "getPathIterator", -function (at) { -return new java.awt.geom.QuadIterator (this, at); -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "getPathIterator", -function (at, flatness) { -return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); -}, "java.awt.geom.AffineTransform,~N"); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.QuadCurve2D, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x1 = 0; -this.y1 = 0; -this.ctrlx = 0; -this.ctrly = 0; -this.x2 = 0; -this.y2 = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.QuadCurve2D, "Float", java.awt.geom.QuadCurve2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Float, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d, e, f) { -Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Float, []); -this.setCurve (a, b, c, d, e, f); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getX1", -function () { -return this.x1; -}); -Clazz_overrideMethod (c$, "getY1", -function () { -return this.y1; -}); -Clazz_overrideMethod (c$, "getP1", -function () { -return new java.awt.geom.Point2D.Float (this.x1, this.y1); -}); -Clazz_overrideMethod (c$, "getCtrlX", -function () { -return this.ctrlx; -}); -Clazz_overrideMethod (c$, "getCtrlY", -function () { -return this.ctrly; -}); -Clazz_overrideMethod (c$, "getCtrlPt", -function () { -return new java.awt.geom.Point2D.Float (this.ctrlx, this.ctrly); -}); -Clazz_overrideMethod (c$, "getX2", -function () { -return this.x2; -}); -Clazz_overrideMethod (c$, "getY2", -function () { -return this.y2; -}); -Clazz_overrideMethod (c$, "getP2", -function () { -return new java.awt.geom.Point2D.Float (this.x2, this.y2); -}); -Clazz_defineMethod (c$, "setCurve", -function (a, b, c, d, e, f) { -this.x1 = a; -this.y1 = b; -this.ctrlx = c; -this.ctrly = d; -this.x2 = e; -this.y2 = f; -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setCurve", -function (a, b, c, d, e, f) { -this.x1 = a; -this.y1 = b; -this.ctrlx = c; -this.ctrly = d; -this.x2 = e; -this.y2 = f; -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a = Math.min (Math.min (this.x1, this.x2), this.ctrlx); -var b = Math.min (Math.min (this.y1, this.y2), this.ctrly); -var c = Math.max (Math.max (this.x1, this.x2), this.ctrlx); -var d = Math.max (Math.max (this.y1, this.y2), this.ctrly); -return new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b); -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x1 = 0; -this.y1 = 0; -this.ctrlx = 0; -this.ctrly = 0; -this.x2 = 0; -this.y2 = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.QuadCurve2D, "Double", java.awt.geom.QuadCurve2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Double, []); -}); -Clazz_makeConstructor (c$, -function (a, b, c, d, e, f) { -Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Double, []); -this.setCurve (a, b, c, d, e, f); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getX1", -function () { -return this.x1; -}); -Clazz_overrideMethod (c$, "getY1", -function () { -return this.y1; -}); -Clazz_overrideMethod (c$, "getP1", -function () { -return new java.awt.geom.Point2D.Double (this.x1, this.y1); -}); -Clazz_overrideMethod (c$, "getCtrlX", -function () { -return this.ctrlx; -}); -Clazz_overrideMethod (c$, "getCtrlY", -function () { -return this.ctrly; -}); -Clazz_overrideMethod (c$, "getCtrlPt", -function () { -return new java.awt.geom.Point2D.Double (this.ctrlx, this.ctrly); -}); -Clazz_overrideMethod (c$, "getX2", -function () { -return this.x2; -}); -Clazz_overrideMethod (c$, "getY2", -function () { -return this.y2; -}); -Clazz_overrideMethod (c$, "getP2", -function () { -return new java.awt.geom.Point2D.Double (this.x2, this.y2); -}); -Clazz_defineMethod (c$, "setCurve", -function (a, b, c, d, e, f) { -this.x1 = a; -this.y1 = b; -this.ctrlx = c; -this.ctrly = d; -this.x2 = e; -this.y2 = f; -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a = Math.min (Math.min (this.x1, this.x2), this.ctrlx); -var b = Math.min (Math.min (this.y1, this.y2), this.ctrly); -var c = Math.max (Math.max (this.x1, this.x2), this.ctrlx); -var d = Math.max (Math.max (this.y1, this.y2), this.ctrly); -return new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b); -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"BELOW", -2, -"LOWEDGE", -1, -"INSIDE", 0, -"HIGHEDGE", 1, -"ABOVE", 2); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.QuadIterator", ["java.util.NoSuchElementException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.quad = null; -this.affine = null; -this.index = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "QuadIterator", null, java.awt.geom.PathIterator); -Clazz_makeConstructor (c$, -function (q, at) { -this.quad = q; -this.affine = at; -}, "java.awt.geom.QuadCurve2D,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getWindingRule", -function () { -return 1; -}); -Clazz_overrideMethod (c$, "isDone", -function () { -return (this.index > 1); -}); -Clazz_overrideMethod (c$, "next", -function () { -this.index++; -}); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("quad iterator iterator out of bounds"); -}var type; -if (this.index == 0) { -coords[0] = this.quad.getX1 (); -coords[1] = this.quad.getY1 (); -type = 0; -} else { -coords[0] = this.quad.getCtrlX (); -coords[1] = this.quad.getCtrlY (); -coords[2] = this.quad.getX2 (); -coords[3] = this.quad.getY2 (); -type = 2; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 2); -}return type; -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("quad iterator iterator out of bounds"); -}var type; -if (this.index == 0) { -coords[0] = this.quad.getX1 (); -coords[1] = this.quad.getY1 (); -type = 0; -} else { -coords[0] = this.quad.getCtrlX (); -coords[1] = this.quad.getCtrlY (); -coords[2] = this.quad.getX2 (); -coords[3] = this.quad.getY2 (); -type = 2; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 2); -}return type; -}, "~A"); -}); -Clazz_declarePackage ("jssun.awt.geom"); -Clazz_load (null, "jssun.awt.geom.Curve", ["java.lang.Double", "$.InternalError", "java.awt.geom.IllegalPathStateException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.direction = 0; -Clazz_instantialize (this, arguments); -}, jssun.awt.geom, "Curve"); -c$.insertMove = Clazz_defineMethod (c$, "insertMove", -function (curves, x, y) { -curves.add ( new jssun.awt.geom.Order0 (x, y)); -}, "java.util.Vector,~N,~N"); -c$.insertLine = Clazz_defineMethod (c$, "insertLine", -function (curves, x0, y0, x1, y1) { -if (y0 < y1) { -curves.add ( new jssun.awt.geom.Order1 (x0, y0, x1, y1, 1)); -} else if (y0 > y1) { -curves.add ( new jssun.awt.geom.Order1 (x1, y1, x0, y0, -1)); -} else { -}}, "java.util.Vector,~N,~N,~N,~N"); -c$.insertQuad = Clazz_defineMethod (c$, "insertQuad", -function (curves, x0, y0, coords) { -var y1 = coords[3]; -if (y0 > y1) { -jssun.awt.geom.Order2.insert (curves, coords, coords[2], y1, coords[0], coords[1], x0, y0, -1); -} else if (y0 == y1 && y0 == coords[1]) { -return; -} else { -jssun.awt.geom.Order2.insert (curves, coords, x0, y0, coords[0], coords[1], coords[2], y1, 1); -}}, "java.util.Vector,~N,~N,~A"); -c$.insertCubic = Clazz_defineMethod (c$, "insertCubic", -function (curves, x0, y0, coords) { -var y1 = coords[5]; -if (y0 > y1) { -jssun.awt.geom.Order3.insert (curves, coords, coords[4], y1, coords[2], coords[3], coords[0], coords[1], x0, y0, -1); -} else if (y0 == y1 && y0 == coords[1] && y0 == coords[3]) { -return; -} else { -jssun.awt.geom.Order3.insert (curves, coords, x0, y0, coords[0], coords[1], coords[2], coords[3], coords[4], y1, 1); -}}, "java.util.Vector,~N,~N,~A"); -c$.pointCrossingsForPath = Clazz_defineMethod (c$, "pointCrossingsForPath", -function (pi, px, py) { -if (pi.isDone ()) { -return 0; -}var coords = Clazz_newDoubleArray (6, 0); -if (pi.currentSegment (coords) != 0) { -throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); -}pi.next (); -var movx = coords[0]; -var movy = coords[1]; -var curx = movx; -var cury = movy; -var endx; -var endy; -var crossings = 0; -while (!pi.isDone ()) { -switch (pi.currentSegment (coords)) { -case 0: -if (cury != movy) { -crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy); -}movx = curx = coords[0]; -movy = cury = coords[1]; -break; -case 1: -endx = coords[0]; -endy = coords[1]; -crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, endx, endy); -curx = endx; -cury = endy; -break; -case 2: -endx = coords[2]; -endy = coords[3]; -crossings += jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, curx, cury, coords[0], coords[1], endx, endy, 0); -curx = endx; -cury = endy; -break; -case 3: -endx = coords[4]; -endy = coords[5]; -crossings += jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0); -curx = endx; -cury = endy; -break; -case 4: -if (cury != movy) { -crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy); -}curx = movx; -cury = movy; -break; -} -pi.next (); -} -if (cury != movy) { -crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy); -}return crossings; -}, "java.awt.geom.PathIterator,~N,~N"); -c$.pointCrossingsForLine = Clazz_defineMethod (c$, "pointCrossingsForLine", -function (px, py, x0, y0, x1, y1) { -if (py < y0 && py < y1) return 0; -if (py >= y0 && py >= y1) return 0; -if (px >= x0 && px >= x1) return 0; -if (px < x0 && px < x1) return (y0 < y1) ? 1 : -1; -var xintercept = x0 + (py - y0) * (x1 - x0) / (y1 - y0); -if (px >= xintercept) return 0; -return (y0 < y1) ? 1 : -1; -}, "~N,~N,~N,~N,~N,~N"); -c$.pointCrossingsForQuad = Clazz_defineMethod (c$, "pointCrossingsForQuad", -function (px, py, x0, y0, xc, yc, x1, y1, level) { -if (py < y0 && py < yc && py < y1) return 0; -if (py >= y0 && py >= yc && py >= y1) return 0; -if (px >= x0 && px >= xc && px >= x1) return 0; -if (px < x0 && px < xc && px < x1) { -if (py >= y0) { -if (py < y1) return 1; -} else { -if (py >= y1) return -1; -}return 0; -}if (level > 52) return jssun.awt.geom.Curve.pointCrossingsForLine (px, py, x0, y0, x1, y1); -var x0c = (x0 + xc) / 2; -var y0c = (y0 + yc) / 2; -var xc1 = (xc + x1) / 2; -var yc1 = (yc + y1) / 2; -xc = (x0c + xc1) / 2; -yc = (y0c + yc1) / 2; -if (Double.isNaN (xc) || Double.isNaN (yc)) { -return 0; -}return (jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, x0, y0, x0c, y0c, xc, yc, level + 1) + jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, xc, yc, xc1, yc1, x1, y1, level + 1)); -}, "~N,~N,~N,~N,~N,~N,~N,~N,~N"); -c$.pointCrossingsForCubic = Clazz_defineMethod (c$, "pointCrossingsForCubic", -function (px, py, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) { -if (py < y0 && py < yc0 && py < yc1 && py < y1) return 0; -if (py >= y0 && py >= yc0 && py >= yc1 && py >= y1) return 0; -if (px >= x0 && px >= xc0 && px >= xc1 && px >= x1) return 0; -if (px < x0 && px < xc0 && px < xc1 && px < x1) { -if (py >= y0) { -if (py < y1) return 1; -} else { -if (py >= y1) return -1; -}return 0; -}if (level > 52) return jssun.awt.geom.Curve.pointCrossingsForLine (px, py, x0, y0, x1, y1); -var xmid = (xc0 + xc1) / 2; -var ymid = (yc0 + yc1) / 2; -xc0 = (x0 + xc0) / 2; -yc0 = (y0 + yc0) / 2; -xc1 = (xc1 + x1) / 2; -yc1 = (yc1 + y1) / 2; -var xc0m = (xc0 + xmid) / 2; -var yc0m = (yc0 + ymid) / 2; -var xmc1 = (xmid + xc1) / 2; -var ymc1 = (ymid + yc1) / 2; -xmid = (xc0m + xmc1) / 2; -ymid = (yc0m + ymc1) / 2; -if (Double.isNaN (xmid) || Double.isNaN (ymid)) { -return 0; -}return (jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1) + jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1)); -}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); -c$.rectCrossingsForPath = Clazz_defineMethod (c$, "rectCrossingsForPath", -function (pi, rxmin, rymin, rxmax, rymax) { -if (rxmax <= rxmin || rymax <= rymin) { -return 0; -}if (pi.isDone ()) { -return 0; -}var coords = Clazz_newDoubleArray (6, 0); -if (pi.currentSegment (coords) != 0) { -throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); -}pi.next (); -var curx; -var cury; -var movx; -var movy; -var endx; -var endy; -curx = movx = coords[0]; -cury = movy = coords[1]; -var crossings = 0; -while (crossings != -2147483648 && !pi.isDone ()) { -switch (pi.currentSegment (coords)) { -case 0: -if (curx != movx || cury != movy) { -crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); -}movx = curx = coords[0]; -movy = cury = coords[1]; -break; -case 1: -endx = coords[0]; -endy = coords[1]; -crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, endx, endy); -curx = endx; -cury = endy; -break; -case 2: -endx = coords[2]; -endy = coords[3]; -crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], endx, endy, 0); -curx = endx; -cury = endy; -break; -case 3: -endx = coords[4]; -endy = coords[5]; -crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0); -curx = endx; -cury = endy; -break; -case 4: -if (curx != movx || cury != movy) { -crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); -}curx = movx; -cury = movy; -break; -} -pi.next (); -} -if (crossings != -2147483648 && (curx != movx || cury != movy)) { -crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); -}return crossings; -}, "java.awt.geom.PathIterator,~N,~N,~N,~N"); -c$.rectCrossingsForLine = Clazz_defineMethod (c$, "rectCrossingsForLine", -function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1) { -if (y0 >= rymax && y1 >= rymax) return crossings; -if (y0 <= rymin && y1 <= rymin) return crossings; -if (x0 <= rxmin && x1 <= rxmin) return crossings; -if (x0 >= rxmax && x1 >= rxmax) { -if (y0 < y1) { -if (y0 <= rymin) crossings++; -if (y1 >= rymax) crossings++; -} else if (y1 < y0) { -if (y1 <= rymin) crossings--; -if (y0 >= rymax) crossings--; -}return crossings; -}if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) { -return -2147483648; -}var xi0 = x0; -if (y0 < rymin) { -xi0 += ((rymin - y0) * (x1 - x0) / (y1 - y0)); -} else if (y0 > rymax) { -xi0 += ((rymax - y0) * (x1 - x0) / (y1 - y0)); -}var xi1 = x1; -if (y1 < rymin) { -xi1 += ((rymin - y1) * (x0 - x1) / (y0 - y1)); -} else if (y1 > rymax) { -xi1 += ((rymax - y1) * (x0 - x1) / (y0 - y1)); -}if (xi0 <= rxmin && xi1 <= rxmin) return crossings; -if (xi0 >= rxmax && xi1 >= rxmax) { -if (y0 < y1) { -if (y0 <= rymin) crossings++; -if (y1 >= rymax) crossings++; -} else if (y1 < y0) { -if (y1 <= rymin) crossings--; -if (y0 >= rymax) crossings--; -}return crossings; -}return -2147483648; -}, "~N,~N,~N,~N,~N,~N,~N,~N,~N"); -c$.rectCrossingsForQuad = Clazz_defineMethod (c$, "rectCrossingsForQuad", -function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc, yc, x1, y1, level) { -if (y0 >= rymax && yc >= rymax && y1 >= rymax) return crossings; -if (y0 <= rymin && yc <= rymin && y1 <= rymin) return crossings; -if (x0 <= rxmin && xc <= rxmin && x1 <= rxmin) return crossings; -if (x0 >= rxmax && xc >= rxmax && x1 >= rxmax) { -if (y0 < y1) { -if (y0 <= rymin && y1 > rymin) crossings++; -if (y0 < rymax && y1 >= rymax) crossings++; -} else if (y1 < y0) { -if (y1 <= rymin && y0 > rymin) crossings--; -if (y1 < rymax && y0 >= rymax) crossings--; -}return crossings; -}if ((x0 < rxmax && x0 > rxmin && y0 < rymax && y0 > rymin) || (x1 < rxmax && x1 > rxmin && y1 < rymax && y1 > rymin)) { -return -2147483648; -}if (level > 52) { -return jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1); -}var x0c = (x0 + xc) / 2; -var y0c = (y0 + yc) / 2; -var xc1 = (xc + x1) / 2; -var yc1 = (yc + y1) / 2; -xc = (x0c + xc1) / 2; -yc = (y0c + yc1) / 2; -if (Double.isNaN (xc) || Double.isNaN (yc)) { -return 0; -}crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x0c, y0c, xc, yc, level + 1); -if (crossings != -2147483648) { -crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, xc, yc, xc1, yc1, x1, y1, level + 1); -}return crossings; -}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); -c$.rectCrossingsForCubic = Clazz_defineMethod (c$, "rectCrossingsForCubic", -function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) { -if (y0 >= rymax && yc0 >= rymax && yc1 >= rymax && y1 >= rymax) { -return crossings; -}if (y0 <= rymin && yc0 <= rymin && yc1 <= rymin && y1 <= rymin) { -return crossings; -}if (x0 <= rxmin && xc0 <= rxmin && xc1 <= rxmin && x1 <= rxmin) { -return crossings; -}if (x0 >= rxmax && xc0 >= rxmax && xc1 >= rxmax && x1 >= rxmax) { -if (y0 < y1) { -if (y0 <= rymin && y1 > rymin) crossings++; -if (y0 < rymax && y1 >= rymax) crossings++; -} else if (y1 < y0) { -if (y1 <= rymin && y0 > rymin) crossings--; -if (y1 < rymax && y0 >= rymax) crossings--; -}return crossings; -}if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) { -return -2147483648; -}if (level > 52) { -return jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1); -}var xmid = (xc0 + xc1) / 2; -var ymid = (yc0 + yc1) / 2; -xc0 = (x0 + xc0) / 2; -yc0 = (y0 + yc0) / 2; -xc1 = (xc1 + x1) / 2; -yc1 = (yc1 + y1) / 2; -var xc0m = (xc0 + xmid) / 2; -var yc0m = (yc0 + ymid) / 2; -var xmc1 = (xmid + xc1) / 2; -var ymc1 = (ymid + yc1) / 2; -xmid = (xc0m + xmc1) / 2; -ymid = (yc0m + ymc1) / 2; -if (Double.isNaN (xmid) || Double.isNaN (ymid)) { -return 0; -}crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1); -if (crossings != -2147483648) { -crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1); -}return crossings; -}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (direction) { -this.direction = direction; -}, "~N"); -Clazz_defineMethod (c$, "getDirection", -function () { -return this.direction; -}); -Clazz_defineMethod (c$, "getWithDirection", -function (direction) { -return (this.direction == direction ? this : this.getReversedCurve ()); -}, "~N"); -c$.round = Clazz_defineMethod (c$, "round", -function (v) { -return v; -}, "~N"); -c$.orderof = Clazz_defineMethod (c$, "orderof", -function (x1, x2) { -if (x1 < x2) { -return -1; -}if (x1 > x2) { -return 1; -}return 0; -}, "~N,~N"); -c$.signeddiffbits = Clazz_defineMethod (c$, "signeddiffbits", -function (y1, y2) { -return (Double.doubleToLongBits (y1) - Double.doubleToLongBits (y2)); -}, "~N,~N"); -c$.diffbits = Clazz_defineMethod (c$, "diffbits", -function (y1, y2) { -return Math.abs (Double.doubleToLongBits (y1) - Double.doubleToLongBits (y2)); -}, "~N,~N"); -c$.prev = Clazz_defineMethod (c$, "prev", -function (v) { -return Double.longBitsToDouble (Double.doubleToLongBits (v) - 1); -}, "~N"); -c$.next = Clazz_defineMethod (c$, "next", -function (v) { -return Double.longBitsToDouble (Double.doubleToLongBits (v) + 1); -}, "~N"); -Clazz_overrideMethod (c$, "toString", -function () { -return ("Curve[" + this.getOrder () + ", " + ("(" + jssun.awt.geom.Curve.round (this.getX0 ()) + ", " + jssun.awt.geom.Curve.round (this.getY0 ()) + "), ") + this.controlPointString () + ("(" + jssun.awt.geom.Curve.round (this.getX1 ()) + ", " + jssun.awt.geom.Curve.round (this.getY1 ()) + "), ") + (this.direction == 1 ? "D" : "U") + "]"); -}); -Clazz_defineMethod (c$, "controlPointString", -function () { -return ""; -}); -Clazz_defineMethod (c$, "crossingsFor", -function (x, y) { -if (y >= this.getYTop () && y < this.getYBot ()) { -if (x < this.getXMax () && (x < this.getXMin () || x < this.XforY (y))) { -return 1; -}}return 0; -}, "~N,~N"); -Clazz_defineMethod (c$, "accumulateCrossings", -function (c) { -var xhi = c.getXHi (); -if (this.getXMin () >= xhi) { -return false; -}var xlo = c.getXLo (); -var ylo = c.getYLo (); -var yhi = c.getYHi (); -var y0 = this.getYTop (); -var y1 = this.getYBot (); -var tstart; -var ystart; -var tend; -var yend; -if (y0 < ylo) { -if (y1 <= ylo) { -return false; -}ystart = ylo; -tstart = this.TforY (ylo); -} else { -if (y0 >= yhi) { -return false; -}ystart = y0; -tstart = 0; -}if (y1 > yhi) { -yend = yhi; -tend = this.TforY (yhi); -} else { -yend = y1; -tend = 1; -}var hitLo = false; -var hitHi = false; -while (true) { -var x = this.XforT (tstart); -if (x < xhi) { -if (hitHi || x > xlo) { -return true; -}hitLo = true; -} else { -if (hitLo) { -return true; -}hitHi = true; -}if (tstart >= tend) { -break; -}tstart = this.nextVertical (tstart, tend); -} -if (hitLo) { -c.record (ystart, yend, this.direction); -}return false; -}, "jssun.awt.geom.Crossings"); -Clazz_defineMethod (c$, "getSubCurve", -function (ystart, yend) { -return this.getSubCurve (ystart, yend, this.direction); -}, "~N,~N"); -Clazz_defineMethod (c$, "compareTo", -function (that, yrange) { -var y0 = yrange[0]; -var y1 = yrange[1]; -y1 = Math.min (Math.min (y1, this.getYBot ()), that.getYBot ()); -if (y1 <= yrange[0]) { -System.err.println ("this == " + this); -System.err.println ("that == " + that); -System.out.println ("target range = " + yrange[0] + "=>" + yrange[1]); -throw new InternalError ("backstepping from " + yrange[0] + " to " + y1); -}yrange[1] = y1; -if (this.getXMax () <= that.getXMin ()) { -if (this.getXMin () == that.getXMax ()) { -return 0; -}return -1; -}if (this.getXMin () >= that.getXMax ()) { -return 1; -}var s0 = this.TforY (y0); -var ys0 = this.YforT (s0); -if (ys0 < y0) { -s0 = this.refineTforY (s0, ys0, y0); -ys0 = this.YforT (s0); -}var s1 = this.TforY (y1); -if (this.YforT (s1) < y0) { -s1 = this.refineTforY (s1, this.YforT (s1), y0); -}var t0 = that.TforY (y0); -var yt0 = that.YforT (t0); -if (yt0 < y0) { -t0 = that.refineTforY (t0, yt0, y0); -yt0 = that.YforT (t0); -}var t1 = that.TforY (y1); -if (that.YforT (t1) < y0) { -t1 = that.refineTforY (t1, that.YforT (t1), y0); -}var xs0 = this.XforT (s0); -var xt0 = that.XforT (t0); -var scale = Math.max (Math.abs (y0), Math.abs (y1)); -var ymin = Math.max (scale * 1E-14, 1E-300); -if (this.fairlyClose (xs0, xt0)) { -var bump = ymin; -var maxbump = Math.min (ymin * 1E13, (y1 - y0) * .1); -var y = y0 + bump; -while (y <= y1) { -if (this.fairlyClose (this.XforY (y), that.XforY (y))) { -if ((bump *= 2) > maxbump) { -bump = maxbump; -}} else { -y -= bump; -while (true) { -bump /= 2; -var newy = y + bump; -if (newy <= y) { -break; -}if (this.fairlyClose (this.XforY (newy), that.XforY (newy))) { -y = newy; -}} -break; -}y += bump; -} -if (y > y0) { -if (y < y1) { -yrange[1] = y; -}return 0; -}}if (ymin <= 0) { -System.out.println ("ymin = " + ymin); -}while (s0 < s1 && t0 < t1) { -var sh = this.nextVertical (s0, s1); -var xsh = this.XforT (sh); -var ysh = this.YforT (sh); -var th = that.nextVertical (t0, t1); -var xth = that.XforT (th); -var yth = that.YforT (th); -try { -if (this.findIntersect (that, yrange, ymin, 0, 0, s0, xs0, ys0, sh, xsh, ysh, t0, xt0, yt0, th, xth, yth)) { -break; -}} catch (t) { -System.err.println ("Error: " + t); -System.err.println ("y range was " + yrange[0] + "=>" + yrange[1]); -System.err.println ("s y range is " + ys0 + "=>" + ysh); -System.err.println ("t y range is " + yt0 + "=>" + yth); -System.err.println ("ymin is " + ymin); -return 0; -} -if (ysh < yth) { -if (ysh > yrange[0]) { -if (ysh < yrange[1]) { -yrange[1] = ysh; -}break; -}s0 = sh; -xs0 = xsh; -ys0 = ysh; -} else { -if (yth > yrange[0]) { -if (yth < yrange[1]) { -yrange[1] = yth; -}break; -}t0 = th; -xt0 = xth; -yt0 = yth; -}} -var ymid = (yrange[0] + yrange[1]) / 2; -return jssun.awt.geom.Curve.orderof (this.XforY (ymid), that.XforY (ymid)); -}, "jssun.awt.geom.Curve,~A"); -Clazz_defineMethod (c$, "findIntersect", -function (that, yrange, ymin, slevel, tlevel, s0, xs0, ys0, s1, xs1, ys1, t0, xt0, yt0, t1, xt1, yt1) { -if (ys0 > yt1 || yt0 > ys1) { -return false; -}if (Math.min (xs0, xs1) > Math.max (xt0, xt1) || Math.max (xs0, xs1) < Math.min (xt0, xt1)) { -return false; -}if (s1 - s0 > 0.001) { -var s = (s0 + s1) / 2; -var xs = this.XforT (s); -var ys = this.YforT (s); -if (s == s0 || s == s1) { -System.out.println ("s0 = " + s0); -System.out.println ("s1 = " + s1); -throw new InternalError ("no s progress!"); -}if (t1 - t0 > 0.001) { -var t = (t0 + t1) / 2; -var xt = that.XforT (t); -var yt = that.YforT (t); -if (t == t0 || t == t1) { -System.out.println ("t0 = " + t0); -System.out.println ("t1 = " + t1); -throw new InternalError ("no t progress!"); -}if (ys >= yt0 && yt >= ys0) { -if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s0, xs0, ys0, s, xs, ys, t0, xt0, yt0, t, xt, yt)) { -return true; -}}if (ys >= yt) { -if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s0, xs0, ys0, s, xs, ys, t, xt, yt, t1, xt1, yt1)) { -return true; -}}if (yt >= ys) { -if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s, xs, ys, s1, xs1, ys1, t0, xt0, yt0, t, xt, yt)) { -return true; -}}if (ys1 >= yt && yt1 >= ys) { -if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s, xs, ys, s1, xs1, ys1, t, xt, yt, t1, xt1, yt1)) { -return true; -}}} else { -if (ys >= yt0) { -if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel, s0, xs0, ys0, s, xs, ys, t0, xt0, yt0, t1, xt1, yt1)) { -return true; -}}if (yt1 >= ys) { -if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel, s, xs, ys, s1, xs1, ys1, t0, xt0, yt0, t1, xt1, yt1)) { -return true; -}}}} else if (t1 - t0 > 0.001) { -var t = (t0 + t1) / 2; -var xt = that.XforT (t); -var yt = that.YforT (t); -if (t == t0 || t == t1) { -System.out.println ("t0 = " + t0); -System.out.println ("t1 = " + t1); -throw new InternalError ("no t progress!"); -}if (yt >= ys0) { -if (this.findIntersect (that, yrange, ymin, slevel, tlevel + 1, s0, xs0, ys0, s1, xs1, ys1, t0, xt0, yt0, t, xt, yt)) { -return true; -}}if (ys1 >= yt) { -if (this.findIntersect (that, yrange, ymin, slevel, tlevel + 1, s0, xs0, ys0, s1, xs1, ys1, t, xt, yt, t1, xt1, yt1)) { -return true; -}}} else { -var xlk = xs1 - xs0; -var ylk = ys1 - ys0; -var xnm = xt1 - xt0; -var ynm = yt1 - yt0; -var xmk = xt0 - xs0; -var ymk = yt0 - ys0; -var det = xnm * ylk - ynm * xlk; -if (det != 0) { -var detinv = 1 / det; -var s = (xnm * ymk - ynm * xmk) * detinv; -var t = (xlk * ymk - ylk * xmk) * detinv; -if (s >= 0 && s <= 1 && t >= 0 && t <= 1) { -s = s0 + s * (s1 - s0); -t = t0 + t * (t1 - t0); -if (s < 0 || s > 1 || t < 0 || t > 1) { -System.out.println ("Uh oh!"); -}var y = (this.YforT (s) + that.YforT (t)) / 2; -if (y <= yrange[1] && y > yrange[0]) { -yrange[1] = y; -return true; -}}}}return false; -}, "jssun.awt.geom.Curve,~A,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "refineTforY", -function (t0, yt0, y0) { -var t1 = 1; -while (true) { -var th = (t0 + t1) / 2; -if (th == t0 || th == t1) { -return t1; -}var y = this.YforT (th); -if (y < y0) { -t0 = th; -yt0 = y; -} else if (y > y0) { -t1 = th; -} else { -return t1; -}} -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "fairlyClose", -function (v1, v2) { -return (Math.abs (v1 - v2) < Math.max (Math.abs (v1), Math.abs (v2)) * 1E-10); -}, "~N,~N"); -Clazz_defineStatics (c$, -"INCREASING", 1, -"DECREASING", -1, -"RECT_INTERSECTS", 0x80000000, -"TMIN", 1E-3); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.lang.RuntimeException"], "java.awt.geom.IllegalPathStateException", null, function () { -c$ = Clazz_declareType (java.awt.geom, "IllegalPathStateException", RuntimeException); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.IllegalPathStateException, []); -}); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.RectIterator", ["java.util.NoSuchElementException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.w = 0; -this.h = 0; -this.affine = null; -this.index = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "RectIterator", null, java.awt.geom.PathIterator); -Clazz_makeConstructor (c$, -function (r, at) { -this.x = r.getX (); -this.y = r.getY (); -this.w = r.getWidth (); -this.h = r.getHeight (); -this.affine = at; -if (this.w < 0 || this.h < 0) { -this.index = 6; -}}, "java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getWindingRule", -function () { -return 1; -}); -Clazz_overrideMethod (c$, "isDone", -function () { -return this.index > 5; -}); -Clazz_overrideMethod (c$, "next", -function () { -this.index++; -}); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("rect iterator out of bounds"); -}if (this.index == 5) { -return 4; -}coords[0] = this.x; -coords[1] = this.y; -if (this.index == 1 || this.index == 2) { -coords[0] += this.w; -}if (this.index == 2 || this.index == 3) { -coords[1] += this.h; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, 1); -}return (this.index == 0 ? 0 : 1); -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (coords) { -if (this.isDone ()) { -throw new java.util.NoSuchElementException ("rect iterator out of bounds"); -}if (this.index == 5) { -return 4; -}coords[0] = this.x; -coords[1] = this.y; -if (this.index == 1 || this.index == 2) { -coords[0] += this.w; -}if (this.index == 2 || this.index == 3) { -coords[1] += this.h; -}if (this.affine != null) { -this.affine.transform (coords, 0, coords, 0, 1); -}return (this.index == 0 ? 0 : 1); -}, "~A"); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.AWTEvent"], "java.awt.event.ActionEvent", ["java.awt.event.KeyEvent"], function () { -c$ = Clazz_decorateAsClass (function () { -this.actionCommand = null; -this.when = 0; -this.modifiers = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "ActionEvent", java.awt.AWTEvent); -Clazz_makeConstructor (c$, -function (source, id, command) { -this.construct (source, id, command, 0); -}, "~O,~N,~S"); -Clazz_makeConstructor (c$, -function (source, id, command, modifiers) { -this.construct (source, id, command, 0, modifiers); -}, "~O,~N,~S,~N"); -Clazz_makeConstructor (c$, -function (source, id, command, when, modifiers) { -Clazz_superConstructor (this, java.awt.event.ActionEvent, [source, id]); -this.actionCommand = command; -this.when = when; -this.modifiers = modifiers; -}, "~O,~N,~S,~N,~N"); -Clazz_defineMethod (c$, "getActionCommand", -function () { -return this.actionCommand; -}); -Clazz_defineMethod (c$, "getWhen", -function () { -return this.when; -}); -Clazz_defineMethod (c$, "getModifiers", -function () { -return this.modifiers; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 1001: -typeStr = "ACTION_PERFORMED"; -break; -default: -typeStr = "unknown type"; -} -return typeStr + ",cmd=" + this.actionCommand + ",when=" + this.when + ",modifiers=" + java.awt.event.KeyEvent.getKeyModifiersText (this.modifiers); -}); -Clazz_defineStatics (c$, -"SHIFT_MASK", 1, -"CTRL_MASK", 2, -"META_MASK", 4, -"ALT_MASK", 8, -"ACTION_FIRST", 1001, -"ACTION_LAST", 1001, -"ACTION_PERFORMED", 1001); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.InputEvent"], "java.awt.event.KeyEvent", ["java.lang.IllegalArgumentException", "$.StringBuilder", "java.awt.Toolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.isProxyActive = false; -this.keyCode = 0; -this.keyChar = '\0'; -this.keyLocation = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "KeyEvent", java.awt.event.InputEvent); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, keyCode, keyChar, keyLocation) { -Clazz_superConstructor (this, java.awt.event.KeyEvent, [source, id, when, modifiers]); -if (id == 400) { -if (keyChar == '\uffff') { -throw new IllegalArgumentException ("invalid keyChar"); -}if (keyCode != 0) { -throw new IllegalArgumentException ("invalid keyCode"); -}if (keyLocation != 0) { -throw new IllegalArgumentException ("invalid keyLocation"); -}}this.keyCode = keyCode; -this.keyChar = keyChar; -if ((keyLocation < 0) || (keyLocation > 4)) { -throw new IllegalArgumentException ("invalid keyLocation"); -}this.keyLocation = keyLocation; -if ((this.getModifiers () != 0) && (this.getModifiersEx () == 0)) { -this.setNewModifiers (); -} else if ((this.getModifiers () == 0) && (this.getModifiersEx () != 0)) { -this.setOldModifiers (); -}}, "java.awt.Component,~N,~N,~N,~N,~S,~N"); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, keyCode, keyChar) { -this.construct (source, id, when, modifiers, keyCode, keyChar, 0); -}, "java.awt.Component,~N,~N,~N,~N,~S"); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, keyCode) { -this.construct (source, id, when, modifiers, keyCode, String.fromCharCode (keyCode)); -}, "java.awt.Component,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getKeyCode", -function () { -return this.keyCode; -}); -Clazz_defineMethod (c$, "setKeyCode", -function (keyCode) { -this.keyCode = keyCode; -}, "~N"); -Clazz_defineMethod (c$, "getKeyChar", -function () { -return this.keyChar; -}); -Clazz_defineMethod (c$, "setKeyChar", -function (keyChar) { -this.keyChar = keyChar; -}, "~S"); -Clazz_defineMethod (c$, "setModifiers", -function (modifiers) { -this.modifiers = modifiers; -if ((this.getModifiers () != 0) && (this.getModifiersEx () == 0)) { -this.setNewModifiers (); -} else if ((this.getModifiers () == 0) && (this.getModifiersEx () != 0)) { -this.setOldModifiers (); -}}, "~N"); -Clazz_defineMethod (c$, "getKeyLocation", -function () { -return this.keyLocation; -}); -c$.getKeyText = Clazz_defineMethod (c$, "getKeyText", -function (keyCode) { -if (keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90) { -return String.valueOf (String.fromCharCode (keyCode)); -}switch (keyCode) { -case 10: -return java.awt.Toolkit.getProperty ("AWT.enter", "Enter"); -case 8: -return java.awt.Toolkit.getProperty ("AWT.backSpace", "Backspace"); -case 9: -return java.awt.Toolkit.getProperty ("AWT.tab", "Tab"); -case 3: -return java.awt.Toolkit.getProperty ("AWT.cancel", "Cancel"); -case 12: -return java.awt.Toolkit.getProperty ("AWT.clear", "Clear"); -case 65312: -return java.awt.Toolkit.getProperty ("AWT.compose", "Compose"); -case 19: -return java.awt.Toolkit.getProperty ("AWT.pause", "Pause"); -case 20: -return java.awt.Toolkit.getProperty ("AWT.capsLock", "Caps Lock"); -case 27: -return java.awt.Toolkit.getProperty ("AWT.escape", "Escape"); -case 32: -return java.awt.Toolkit.getProperty ("AWT.space", "Space"); -case 33: -return java.awt.Toolkit.getProperty ("AWT.pgup", "Page Up"); -case 34: -return java.awt.Toolkit.getProperty ("AWT.pgdn", "Page Down"); -case 35: -return java.awt.Toolkit.getProperty ("AWT.end", "End"); -case 36: -return java.awt.Toolkit.getProperty ("AWT.home", "Home"); -case 37: -return java.awt.Toolkit.getProperty ("AWT.left", "Left"); -case 38: -return java.awt.Toolkit.getProperty ("AWT.up", "Up"); -case 39: -return java.awt.Toolkit.getProperty ("AWT.right", "Right"); -case 40: -return java.awt.Toolkit.getProperty ("AWT.down", "Down"); -case 65368: -return java.awt.Toolkit.getProperty ("AWT.begin", "Begin"); -case 16: -return java.awt.Toolkit.getProperty ("AWT.shift", "Shift"); -case 17: -return java.awt.Toolkit.getProperty ("AWT.control", "Control"); -case 18: -return java.awt.Toolkit.getProperty ("AWT.alt", "Alt"); -case 157: -return java.awt.Toolkit.getProperty ("AWT.meta", "Meta"); -case 65406: -return java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph"); -case 44: -return java.awt.Toolkit.getProperty ("AWT.comma", "Comma"); -case 46: -return java.awt.Toolkit.getProperty ("AWT.period", "Period"); -case 47: -return java.awt.Toolkit.getProperty ("AWT.slash", "Slash"); -case 59: -return java.awt.Toolkit.getProperty ("AWT.semicolon", "Semicolon"); -case 61: -return java.awt.Toolkit.getProperty ("AWT.equals", "Equals"); -case 91: -return java.awt.Toolkit.getProperty ("AWT.openBracket", "Open Bracket"); -case 92: -return java.awt.Toolkit.getProperty ("AWT.backSlash", "Back Slash"); -case 93: -return java.awt.Toolkit.getProperty ("AWT.closeBracket", "Close Bracket"); -case 106: -return java.awt.Toolkit.getProperty ("AWT.multiply", "NumPad *"); -case 107: -return java.awt.Toolkit.getProperty ("AWT.add", "NumPad +"); -case 108: -return java.awt.Toolkit.getProperty ("AWT.separator", "NumPad ,"); -case 109: -return java.awt.Toolkit.getProperty ("AWT.subtract", "NumPad -"); -case 110: -return java.awt.Toolkit.getProperty ("AWT.decimal", "NumPad ."); -case 111: -return java.awt.Toolkit.getProperty ("AWT.divide", "NumPad /"); -case 127: -return java.awt.Toolkit.getProperty ("AWT.delete", "Delete"); -case 144: -return java.awt.Toolkit.getProperty ("AWT.numLock", "Num Lock"); -case 145: -return java.awt.Toolkit.getProperty ("AWT.scrollLock", "Scroll Lock"); -case 524: -return java.awt.Toolkit.getProperty ("AWT.windows", "Windows"); -case 525: -return java.awt.Toolkit.getProperty ("AWT.context", "Context Menu"); -case 112: -return java.awt.Toolkit.getProperty ("AWT.f1", "F1"); -case 113: -return java.awt.Toolkit.getProperty ("AWT.f2", "F2"); -case 114: -return java.awt.Toolkit.getProperty ("AWT.f3", "F3"); -case 115: -return java.awt.Toolkit.getProperty ("AWT.f4", "F4"); -case 116: -return java.awt.Toolkit.getProperty ("AWT.f5", "F5"); -case 117: -return java.awt.Toolkit.getProperty ("AWT.f6", "F6"); -case 118: -return java.awt.Toolkit.getProperty ("AWT.f7", "F7"); -case 119: -return java.awt.Toolkit.getProperty ("AWT.f8", "F8"); -case 120: -return java.awt.Toolkit.getProperty ("AWT.f9", "F9"); -case 121: -return java.awt.Toolkit.getProperty ("AWT.f10", "F10"); -case 122: -return java.awt.Toolkit.getProperty ("AWT.f11", "F11"); -case 123: -return java.awt.Toolkit.getProperty ("AWT.f12", "F12"); -case 61440: -return java.awt.Toolkit.getProperty ("AWT.f13", "F13"); -case 61441: -return java.awt.Toolkit.getProperty ("AWT.f14", "F14"); -case 61442: -return java.awt.Toolkit.getProperty ("AWT.f15", "F15"); -case 61443: -return java.awt.Toolkit.getProperty ("AWT.f16", "F16"); -case 61444: -return java.awt.Toolkit.getProperty ("AWT.f17", "F17"); -case 61445: -return java.awt.Toolkit.getProperty ("AWT.f18", "F18"); -case 61446: -return java.awt.Toolkit.getProperty ("AWT.f19", "F19"); -case 61447: -return java.awt.Toolkit.getProperty ("AWT.f20", "F20"); -case 61448: -return java.awt.Toolkit.getProperty ("AWT.f21", "F21"); -case 61449: -return java.awt.Toolkit.getProperty ("AWT.f22", "F22"); -case 61450: -return java.awt.Toolkit.getProperty ("AWT.f23", "F23"); -case 61451: -return java.awt.Toolkit.getProperty ("AWT.f24", "F24"); -case 154: -return java.awt.Toolkit.getProperty ("AWT.printScreen", "Print Screen"); -case 155: -return java.awt.Toolkit.getProperty ("AWT.insert", "Insert"); -case 156: -return java.awt.Toolkit.getProperty ("AWT.help", "Help"); -case 192: -return java.awt.Toolkit.getProperty ("AWT.backQuote", "Back Quote"); -case 222: -return java.awt.Toolkit.getProperty ("AWT.quote", "Quote"); -case 224: -return java.awt.Toolkit.getProperty ("AWT.up", "Up"); -case 225: -return java.awt.Toolkit.getProperty ("AWT.down", "Down"); -case 226: -return java.awt.Toolkit.getProperty ("AWT.left", "Left"); -case 227: -return java.awt.Toolkit.getProperty ("AWT.right", "Right"); -case 128: -return java.awt.Toolkit.getProperty ("AWT.deadGrave", "Dead Grave"); -case 129: -return java.awt.Toolkit.getProperty ("AWT.deadAcute", "Dead Acute"); -case 130: -return java.awt.Toolkit.getProperty ("AWT.deadCircumflex", "Dead Circumflex"); -case 131: -return java.awt.Toolkit.getProperty ("AWT.deadTilde", "Dead Tilde"); -case 132: -return java.awt.Toolkit.getProperty ("AWT.deadMacron", "Dead Macron"); -case 133: -return java.awt.Toolkit.getProperty ("AWT.deadBreve", "Dead Breve"); -case 134: -return java.awt.Toolkit.getProperty ("AWT.deadAboveDot", "Dead Above Dot"); -case 135: -return java.awt.Toolkit.getProperty ("AWT.deadDiaeresis", "Dead Diaeresis"); -case 136: -return java.awt.Toolkit.getProperty ("AWT.deadAboveRing", "Dead Above Ring"); -case 137: -return java.awt.Toolkit.getProperty ("AWT.deadDoubleAcute", "Dead Double Acute"); -case 138: -return java.awt.Toolkit.getProperty ("AWT.deadCaron", "Dead Caron"); -case 139: -return java.awt.Toolkit.getProperty ("AWT.deadCedilla", "Dead Cedilla"); -case 140: -return java.awt.Toolkit.getProperty ("AWT.deadOgonek", "Dead Ogonek"); -case 141: -return java.awt.Toolkit.getProperty ("AWT.deadIota", "Dead Iota"); -case 142: -return java.awt.Toolkit.getProperty ("AWT.deadVoicedSound", "Dead Voiced Sound"); -case 143: -return java.awt.Toolkit.getProperty ("AWT.deadSemivoicedSound", "Dead Semivoiced Sound"); -case 150: -return java.awt.Toolkit.getProperty ("AWT.ampersand", "Ampersand"); -case 151: -return java.awt.Toolkit.getProperty ("AWT.asterisk", "Asterisk"); -case 152: -return java.awt.Toolkit.getProperty ("AWT.quoteDbl", "Double Quote"); -case 153: -return java.awt.Toolkit.getProperty ("AWT.Less", "Less"); -case 160: -return java.awt.Toolkit.getProperty ("AWT.greater", "Greater"); -case 161: -return java.awt.Toolkit.getProperty ("AWT.braceLeft", "Left Brace"); -case 162: -return java.awt.Toolkit.getProperty ("AWT.braceRight", "Right Brace"); -case 512: -return java.awt.Toolkit.getProperty ("AWT.at", "At"); -case 513: -return java.awt.Toolkit.getProperty ("AWT.colon", "Colon"); -case 514: -return java.awt.Toolkit.getProperty ("AWT.circumflex", "Circumflex"); -case 515: -return java.awt.Toolkit.getProperty ("AWT.dollar", "Dollar"); -case 516: -return java.awt.Toolkit.getProperty ("AWT.euro", "Euro"); -case 517: -return java.awt.Toolkit.getProperty ("AWT.exclamationMark", "Exclamation Mark"); -case 518: -return java.awt.Toolkit.getProperty ("AWT.invertedExclamationMark", "Inverted Exclamation Mark"); -case 519: -return java.awt.Toolkit.getProperty ("AWT.leftParenthesis", "Left Parenthesis"); -case 520: -return java.awt.Toolkit.getProperty ("AWT.numberSign", "Number Sign"); -case 45: -return java.awt.Toolkit.getProperty ("AWT.minus", "Minus"); -case 521: -return java.awt.Toolkit.getProperty ("AWT.plus", "Plus"); -case 522: -return java.awt.Toolkit.getProperty ("AWT.rightParenthesis", "Right Parenthesis"); -case 523: -return java.awt.Toolkit.getProperty ("AWT.underscore", "Underscore"); -case 24: -return java.awt.Toolkit.getProperty ("AWT.final", "Final"); -case 28: -return java.awt.Toolkit.getProperty ("AWT.convert", "Convert"); -case 29: -return java.awt.Toolkit.getProperty ("AWT.noconvert", "No Convert"); -case 30: -return java.awt.Toolkit.getProperty ("AWT.accept", "Accept"); -case 31: -return java.awt.Toolkit.getProperty ("AWT.modechange", "Mode Change"); -case 21: -return java.awt.Toolkit.getProperty ("AWT.kana", "Kana"); -case 25: -return java.awt.Toolkit.getProperty ("AWT.kanji", "Kanji"); -case 240: -return java.awt.Toolkit.getProperty ("AWT.alphanumeric", "Alphanumeric"); -case 241: -return java.awt.Toolkit.getProperty ("AWT.katakana", "Katakana"); -case 242: -return java.awt.Toolkit.getProperty ("AWT.hiragana", "Hiragana"); -case 243: -return java.awt.Toolkit.getProperty ("AWT.fullWidth", "Full-Width"); -case 244: -return java.awt.Toolkit.getProperty ("AWT.halfWidth", "Half-Width"); -case 245: -return java.awt.Toolkit.getProperty ("AWT.romanCharacters", "Roman Characters"); -case 256: -return java.awt.Toolkit.getProperty ("AWT.allCandidates", "All Candidates"); -case 257: -return java.awt.Toolkit.getProperty ("AWT.previousCandidate", "Previous Candidate"); -case 258: -return java.awt.Toolkit.getProperty ("AWT.codeInput", "Code Input"); -case 259: -return java.awt.Toolkit.getProperty ("AWT.japaneseKatakana", "Japanese Katakana"); -case 260: -return java.awt.Toolkit.getProperty ("AWT.japaneseHiragana", "Japanese Hiragana"); -case 261: -return java.awt.Toolkit.getProperty ("AWT.japaneseRoman", "Japanese Roman"); -case 262: -return java.awt.Toolkit.getProperty ("AWT.kanaLock", "Kana Lock"); -case 263: -return java.awt.Toolkit.getProperty ("AWT.inputMethodOnOff", "Input Method On/Off"); -case 65481: -return java.awt.Toolkit.getProperty ("AWT.again", "Again"); -case 65483: -return java.awt.Toolkit.getProperty ("AWT.undo", "Undo"); -case 65485: -return java.awt.Toolkit.getProperty ("AWT.copy", "Copy"); -case 65487: -return java.awt.Toolkit.getProperty ("AWT.paste", "Paste"); -case 65489: -return java.awt.Toolkit.getProperty ("AWT.cut", "Cut"); -case 65488: -return java.awt.Toolkit.getProperty ("AWT.find", "Find"); -case 65482: -return java.awt.Toolkit.getProperty ("AWT.props", "Props"); -case 65480: -return java.awt.Toolkit.getProperty ("AWT.stop", "Stop"); -} -if (keyCode >= 96 && keyCode <= 105) { -var numpad = java.awt.Toolkit.getProperty ("AWT.numpad", "NumPad"); -var c = String.fromCharCode (keyCode - 96 + 48); -return numpad + "-" + c; -}var unknown = java.awt.Toolkit.getProperty ("AWT.unknown", "Unknown"); -return unknown + " keyCode: 0x" + Integer.toString (keyCode, 16); -}, "~N"); -c$.getKeyModifiersText = Clazz_defineMethod (c$, "getKeyModifiersText", -function (modifiers) { -var buf = new StringBuilder (); -if ((modifiers & 4) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.meta", "Meta")); -buf.append ("+"); -}if ((modifiers & 2) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.control", "Ctrl")); -buf.append ("+"); -}if ((modifiers & 8) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.alt", "Alt")); -buf.append ("+"); -}if ((modifiers & 1) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.shift", "Shift")); -buf.append ("+"); -}if ((modifiers & 32) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph")); -buf.append ("+"); -}if ((modifiers & 16) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button1", "Button1")); -buf.append ("+"); -}if (buf.length () > 0) { -buf.setLength (buf.length () - 1); -}return buf.toString (); -}, "~N"); -Clazz_defineMethod (c$, "isActionKey", -function () { -switch (this.keyCode) { -case 36: -case 35: -case 33: -case 34: -case 38: -case 40: -case 37: -case 39: -case 65368: -case 226: -case 224: -case 227: -case 225: -case 112: -case 113: -case 114: -case 115: -case 116: -case 117: -case 118: -case 119: -case 120: -case 121: -case 122: -case 123: -case 61440: -case 61441: -case 61442: -case 61443: -case 61444: -case 61445: -case 61446: -case 61447: -case 61448: -case 61449: -case 61450: -case 61451: -case 154: -case 145: -case 20: -case 144: -case 19: -case 155: -case 24: -case 28: -case 29: -case 30: -case 31: -case 21: -case 25: -case 240: -case 241: -case 242: -case 243: -case 244: -case 245: -case 256: -case 257: -case 258: -case 259: -case 260: -case 261: -case 262: -case 263: -case 65481: -case 65483: -case 65485: -case 65487: -case 65489: -case 65488: -case 65482: -case 65480: -case 156: -case 524: -case 525: -return true; -} -return false; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var str = new StringBuilder (100); -switch (this.id) { -case 401: -str.append ("KEY_PRESSED"); -break; -case 402: -str.append ("KEY_RELEASED"); -break; -case 400: -str.append ("KEY_TYPED"); -break; -default: -str.append ("unknown type"); -break; -} -str.append (",keyCode=").append ("" + this.keyCode); -str.append (",keyText=").append (java.awt.event.KeyEvent.getKeyText (this.keyCode)); -str.append (",keyChar="); -switch (this.keyChar) { -case '\b': -str.append (java.awt.event.KeyEvent.getKeyText (8)); -break; -case '\t': -str.append (java.awt.event.KeyEvent.getKeyText (9)); -break; -case '\n': -str.append (java.awt.event.KeyEvent.getKeyText (10)); -break; -case '\u0018': -str.append (java.awt.event.KeyEvent.getKeyText (3)); -break; -case '\u001b': -str.append (java.awt.event.KeyEvent.getKeyText (27)); -break; -case '\u007f': -str.append (java.awt.event.KeyEvent.getKeyText (127)); -break; -case '\uffff': -str.append (java.awt.Toolkit.getProperty ("AWT.undefined", "Undefined")); -str.append (" keyChar"); -break; -default: -str.append ("'").append (this.keyChar).append ("'"); -break; -} -if (this.getModifiers () != 0) { -str.append (",modifiers=").append (java.awt.event.KeyEvent.getKeyModifiersText (this.modifiers)); -}if (this.getModifiersEx () != 0) { -str.append (",extModifiers=").append (java.awt.event.InputEvent.getModifiersExText (this.modifiers)); -}str.append (",keyLocation="); -switch (this.keyLocation) { -case 0: -str.append ("KEY_LOCATION_UNKNOWN"); -break; -case 1: -str.append ("KEY_LOCATION_STANDARD"); -break; -case 2: -str.append ("KEY_LOCATION_LEFT"); -break; -case 3: -str.append ("KEY_LOCATION_RIGHT"); -break; -case 4: -str.append ("KEY_LOCATION_NUMPAD"); -break; -default: -str.append ("KEY_LOCATION_UNKNOWN"); -break; -} -return str.toString (); -}); -Clazz_defineMethod (c$, "setNewModifiers", - function () { -if ((this.modifiers & 1) != 0) { -this.modifiers |= 64; -}if ((this.modifiers & 8) != 0) { -this.modifiers |= 512; -}if ((this.modifiers & 2) != 0) { -this.modifiers |= 128; -}if ((this.modifiers & 4) != 0) { -this.modifiers |= 256; -}if ((this.modifiers & 32) != 0) { -this.modifiers |= 8192; -}if ((this.modifiers & 16) != 0) { -this.modifiers |= 1024; -}}); -Clazz_defineMethod (c$, "setOldModifiers", - function () { -if ((this.modifiers & 64) != 0) { -this.modifiers |= 1; -}if ((this.modifiers & 512) != 0) { -this.modifiers |= 8; -}if ((this.modifiers & 128) != 0) { -this.modifiers |= 2; -}if ((this.modifiers & 256) != 0) { -this.modifiers |= 4; -}if ((this.modifiers & 8192) != 0) { -this.modifiers |= 32; -}if ((this.modifiers & 1024) != 0) { -this.modifiers |= 16; -}}); -Clazz_defineStatics (c$, -"KEY_FIRST", 400, -"KEY_LAST", 402, -"KEY_TYPED", 400, -"KEY_PRESSED", 401, -"KEY_RELEASED", 402, -"VK_ENTER", '\n', -"VK_BACK_SPACE", '\b', -"VK_TAB", '\t', -"VK_CANCEL", 0x03, -"VK_CLEAR", 0x0C, -"VK_SHIFT", 0x10, -"VK_CONTROL", 0x11, -"VK_ALT", 0x12, -"VK_PAUSE", 0x13, -"VK_CAPS_LOCK", 0x14, -"VK_ESCAPE", 0x1B, -"VK_SPACE", 0x20, -"VK_PAGE_UP", 0x21, -"VK_PAGE_DOWN", 0x22, -"VK_END", 0x23, -"VK_HOME", 0x24, -"VK_LEFT", 0x25, -"VK_UP", 0x26, -"VK_RIGHT", 0x27, -"VK_DOWN", 0x28, -"VK_COMMA", 0x2C, -"VK_MINUS", 0x2D, -"VK_PERIOD", 0x2E, -"VK_SLASH", 0x2F, -"VK_0", 0x30, -"VK_1", 0x31, -"VK_2", 0x32, -"VK_3", 0x33, -"VK_4", 0x34, -"VK_5", 0x35, -"VK_6", 0x36, -"VK_7", 0x37, -"VK_8", 0x38, -"VK_9", 0x39, -"VK_SEMICOLON", 0x3B, -"VK_EQUALS", 0x3D, -"VK_A", 0x41, -"VK_B", 0x42, -"VK_C", 0x43, -"VK_D", 0x44, -"VK_E", 0x45, -"VK_F", 0x46, -"VK_G", 0x47, -"VK_H", 0x48, -"VK_I", 0x49, -"VK_J", 0x4A, -"VK_K", 0x4B, -"VK_L", 0x4C, -"VK_M", 0x4D, -"VK_N", 0x4E, -"VK_O", 0x4F, -"VK_P", 0x50, -"VK_Q", 0x51, -"VK_R", 0x52, -"VK_S", 0x53, -"VK_T", 0x54, -"VK_U", 0x55, -"VK_V", 0x56, -"VK_W", 0x57, -"VK_X", 0x58, -"VK_Y", 0x59, -"VK_Z", 0x5A, -"VK_OPEN_BRACKET", 0x5B, -"VK_BACK_SLASH", 0x5C, -"VK_CLOSE_BRACKET", 0x5D, -"VK_NUMPAD0", 0x60, -"VK_NUMPAD1", 0x61, -"VK_NUMPAD2", 0x62, -"VK_NUMPAD3", 0x63, -"VK_NUMPAD4", 0x64, -"VK_NUMPAD5", 0x65, -"VK_NUMPAD6", 0x66, -"VK_NUMPAD7", 0x67, -"VK_NUMPAD8", 0x68, -"VK_NUMPAD9", 0x69, -"VK_MULTIPLY", 0x6A, -"VK_ADD", 0x6B, -"VK_SEPARATER", 0x6C, -"VK_SEPARATOR", 108, -"VK_SUBTRACT", 0x6D, -"VK_DECIMAL", 0x6E, -"VK_DIVIDE", 0x6F, -"VK_DELETE", 0x7F, -"VK_NUM_LOCK", 0x90, -"VK_SCROLL_LOCK", 0x91, -"VK_F1", 0x70, -"VK_F2", 0x71, -"VK_F3", 0x72, -"VK_F4", 0x73, -"VK_F5", 0x74, -"VK_F6", 0x75, -"VK_F7", 0x76, -"VK_F8", 0x77, -"VK_F9", 0x78, -"VK_F10", 0x79, -"VK_F11", 0x7A, -"VK_F12", 0x7B, -"VK_F13", 0xF000, -"VK_F14", 0xF001, -"VK_F15", 0xF002, -"VK_F16", 0xF003, -"VK_F17", 0xF004, -"VK_F18", 0xF005, -"VK_F19", 0xF006, -"VK_F20", 0xF007, -"VK_F21", 0xF008, -"VK_F22", 0xF009, -"VK_F23", 0xF00A, -"VK_F24", 0xF00B, -"VK_PRINTSCREEN", 0x9A, -"VK_INSERT", 0x9B, -"VK_HELP", 0x9C, -"VK_META", 0x9D, -"VK_BACK_QUOTE", 0xC0, -"VK_QUOTE", 0xDE, -"VK_KP_UP", 0xE0, -"VK_KP_DOWN", 0xE1, -"VK_KP_LEFT", 0xE2, -"VK_KP_RIGHT", 0xE3, -"VK_DEAD_GRAVE", 0x80, -"VK_DEAD_ACUTE", 0x81, -"VK_DEAD_CIRCUMFLEX", 0x82, -"VK_DEAD_TILDE", 0x83, -"VK_DEAD_MACRON", 0x84, -"VK_DEAD_BREVE", 0x85, -"VK_DEAD_ABOVEDOT", 0x86, -"VK_DEAD_DIAERESIS", 0x87, -"VK_DEAD_ABOVERING", 0x88, -"VK_DEAD_DOUBLEACUTE", 0x89, -"VK_DEAD_CARON", 0x8a, -"VK_DEAD_CEDILLA", 0x8b, -"VK_DEAD_OGONEK", 0x8c, -"VK_DEAD_IOTA", 0x8d, -"VK_DEAD_VOICED_SOUND", 0x8e, -"VK_DEAD_SEMIVOICED_SOUND", 0x8f, -"VK_AMPERSAND", 0x96, -"VK_ASTERISK", 0x97, -"VK_QUOTEDBL", 0x98, -"VK_LESS", 0x99, -"VK_GREATER", 0xa0, -"VK_BRACELEFT", 0xa1, -"VK_BRACERIGHT", 0xa2, -"VK_AT", 0x0200, -"VK_COLON", 0x0201, -"VK_CIRCUMFLEX", 0x0202, -"VK_DOLLAR", 0x0203, -"VK_EURO_SIGN", 0x0204, -"VK_EXCLAMATION_MARK", 0x0205, -"VK_INVERTED_EXCLAMATION_MARK", 0x0206, -"VK_LEFT_PARENTHESIS", 0x0207, -"VK_NUMBER_SIGN", 0x0208, -"VK_PLUS", 0x0209, -"VK_RIGHT_PARENTHESIS", 0x020A, -"VK_UNDERSCORE", 0x020B, -"VK_WINDOWS", 0x020C, -"VK_CONTEXT_MENU", 0x020D, -"VK_FINAL", 0x0018, -"VK_CONVERT", 0x001C, -"VK_NONCONVERT", 0x001D, -"VK_ACCEPT", 0x001E, -"VK_MODECHANGE", 0x001F, -"VK_KANA", 0x0015, -"VK_KANJI", 0x0019, -"VK_ALPHANUMERIC", 0x00F0, -"VK_KATAKANA", 0x00F1, -"VK_HIRAGANA", 0x00F2, -"VK_FULL_WIDTH", 0x00F3, -"VK_HALF_WIDTH", 0x00F4, -"VK_ROMAN_CHARACTERS", 0x00F5, -"VK_ALL_CANDIDATES", 0x0100, -"VK_PREVIOUS_CANDIDATE", 0x0101, -"VK_CODE_INPUT", 0x0102, -"VK_JAPANESE_KATAKANA", 0x0103, -"VK_JAPANESE_HIRAGANA", 0x0104, -"VK_JAPANESE_ROMAN", 0x0105, -"VK_KANA_LOCK", 0x0106, -"VK_INPUT_METHOD_ON_OFF", 0x0107, -"VK_CUT", 0xFFD1, -"VK_COPY", 0xFFCD, -"VK_PASTE", 0xFFCF, -"VK_UNDO", 0xFFCB, -"VK_AGAIN", 0xFFC9, -"VK_FIND", 0xFFD0, -"VK_PROPS", 0xFFCA, -"VK_STOP", 0xFFC8, -"VK_COMPOSE", 0xFF20, -"VK_ALT_GRAPH", 0xFF7E, -"VK_BEGIN", 0xFF58, -"VK_UNDEFINED", 0x0, -"CHAR_UNDEFINED", String.fromCharCode (0xFFFF), -"KEY_LOCATION_UNKNOWN", 0, -"KEY_LOCATION_STANDARD", 1, -"KEY_LOCATION_LEFT", 2, -"KEY_LOCATION_RIGHT", 3, -"KEY_LOCATION_NUMPAD", 4); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.MouseEvent"], "java.awt.event.MouseWheelEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.scrollType = 0; -this.scrollAmount = 0; -this.wheelRotation = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "MouseWheelEvent", java.awt.event.MouseEvent); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, clickCount, popupTrigger, scrollType, scrollAmount, wheelRotation) { -this.construct (source, id, when, modifiers, x, y, 0, 0, clickCount, popupTrigger, scrollType, scrollAmount, wheelRotation); -}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B,~N,~N,~N"); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, scrollType, scrollAmount, wheelRotation) { -Clazz_superConstructor (this, java.awt.event.MouseWheelEvent, [source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, 0]); -this.scrollType = scrollType; -this.scrollAmount = scrollAmount; -this.wheelRotation = wheelRotation; -}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~N,~N,~B,~N,~N,~N"); -Clazz_defineMethod (c$, "getScrollType", -function () { -return this.scrollType; -}); -Clazz_defineMethod (c$, "getScrollAmount", -function () { -return this.scrollAmount; -}); -Clazz_defineMethod (c$, "getWheelRotation", -function () { -return this.wheelRotation; -}); -Clazz_defineMethod (c$, "getUnitsToScroll", -function () { -return this.scrollAmount * this.wheelRotation; -}); -Clazz_defineMethod (c$, "paramString", -function () { -var scrollTypeStr = null; -if (this.getScrollType () == 0) { -scrollTypeStr = "WHEEL_UNIT_SCROLL"; -} else if (this.getScrollType () == 1) { -scrollTypeStr = "WHEEL_BLOCK_SCROLL"; -} else { -scrollTypeStr = "unknown scroll type"; -}return Clazz_superCall (this, java.awt.event.MouseWheelEvent, "paramString", []) + ",scrollType=" + scrollTypeStr + ",scrollAmount=" + this.getScrollAmount () + ",wheelRotation=" + this.getWheelRotation (); -}); -Clazz_defineStatics (c$, -"WHEEL_UNIT_SCROLL", 0, -"WHEEL_BLOCK_SCROLL", 1); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.Action", "$.ArrayTable"], "javax.swing.AbstractAction", ["java.lang.Boolean", "javax.swing.event.SwingPropertyChangeSupport"], function () { -c$ = Clazz_decorateAsClass (function () { -this.enabled = true; -this.arrayTable = null; -this.changeSupport = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "AbstractAction", null, [javax.swing.Action, Cloneable]); -c$.shouldReconfigure = Clazz_defineMethod (c$, "shouldReconfigure", -function (e) { -if (e.getPropertyName () == null) { -javax.swing.AbstractAction.RECONFIGURE_ON_NULL = new Boolean (false); -}return false; -}, "java.beans.PropertyChangeEvent"); -c$.setEnabledFromAction = Clazz_defineMethod (c$, "setEnabledFromAction", -function (c, a) { -c.setEnabled ((a != null) ? a.isEnabled () : true); -}, "javax.swing.JComponent,javax.swing.Action"); -c$.setToolTipTextFromAction = Clazz_defineMethod (c$, "setToolTipTextFromAction", -function (c, a) { -c.setToolTipText (a != null ? a.getValue ("ShortDescription") : null); -}, "javax.swing.JComponent,javax.swing.Action"); -c$.hasSelectedKey = Clazz_defineMethod (c$, "hasSelectedKey", -function (a) { -return (a != null && a.getValue ("SwingSelectedKey") != null); -}, "javax.swing.Action"); -c$.isSelected = Clazz_defineMethod (c$, "isSelected", -function (a) { -return Boolean.TRUE.equals (a.getValue ("SwingSelectedKey")); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_makeConstructor (c$, -function (name) { -this.putValue ("Name", name); -}, "~S"); -Clazz_makeConstructor (c$, -function (name, icon) { -this.construct (name); -this.putValue ("SmallIcon", icon); -}, "~S,javax.swing.Icon"); -Clazz_defineMethod (c$, "getValue", -function (key) { -if (key === "enabled") { -return this.enabled; -}if (this.arrayTable == null) { -return null; -}return this.arrayTable.get (key); -}, "~S"); -Clazz_overrideMethod (c$, "putValue", -function (key, newValue) { -var oldValue = null; -if (key === "enabled") { -if (newValue == null || !(Clazz_instanceOf (newValue, Boolean))) { -newValue = new Boolean (false); -}oldValue = new Boolean (this.enabled); -this.enabled = (newValue).booleanValue (); -} else { -if (this.arrayTable == null) { -this.arrayTable = new javax.swing.ArrayTable (); -}if (this.arrayTable.containsKey (key)) oldValue = this.arrayTable.get (key); -if (newValue == null) { -this.arrayTable.remove (key); -} else { -this.arrayTable.put (key, newValue); -}}this.firePropertyChange (key, oldValue, newValue); -}, "~S,~O"); -Clazz_defineMethod (c$, "isEnabled", -function () { -return this.enabled; -}); -Clazz_overrideMethod (c$, "setEnabled", -function (newValue) { -var oldValue = this.enabled; -if (oldValue != newValue) { -this.enabled = newValue; -this.firePropertyChange ("enabled", Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); -}}, "~B"); -Clazz_defineMethod (c$, "getKeys", -function () { -if (this.arrayTable == null) { -return null; -}var keys = new Array (this.arrayTable.size ()); -this.arrayTable.getKeys (keys); -return keys; -}); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -if (this.changeSupport == null || (oldValue != null && newValue != null && oldValue.equals (newValue))) { -return; -}this.changeSupport.firePropertyChange (propertyName, oldValue, newValue); -}, "~S,~O,~O"); -Clazz_overrideMethod (c$, "addPropertyChangeListener", -function (listener) { -if (this.changeSupport == null) { -this.changeSupport = new javax.swing.event.SwingPropertyChangeSupport (this); -}this.changeSupport.addPropertyChangeListener (listener); -}, "java.beans.PropertyChangeListener"); -Clazz_overrideMethod (c$, "removePropertyChangeListener", -function (listener) { -if (this.changeSupport == null) { -return; -}this.changeSupport.removePropertyChangeListener (listener); -}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -if (this.changeSupport == null) { -return new Array (0); -}return this.changeSupport.getPropertyChangeListeners (); -}); -Clazz_defineMethod (c$, "clone", -function () { -var newAction = Clazz_superCall (this, javax.swing.AbstractAction, "clone", []); -{ -if (this.arrayTable != null) { -newAction.arrayTable = this.arrayTable.clone (); -}}return newAction; -}); -Clazz_defineStatics (c$, -"RECONFIGURE_ON_NULL", null); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.ItemSelectable", "java.awt.event.ActionListener", "$.ItemListener", "javax.swing.ActionPropertyChangeListener", "$.JComponent", "$.SwingConstants", "javax.swing.event.ChangeListener"], "javax.swing.AbstractButton", ["java.lang.Boolean", "$.IllegalArgumentException", "java.awt.event.ActionEvent", "$.ItemEvent", "javax.swing.AbstractAction", "$.DefaultButtonModel", "$.OverlayLayout", "$.SwingUtilities", "$.UIManager", "javax.swing.event.ChangeEvent", "javax.swing.plaf.UIResource"], function () { -c$ = Clazz_decorateAsClass (function () { -this.model = null; -this.text = ""; -this.margin = null; -this.defaultMargin = null; -this.defaultIcon = null; -this.pressedIcon = null; -this.disabledIcon = null; -this.selectedIcon = null; -this.disabledSelectedIcon = null; -this.rolloverIcon = null; -this.rolloverSelectedIcon = null; -this.$paintBorder = true; -this.paintFocus = true; -this.rolloverEnabled = false; -this.contentAreaFilled = true; -this.verticalAlignment = 0; -this.horizontalAlignment = 0; -this.verticalTextPosition = 0; -this.horizontalTextPosition = 11; -this.iconTextGap = 4; -this.mnemonic = 0; -this.mnemonicIndex = -1; -this.multiClickThreshhold = 0; -this.borderPaintedSet = false; -this.rolloverEnabledSet = false; -this.iconTextGapSet = false; -this.contentAreaFilledSet = false; -this.$setLayout = false; -this.defaultCapable = true; -this.handler = null; -this.changeListener = null; -this.actionListener = null; -this.itemListener = null; -this.changeEvent = null; -this.hideActionText = false; -this.$action = null; -this.actionPropertyChangeListener = null; -if (!Clazz_isClassDefined ("javax.swing.AbstractButton.ButtonChangeListener")) { -javax.swing.AbstractButton.$AbstractButton$ButtonChangeListener$ (); -} -if (!Clazz_isClassDefined ("javax.swing.AbstractButton.Handler")) { -javax.swing.AbstractButton.$AbstractButton$Handler$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "AbstractButton", javax.swing.JComponent, [java.awt.ItemSelectable, javax.swing.SwingConstants]); -Clazz_defineMethod (c$, "setHideActionText", -function (hideActionText) { -if (hideActionText != this.hideActionText) { -this.hideActionText = hideActionText; -if (this.getAction () != null) { -this.setTextFromAction (this.getAction (), false); -}this.firePropertyChangeBool ("hideActionText", !hideActionText, hideActionText); -}}, "~B"); -Clazz_defineMethod (c$, "getHideActionText", -function () { -return this.hideActionText; -}); -Clazz_defineMethod (c$, "getText", -function () { -return this.text; -}); -Clazz_defineMethod (c$, "setText", -function (text) { -var oldValue = this.text; -this.text = text; -this.firePropertyChangeObject ("text", oldValue, text); -this.updateDisplayedMnemonicIndex (text, this.getMnemonic ()); -if (text == null || oldValue == null || !text.equals (oldValue)) { -this.revalidate (); -this.repaint (); -}}, "~S"); -Clazz_defineMethod (c$, "isSelected", -function () { -return this.model.isSelected (); -}); -Clazz_defineMethod (c$, "setSelected", -function (b) { -this.model.setSelected (b); -}, "~B"); -Clazz_defineMethod (c$, "doClick", -function () { -this.doClick (68); -}); -Clazz_defineMethod (c$, "doClick", -function (pressTime) { -}, "~N"); -Clazz_defineMethod (c$, "setMargin", -function (m) { -if (Clazz_instanceOf (m, javax.swing.plaf.UIResource)) { -this.defaultMargin = m; -} else if (Clazz_instanceOf (this.margin, javax.swing.plaf.UIResource)) { -this.defaultMargin = this.margin; -}if (m == null && this.defaultMargin != null) { -m = this.defaultMargin; -}var old = this.margin; -this.margin = m; -this.firePropertyChangeObject ("margin", old, m); -if (old == null || !old.equals (m)) { -this.revalidate (); -this.repaint (); -}}, "java.awt.Insets"); -Clazz_defineMethod (c$, "getMargin", -function () { -return (this.margin == null) ? null : this.margin.clone (); -}); -Clazz_defineMethod (c$, "getIcon", -function () { -return this.defaultIcon; -}); -Clazz_defineMethod (c$, "setIcon", -function (defaultIcon) { -var oldValue = this.defaultIcon; -this.defaultIcon = defaultIcon; -if (defaultIcon !== oldValue && (Clazz_instanceOf (this.disabledIcon, javax.swing.plaf.UIResource))) { -this.disabledIcon = null; -}this.firePropertyChangeObject ("icon", oldValue, defaultIcon); -if (defaultIcon !== oldValue) { -if (defaultIcon == null || oldValue == null || defaultIcon.getIconWidth () != oldValue.getIconWidth () || defaultIcon.getIconHeight () != oldValue.getIconHeight ()) { -this.revalidate (); -}this.repaint (); -}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getPressedIcon", -function () { -return this.pressedIcon; -}); -Clazz_defineMethod (c$, "setPressedIcon", -function (pressedIcon) { -var oldValue = this.pressedIcon; -this.pressedIcon = pressedIcon; -this.firePropertyChangeObject ("pressedIcon", oldValue, pressedIcon); -if (pressedIcon !== oldValue) { -if (this.getModel ().isPressed ()) { -this.repaint (); -}}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getSelectedIcon", -function () { -return this.selectedIcon; -}); -Clazz_defineMethod (c$, "setSelectedIcon", -function (selectedIcon) { -var oldValue = this.selectedIcon; -this.selectedIcon = selectedIcon; -if (selectedIcon !== oldValue && Clazz_instanceOf (this.disabledSelectedIcon, javax.swing.plaf.UIResource)) { -this.disabledSelectedIcon = null; -}this.firePropertyChangeObject ("selectedIcon", oldValue, selectedIcon); -if (selectedIcon !== oldValue) { -if (this.isSelected ()) { -this.repaint (); -}}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getRolloverIcon", -function () { -return this.rolloverIcon; -}); -Clazz_defineMethod (c$, "setRolloverIcon", -function (rolloverIcon) { -var oldValue = this.rolloverIcon; -this.rolloverIcon = rolloverIcon; -this.firePropertyChangeObject ("rolloverIcon", oldValue, rolloverIcon); -this.setRolloverEnabled (true); -if (rolloverIcon !== oldValue) { -this.repaint (); -}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getRolloverSelectedIcon", -function () { -return this.rolloverSelectedIcon; -}); -Clazz_defineMethod (c$, "setRolloverSelectedIcon", -function (rolloverSelectedIcon) { -var oldValue = this.rolloverSelectedIcon; -this.rolloverSelectedIcon = rolloverSelectedIcon; -this.firePropertyChangeObject ("rolloverSelectedIcon", oldValue, rolloverSelectedIcon); -this.setRolloverEnabled (true); -if (rolloverSelectedIcon !== oldValue) { -if (this.isSelected ()) { -this.repaint (); -}}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getDisabledIcon", -function () { -if (this.disabledIcon == null) { -this.disabledIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledIcon (this, this.getIcon ()); -if (this.disabledIcon != null) { -this.firePropertyChangeObject ("disabledIcon", null, this.disabledIcon); -}}return this.disabledIcon; -}); -Clazz_defineMethod (c$, "setDisabledIcon", -function (disabledIcon) { -var oldValue = this.disabledIcon; -this.disabledIcon = disabledIcon; -this.firePropertyChangeObject ("disabledIcon", oldValue, disabledIcon); -if (disabledIcon !== oldValue) { -if (!this.isEnabled ()) { -this.repaint (); -}}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getDisabledSelectedIcon", -function () { -if (this.disabledSelectedIcon == null) { -if (this.selectedIcon != null) { -this.disabledSelectedIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledSelectedIcon (this, this.getSelectedIcon ()); -} else { -return this.getDisabledIcon (); -}}return this.disabledSelectedIcon; -}); -Clazz_defineMethod (c$, "setDisabledSelectedIcon", -function (disabledSelectedIcon) { -var oldValue = this.disabledSelectedIcon; -this.disabledSelectedIcon = disabledSelectedIcon; -this.firePropertyChangeObject ("disabledSelectedIcon", oldValue, disabledSelectedIcon); -if (disabledSelectedIcon !== oldValue) { -if (disabledSelectedIcon == null || oldValue == null || disabledSelectedIcon.getIconWidth () != oldValue.getIconWidth () || disabledSelectedIcon.getIconHeight () != oldValue.getIconHeight ()) { -this.revalidate (); -}if (!this.isEnabled () && this.isSelected ()) { -this.repaint (); -}}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getVerticalAlignment", -function () { -return this.verticalAlignment; -}); -Clazz_defineMethod (c$, "setVerticalAlignment", -function (alignment) { -if (alignment == this.verticalAlignment) return; -var oldValue = this.verticalAlignment; -this.verticalAlignment = this.checkVerticalKey (alignment, "verticalAlignment"); -this.firePropertyChangeInt ("verticalAlignment", oldValue, this.verticalAlignment); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getHorizontalAlignment", -function () { -return this.horizontalAlignment; -}); -Clazz_defineMethod (c$, "setHorizontalAlignment", -function (alignment) { -if (alignment == this.horizontalAlignment) return; -var oldValue = this.horizontalAlignment; -this.horizontalAlignment = this.checkHorizontalKey (alignment, "horizontalAlignment"); -this.firePropertyChangeInt ("horizontalAlignment", oldValue, this.horizontalAlignment); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getVerticalTextPosition", -function () { -return this.verticalTextPosition; -}); -Clazz_defineMethod (c$, "setVerticalTextPosition", -function (textPosition) { -if (textPosition == this.verticalTextPosition) return; -var oldValue = this.verticalTextPosition; -this.verticalTextPosition = this.checkVerticalKey (textPosition, "verticalTextPosition"); -this.firePropertyChangeInt ("verticalTextPosition", oldValue, this.verticalTextPosition); -this.revalidate (); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getHorizontalTextPosition", -function () { -return this.horizontalTextPosition; -}); -Clazz_defineMethod (c$, "setHorizontalTextPosition", -function (textPosition) { -if (textPosition == this.horizontalTextPosition) return; -var oldValue = this.horizontalTextPosition; -this.horizontalTextPosition = this.checkHorizontalKey (textPosition, "horizontalTextPosition"); -this.firePropertyChangeInt ("horizontalTextPosition", oldValue, this.horizontalTextPosition); -this.revalidate (); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getIconTextGap", -function () { -return this.iconTextGap; -}); -Clazz_defineMethod (c$, "setIconTextGap", -function (iconTextGap) { -var oldValue = this.iconTextGap; -this.iconTextGap = iconTextGap; -this.iconTextGapSet = true; -this.firePropertyChangeInt ("iconTextGap", oldValue, iconTextGap); -if (iconTextGap != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~N"); -Clazz_defineMethod (c$, "checkHorizontalKey", -function (key, exception) { -if ((key == 2) || (key == 0) || (key == 4) || (key == 10) || (key == 11)) { -return key; -} else { -throw new IllegalArgumentException (exception); -}}, "~N,~S"); -Clazz_defineMethod (c$, "checkVerticalKey", -function (key, exception) { -if ((key == 1) || (key == 0) || (key == 3)) { -return key; -} else { -throw new IllegalArgumentException (exception); -}}, "~N,~S"); -Clazz_defineMethod (c$, "removeNotify", -function () { -Clazz_superCall (this, javax.swing.AbstractButton, "removeNotify", []); -if (this.isRolloverEnabled ()) { -this.getModel ().setRollover (false); -}}); -Clazz_defineMethod (c$, "setActionCommand", -function (actionCommand) { -this.getModel ().setActionCommand (actionCommand); -}, "~S"); -Clazz_defineMethod (c$, "getActionCommand", -function () { -var ac = this.getModel ().getActionCommand (); -if (ac == null) { -ac = this.getText (); -}return ac; -}); -Clazz_defineMethod (c$, "setAction", -function (a) { -var oldValue = this.getAction (); -if (this.$action == null || !this.$action.equals (a)) { -this.$action = a; -if (oldValue != null) { -this.removeActionListener (oldValue); -oldValue.removePropertyChangeListener (this.actionPropertyChangeListener); -this.actionPropertyChangeListener = null; -}this.configurePropertiesFromAction (this.$action); -if (this.$action != null) { -if (!this.isListener (java.awt.event.ActionListener, this.$action)) { -this.addActionListener (this.$action); -}this.actionPropertyChangeListener = this.createActionPropertyChangeListener (this.$action); -this.$action.addPropertyChangeListener (this.actionPropertyChangeListener); -}this.firePropertyChangeObject ("action", oldValue, this.$action); -}}, "javax.swing.Action"); -Clazz_defineMethod (c$, "isListener", - function (c, a) { -var isListener = false; -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === c && listeners[i + 1] === a) { -isListener = true; -}} -return isListener; -}, "Class,java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "getAction", -function () { -return this.$action; -}); -Clazz_defineMethod (c$, "configurePropertiesFromAction", -function (a) { -this.setMnemonicFromAction (a); -this.setTextFromAction (a, false); -javax.swing.AbstractAction.setToolTipTextFromAction (this, a); -this.setIconFromAction (a); -this.setActionCommandFromAction (a); -javax.swing.AbstractAction.setEnabledFromAction (this, a); -if (javax.swing.AbstractAction.hasSelectedKey (a) && this.shouldUpdateSelectedStateFromAction ()) { -this.setSelectedFromAction (a); -}this.setDisplayedMnemonicIndexFromAction (a, false); -}, "javax.swing.Action"); -Clazz_overrideMethod (c$, "clientPropertyChanged", -function (key, oldValue, newValue) { -if (key === "hideActionText") { -var current = (Clazz_instanceOf (newValue, Boolean)) ? newValue : false; -if (this.getHideActionText () != current) { -this.setHideActionText (current); -}}}, "~O,~O,~O"); -Clazz_defineMethod (c$, "shouldUpdateSelectedStateFromAction", -function () { -return false; -}); -Clazz_defineMethod (c$, "actionPropertyChanged", -function (action, propertyName) { -if (propertyName === "Name") { -this.setTextFromAction (action, true); -} else if (propertyName === "enabled") { -javax.swing.AbstractAction.setEnabledFromAction (this, action); -} else if (propertyName === "ShortDescription") { -javax.swing.AbstractAction.setToolTipTextFromAction (this, action); -} else if (propertyName === "SmallIcon") { -this.smallIconChanged (action); -} else if (propertyName === "MnemonicKey") { -this.setMnemonicFromAction (action); -} else if (propertyName === "ActionCommandKey") { -this.setActionCommandFromAction (action); -} else if (propertyName === "SwingSelectedKey" && javax.swing.AbstractAction.hasSelectedKey (action) && this.shouldUpdateSelectedStateFromAction ()) { -this.setSelectedFromAction (action); -} else if (propertyName === "SwingDisplayedMnemonicIndexKey") { -this.setDisplayedMnemonicIndexFromAction (action, true); -} else if (propertyName === "SwingLargeIconKey") { -this.largeIconChanged (action); -}}, "javax.swing.Action,~S"); -Clazz_defineMethod (c$, "setDisplayedMnemonicIndexFromAction", - function (a, fromPropertyChange) { -var iValue = (a == null) ? null : a.getValue ("SwingDisplayedMnemonicIndexKey"); -if (fromPropertyChange || iValue != null) { -var value; -if (iValue == null) { -value = -1; -} else { -value = (iValue).intValue (); -var text = this.getText (); -if (text == null || value >= text.length) { -value = -1; -}}this.setDisplayedMnemonicIndex (value); -}}, "javax.swing.Action,~B"); -Clazz_defineMethod (c$, "setMnemonicFromAction", - function (a) { -var n = (a == null) ? null : a.getValue ("MnemonicKey"); -this.setMnemonic ((n == null) ? '\0' : n); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "setTextFromAction", - function (a, propertyChange) { -var hideText = this.getHideActionText (); -if (!propertyChange) { -this.setText ((a != null && !hideText) ? a.getValue ("Name") : null); -} else if (!hideText) { -this.setText (a.getValue ("Name")); -}}, "javax.swing.Action,~B"); -Clazz_defineMethod (c$, "setIconFromAction", -function (a) { -var icon = null; -if (a != null) { -icon = a.getValue ("SwingLargeIconKey"); -if (icon == null) { -icon = a.getValue ("SmallIcon"); -}}this.setIcon (icon); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "smallIconChanged", -function (a) { -if (a.getValue ("SwingLargeIconKey") == null) { -this.setIconFromAction (a); -}}, "javax.swing.Action"); -Clazz_defineMethod (c$, "largeIconChanged", -function (a) { -this.setIconFromAction (a); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "setActionCommandFromAction", - function (a) { -this.setActionCommand ((a != null) ? a.getValue ("ActionCommandKey") : null); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "setSelectedFromAction", - function (a) { -var selected = false; -if (a != null) { -selected = javax.swing.AbstractAction.isSelected (a); -}if (selected != this.isSelected ()) { -this.setSelected (selected); -if (!selected && this.isSelected ()) { -if (Clazz_instanceOf (this.getModel (), javax.swing.DefaultButtonModel)) { -var group = (this.getModel ()).getGroup (); -if (group != null) { -group.clearSelection (); -}}}}}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createActionPropertyChangeListener", -function (a) { -return this.createActionPropertyChangeListener0 (a); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createActionPropertyChangeListener0", -function (a) { -return new javax.swing.AbstractButton.ButtonActionPropertyChangeListener (this, a); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "isBorderPainted", -function () { -return this.$paintBorder; -}); -Clazz_defineMethod (c$, "setBorderPainted", -function (b) { -var oldValue = this.$paintBorder; -this.$paintBorder = b; -this.borderPaintedSet = true; -this.firePropertyChangeBool ("borderPainted", oldValue, this.$paintBorder); -if (b != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "paintBorder", -function (g) { -if (this.isBorderPainted ()) { -Clazz_superCall (this, javax.swing.AbstractButton, "paintBorder", [g]); -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "isFocusPainted", -function () { -return this.paintFocus; -}); -Clazz_defineMethod (c$, "setFocusPainted", -function (b) { -var oldValue = this.paintFocus; -this.paintFocus = b; -this.firePropertyChangeBool ("focusPainted", oldValue, this.paintFocus); -if (b != oldValue && this.isFocusOwner ()) { -this.revalidate (); -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "isContentAreaFilled", -function () { -return this.contentAreaFilled; -}); -Clazz_defineMethod (c$, "setContentAreaFilled", -function (b) { -var oldValue = this.contentAreaFilled; -this.contentAreaFilled = b; -this.contentAreaFilledSet = true; -this.firePropertyChangeBool ("contentAreaFilled", oldValue, this.contentAreaFilled); -if (b != oldValue) { -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "isRolloverEnabled", -function () { -return this.rolloverEnabled; -}); -Clazz_defineMethod (c$, "setRolloverEnabled", -function (b) { -var oldValue = this.rolloverEnabled; -this.rolloverEnabled = b; -this.rolloverEnabledSet = true; -this.firePropertyChangeBool ("rolloverEnabled", oldValue, this.rolloverEnabled); -if (b != oldValue) { -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "getMnemonic", -function () { -return this.mnemonic; -}); -Clazz_defineMethod (c$, "setMnemonic", -function (mnemonic) { -this.model.setMnemonic (mnemonic); -this.updateMnemonicProperties (); -}, "~N"); -Clazz_defineMethod (c$, "setMnemonic", -function (mnemonic) { -var vk = (mnemonic).charCodeAt (0); -if (vk >= 97 && vk <= 122) vk -= (32); -this.setMnemonic (vk); -}, "~S"); -Clazz_defineMethod (c$, "setDisplayedMnemonicIndex", -function (index) { -var oldValue = this.mnemonicIndex; -if (index == -1) { -this.mnemonicIndex = -1; -} else { -var text = this.getText (); -var textLength = (text == null) ? 0 : text.length; -if (index < -1 || index >= textLength) { -throw new IllegalArgumentException ("index == " + index); -}}this.mnemonicIndex = index; -this.firePropertyChangeInt ("displayedMnemonicIndex", oldValue, index); -if (index != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~N"); -Clazz_defineMethod (c$, "getDisplayedMnemonicIndex", -function () { -return this.mnemonicIndex; -}); -Clazz_defineMethod (c$, "updateDisplayedMnemonicIndex", - function (text, mnemonic) { -this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (text, mnemonic)); -}, "~S,~N"); -Clazz_defineMethod (c$, "updateMnemonicProperties", - function () { -var newMnemonic = this.model.getMnemonic (); -if (this.mnemonic != newMnemonic) { -var oldValue = this.mnemonic; -this.mnemonic = newMnemonic; -this.firePropertyChangeInt ("mnemonic", oldValue, this.mnemonic); -this.updateDisplayedMnemonicIndex (this.getText (), this.mnemonic); -this.revalidate (); -this.repaint (); -}}); -Clazz_defineMethod (c$, "setMultiClickThreshhold", -function (threshhold) { -if (threshhold < 0) { -throw new IllegalArgumentException ("threshhold must be >= 0"); -}this.multiClickThreshhold = threshhold; -}, "~N"); -Clazz_defineMethod (c$, "getMultiClickThreshhold", -function () { -return this.multiClickThreshhold; -}); -Clazz_defineMethod (c$, "getModel", -function () { -return this.model; -}); -Clazz_defineMethod (c$, "setModel", -function (newModel) { -var oldModel = this.getModel (); -if (oldModel != null) { -oldModel.removeChangeListener (this.changeListener); -oldModel.removeActionListener (this.actionListener); -oldModel.removeItemListener (this.itemListener); -this.changeListener = null; -this.actionListener = null; -this.itemListener = null; -}this.model = newModel; -if (newModel != null) { -this.changeListener = this.createChangeListener (); -this.actionListener = this.createActionListener (); -this.itemListener = this.createItemListener (); -newModel.addChangeListener (this.changeListener); -newModel.addActionListener (this.actionListener); -newModel.addItemListener (this.itemListener); -this.updateMnemonicProperties (); -Clazz_superCall (this, javax.swing.AbstractButton, "setEnabled", [newModel.isEnabled ()]); -} else { -this.mnemonic = 0; -}this.updateDisplayedMnemonicIndex (this.getText (), this.mnemonic); -this.firePropertyChangeObject ("model", oldModel, newModel); -if (newModel !== oldModel) { -this.revalidate (); -this.repaint (); -}}, "javax.swing.ButtonModel"); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_defineMethod (c$, "setUI", -function (ui) { -Clazz_superCall (this, javax.swing.AbstractButton, "setUI", [ui]); -if (Clazz_instanceOf (this.disabledIcon, javax.swing.plaf.UIResource)) { -this.setDisabledIcon (null); -}if (Clazz_instanceOf (this.disabledSelectedIcon, javax.swing.plaf.UIResource)) { -this.setDisabledSelectedIcon (null); -}}, "javax.swing.plaf.ButtonUI"); -Clazz_overrideMethod (c$, "updateUI", -function () { -}); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -if (!this.$setLayout) { -this.setLayout ( new javax.swing.OverlayLayout (this)); -}return this.addImplSAEM (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "setLayout", -function (mgr) { -this.$setLayout = true; -Clazz_superCall (this, javax.swing.AbstractButton, "setLayout", [mgr]); -}, "java.awt.LayoutManager"); -Clazz_defineMethod (c$, "addChangeListener", -function (l) { -this.listenerList.add (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "removeChangeListener", -function (l) { -this.listenerList.remove (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "getChangeListeners", -function () { -return (this.listenerList.getListeners (javax.swing.event.ChangeListener)); -}); -Clazz_defineMethod (c$, "fireStateChanged", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.ChangeListener) { -if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); -(listeners[i + 1]).stateChanged (this.changeEvent); -}} -}); -Clazz_defineMethod (c$, "addActionListener", -function (l) { -this.listenerList.add (java.awt.event.ActionListener, l); -}, "java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "removeActionListener", -function (l) { -if ((l != null) && (this.getAction () === l)) { -this.setAction (null); -} else { -this.listenerList.remove (java.awt.event.ActionListener, l); -}}, "java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "getActionListeners", -function () { -return (this.listenerList.getListeners (java.awt.event.ActionListener)); -}); -Clazz_defineMethod (c$, "createChangeListener", -function () { -return this.getHandler (); -}); -Clazz_defineMethod (c$, "fireActionPerformed", -function (event) { -var listeners = this.listenerList.getListenerList (); -var e = null; -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === java.awt.event.ActionListener) { -if (e == null) { -var actionCommand = event.getActionCommand (); -if (actionCommand == null) { -actionCommand = this.getActionCommand (); -}e = new java.awt.event.ActionEvent (this, 1001, actionCommand, event.getWhen (), event.getModifiers ()); -}(listeners[i + 1]).actionPerformed (e); -}} -}, "java.awt.event.ActionEvent"); -Clazz_defineMethod (c$, "fireItemStateChanged", -function (event) { -var listeners = this.listenerList.getListenerList (); -var e = null; -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === java.awt.event.ItemListener) { -if (e == null) { -e = new java.awt.event.ItemEvent (this, 701, this, event.getStateChange ()); -}(listeners[i + 1]).itemStateChanged (e); -}} -}, "java.awt.event.ItemEvent"); -Clazz_defineMethod (c$, "createActionListener", -function () { -return this.getHandler (); -}); -Clazz_defineMethod (c$, "createItemListener", -function () { -return this.getHandler (); -}); -Clazz_defineMethod (c$, "setEnabled", -function (b) { -if (!b && this.model.isRollover ()) { -this.model.setRollover (false); -}Clazz_superCall (this, javax.swing.AbstractButton, "setEnabled", [b]); -this.model.setEnabled (b); -}, "~B"); -Clazz_defineMethod (c$, "getLabel", -function () { -return this.getText (); -}); -Clazz_defineMethod (c$, "setLabel", -function (label) { -this.setText (label); -}, "~S"); -Clazz_overrideMethod (c$, "addItemListener", -function (l) { -this.listenerList.add (java.awt.event.ItemListener, l); -}, "java.awt.event.ItemListener"); -Clazz_overrideMethod (c$, "removeItemListener", -function (l) { -this.listenerList.remove (java.awt.event.ItemListener, l); -}, "java.awt.event.ItemListener"); -Clazz_defineMethod (c$, "getItemListeners", -function () { -return this.listenerList.getListeners (java.awt.event.ItemListener); -}); -Clazz_overrideMethod (c$, "getSelectedObjects", -function () { -if (this.isSelected () == false) { -return null; -}var selectedObjects = new Array (1); -selectedObjects[0] = this.getText (); -return selectedObjects; -}); -Clazz_defineMethod (c$, "init", -function (text, icon) { -if (text != null) { -this.setText (text); -}if (icon != null) { -this.setIcon (icon); -}this.updateUI (); -this.setAlignmentX (0.0); -this.setAlignmentY (0.5); -}, "~S,javax.swing.Icon"); -Clazz_defineMethod (c$, "imageUpdate", -function (img, infoflags, x, y, w, h) { -var iconDisplayed = this.getIcon (); -if (iconDisplayed == null) { -return false; -}if (!this.model.isEnabled ()) { -if (this.model.isSelected ()) { -iconDisplayed = this.getDisabledSelectedIcon (); -} else { -iconDisplayed = this.getDisabledIcon (); -}} else if (this.model.isPressed () && this.model.isArmed ()) { -iconDisplayed = this.getPressedIcon (); -} else if (this.isRolloverEnabled () && this.model.isRollover ()) { -if (this.model.isSelected ()) { -iconDisplayed = this.getRolloverSelectedIcon (); -} else { -iconDisplayed = this.getRolloverIcon (); -}} else if (this.model.isSelected ()) { -iconDisplayed = this.getSelectedIcon (); -}if (!javax.swing.SwingUtilities.doesIconReferenceImage (iconDisplayed, img)) { -return false; -}return Clazz_superCall (this, javax.swing.AbstractButton, "imageUpdate", [img, infoflags, x, y, w, h]); -}, "java.awt.Image,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setUIProperty", -function (propertyName, value) { -if (propertyName === "borderPainted") { -if (!this.borderPaintedSet) { -this.setBorderPainted ((value).booleanValue ()); -this.borderPaintedSet = false; -}} else if (propertyName === "rolloverEnabled") { -if (!this.rolloverEnabledSet) { -this.setRolloverEnabled ((value).booleanValue ()); -this.rolloverEnabledSet = false; -}} else if (propertyName === "iconTextGap") { -if (!this.iconTextGapSet) { -this.setIconTextGap ((value).intValue ()); -this.iconTextGapSet = false; -}} else if (propertyName === "contentAreaFilled") { -if (!this.contentAreaFilledSet) { -this.setContentAreaFilled ((value).booleanValue ()); -this.contentAreaFilledSet = false; -}} else { -Clazz_superCall (this, javax.swing.AbstractButton, "setUIProperty", [propertyName, value]); -}}, "~S,~O"); -Clazz_defineMethod (c$, "paramString", -function () { -var defaultIconString = ((this.defaultIcon != null) && (this.defaultIcon !== this) ? this.defaultIcon.toString () : ""); -var pressedIconString = ((this.pressedIcon != null) && (this.pressedIcon !== this) ? this.pressedIcon.toString () : ""); -var disabledIconString = ((this.disabledIcon != null) && (this.disabledIcon !== this) ? this.disabledIcon.toString () : ""); -var selectedIconString = ((this.selectedIcon != null) && (this.selectedIcon !== this) ? this.selectedIcon.toString () : ""); -var disabledSelectedIconString = ((this.disabledSelectedIcon != null) && (this.disabledSelectedIcon !== this) ? this.disabledSelectedIcon.toString () : ""); -var rolloverIconString = ((this.rolloverIcon != null) && (this.rolloverIcon !== this) ? this.rolloverIcon.toString () : ""); -var rolloverSelectedIconString = ((this.rolloverSelectedIcon != null) && (this.rolloverSelectedIcon !== this) ? this.rolloverSelectedIcon.toString () : ""); -var paintBorderString = (this.$paintBorder ? "true" : "false"); -var paintFocusString = (this.paintFocus ? "true" : "false"); -var rolloverEnabledString = (this.rolloverEnabled ? "true" : "false"); -return Clazz_superCall (this, javax.swing.AbstractButton, "paramString", []) + ",defaultIcon=" + defaultIconString + ",disabledIcon=" + disabledIconString + ",disabledSelectedIcon=" + disabledSelectedIconString + ",margin=" + this.margin + ",paintBorder=" + paintBorderString + ",paintFocus=" + paintFocusString + ",pressedIcon=" + pressedIconString + ",rolloverEnabled=" + rolloverEnabledString + ",rolloverIcon=" + rolloverIconString + ",rolloverSelectedIcon=" + rolloverSelectedIconString + ",selectedIcon=" + selectedIconString + ",text=" + this.text; -}); -Clazz_defineMethod (c$, "getHandler", - function () { -if (this.handler == null) { -this.handler = Clazz_innerTypeInstance (javax.swing.AbstractButton.Handler, this, null); -}return this.handler; -}); -c$.$AbstractButton$ButtonChangeListener$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, javax.swing.AbstractButton, "ButtonChangeListener", null, javax.swing.event.ChangeListener); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_overrideMethod (c$, "stateChanged", -function (a) { -this.b$["javax.swing.AbstractButton"].getHandler ().stateChanged (a); -}, "javax.swing.event.ChangeEvent"); -c$ = Clazz_p0p (); -}; -c$.$AbstractButton$Handler$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, javax.swing.AbstractButton, "Handler", null, [java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.ItemListener]); -Clazz_overrideMethod (c$, "stateChanged", -function (a) { -this.b$["javax.swing.AbstractButton"].updateMnemonicProperties (); -if (this.b$["javax.swing.AbstractButton"].isEnabled () != this.b$["javax.swing.AbstractButton"].model.isEnabled ()) { -this.b$["javax.swing.AbstractButton"].setEnabled (this.b$["javax.swing.AbstractButton"].model.isEnabled ()); -}this.b$["javax.swing.AbstractButton"].fireStateChanged (); -this.b$["javax.swing.AbstractButton"].repaint (); -}, "javax.swing.event.ChangeEvent"); -Clazz_overrideMethod (c$, "actionPerformed", -function (a) { -this.b$["javax.swing.AbstractButton"].fireActionPerformed (a); -}, "java.awt.event.ActionEvent"); -Clazz_overrideMethod (c$, "itemStateChanged", -function (a) { -this.b$["javax.swing.AbstractButton"].fireItemStateChanged (a); -if (this.b$["javax.swing.AbstractButton"].shouldUpdateSelectedStateFromAction ()) { -var b = this.b$["javax.swing.AbstractButton"].getAction (); -if (b != null && javax.swing.AbstractAction.hasSelectedKey (b)) { -var c = this.b$["javax.swing.AbstractButton"].isSelected (); -var d = javax.swing.AbstractAction.isSelected (b); -if (d != c) { -b.putValue ("SwingSelectedKey", new Boolean (c)); -}}}}, "java.awt.event.ItemEvent"); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.AbstractButton, "ButtonActionPropertyChangeListener", javax.swing.ActionPropertyChangeListener); -Clazz_overrideMethod (c$, "actionPropertyChanged", -function (a, b, c) { -if (javax.swing.AbstractAction.shouldReconfigure (c)) { -a.configurePropertiesFromAction (b); -} else { -a.actionPropertyChanged (b, c.getPropertyName ()); -}}, "javax.swing.AbstractButton,javax.swing.Action,java.beans.PropertyChangeEvent"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"MODEL_CHANGED_PROPERTY", "model", -"TEXT_CHANGED_PROPERTY", "text", -"MNEMONIC_CHANGED_PROPERTY", "mnemonic", -"MARGIN_CHANGED_PROPERTY", "margin", -"VERTICAL_ALIGNMENT_CHANGED_PROPERTY", "verticalAlignment", -"HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY", "horizontalAlignment", -"VERTICAL_TEXT_POSITION_CHANGED_PROPERTY", "verticalTextPosition", -"HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY", "horizontalTextPosition", -"BORDER_PAINTED_CHANGED_PROPERTY", "borderPainted", -"FOCUS_PAINTED_CHANGED_PROPERTY", "focusPainted", -"ROLLOVER_ENABLED_CHANGED_PROPERTY", "rolloverEnabled", -"CONTENT_AREA_FILLED_CHANGED_PROPERTY", "contentAreaFilled", -"ICON_CHANGED_PROPERTY", "icon", -"PRESSED_ICON_CHANGED_PROPERTY", "pressedIcon", -"SELECTED_ICON_CHANGED_PROPERTY", "selectedIcon", -"ROLLOVER_ICON_CHANGED_PROPERTY", "rolloverIcon", -"ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY", "rolloverSelectedIcon", -"DISABLED_ICON_CHANGED_PROPERTY", "disabledIcon", -"DISABLED_SELECTED_ICON_CHANGED_PROPERTY", "disabledSelectedIcon"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (null, "javax.swing.ArrayTable", ["java.util.Hashtable"], function () { -c$ = Clazz_decorateAsClass (function () { -this.table = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "ArrayTable", null, Cloneable); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "put", -function (key, value) { -if (this.table == null) { -this.table = Clazz_newArray (-1, [key, value]); -} else { -var size = this.size (); -if (size < 8) { -if (this.containsKey (key)) { -var tmp = this.table; -for (var i = 0; i < tmp.length - 1; i += 2) { -if (tmp[i].equals (key)) { -tmp[i + 1] = value; -break; -}} -} else { -var array = this.table; -var i = array.length; -var tmp = new Array (i + 2); -System.arraycopy (array, 0, tmp, 0, i); -tmp[i] = key; -tmp[i + 1] = value; -this.table = tmp; -}} else { -if ((size == 8) && this.isArray ()) { -this.grow (); -}(this.table).put (key, value); -}}}, "~O,~O"); -Clazz_defineMethod (c$, "get", -function (key) { -var value = null; -if (this.table != null) { -if (this.isArray ()) { -var array = this.table; -for (var i = 0; i < array.length - 1; i += 2) { -if (array[i].equals (key)) { -value = array[i + 1]; -break; -}} -} else { -value = (this.table).get (key); -}}return value; -}, "~O"); -Clazz_defineMethod (c$, "size", -function () { -var size; -if (this.table == null) return 0; -if (this.isArray ()) { -size = Clazz_doubleToInt ((this.table).length / 2); -} else { -size = (this.table).size (); -}return size; -}); -Clazz_defineMethod (c$, "containsKey", -function (key) { -var contains = false; -if (this.table != null) { -if (this.isArray ()) { -var array = this.table; -for (var i = 0; i < array.length - 1; i += 2) { -if (array[i].equals (key)) { -contains = true; -break; -}} -} else { -contains = (this.table).containsKey (key); -}}return contains; -}, "~O"); -Clazz_defineMethod (c$, "remove", -function (key) { -var value = null; -if (key == null) { -return null; -}if (this.table != null) { -if (this.isArray ()) { -var index = -1; -var array = this.table; -for (var i = array.length - 2; i >= 0; i -= 2) { -if (array[i].equals (key)) { -index = i; -value = array[i + 1]; -break; -}} -if (index != -1) { -var tmp = new Array (array.length - 2); -System.arraycopy (array, 0, tmp, 0, index); -if (index < tmp.length) System.arraycopy (array, index + 2, tmp, index, tmp.length - index); -this.table = (tmp.length == 0) ? null : tmp; -}} else { -value = (this.table).remove (key); -}if (this.size () == 7 && !this.isArray ()) { -this.shrink (); -}}return value; -}, "~O"); -Clazz_defineMethod (c$, "clear", -function () { -this.table = null; -}); -Clazz_overrideMethod (c$, "clone", -function () { -var newArrayTable = new javax.swing.ArrayTable (); -if (this.isArray ()) { -var array = this.table; -for (var i = 0; i < array.length - 1; i += 2) { -newArrayTable.put (array[i], array[i + 1]); -} -} else { -var tmp = this.table; -var keys = tmp.keys (); -while (keys.hasMoreElements ()) { -var o = keys.nextElement (); -newArrayTable.put (o, tmp.get (o)); -} -}return newArrayTable; -}); -Clazz_defineMethod (c$, "getKeys", -function (keys) { -if (this.table == null) { -return null; -}if (this.isArray ()) { -var array = this.table; -if (keys == null) { -keys = new Array (Clazz_doubleToInt (array.length / 2)); -}for (var i = 0, index = 0; i < array.length - 1; i += 2, index++) { -keys[index] = array[i]; -} -} else { -var tmp = this.table; -var enum_ = tmp.keys (); -var counter = tmp.size (); -if (keys == null) { -keys = new Array (counter); -}while (counter > 0) { -keys[--counter] = enum_.nextElement (); -} -}return keys; -}, "~A"); -Clazz_defineMethod (c$, "isArray", - function () { -return (Clazz_instanceOf (this.table, Array)); -}); -Clazz_defineMethod (c$, "grow", - function () { -var array = this.table; -var tmp = new java.util.Hashtable (Clazz_doubleToInt (array.length / 2)); -for (var i = 0; i < array.length; i += 2) { -tmp.put (array[i], array[i + 1]); -} -this.table = tmp; -}); -Clazz_defineMethod (c$, "shrink", - function () { -var tmp = this.table; -var array = new Array (tmp.size () * 2); -var keys = tmp.keys (); -var j = 0; -while (keys.hasMoreElements ()) { -var o = keys.nextElement (); -array[j] = o; -array[j + 1] = tmp.get (o); -j += 2; -} -this.table = array; -}); -Clazz_defineStatics (c$, -"ARRAY_BOUNDARY", 8); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.beans.PropertyChangeSupport"], "javax.swing.event.SwingPropertyChangeSupport", ["java.lang.NullPointerException", "javax.swing.SwingUtilities"], function () { -c$ = Clazz_decorateAsClass (function () { -this.notifyOnEDT = false; -Clazz_instantialize (this, arguments); -}, javax.swing.event, "SwingPropertyChangeSupport", java.beans.PropertyChangeSupport); -Clazz_makeConstructor (c$, -function (sourceBean) { -this.construct (sourceBean, false); -}, "~O"); -Clazz_makeConstructor (c$, -function (sourceBean, notifyOnEDT) { -Clazz_superConstructor (this, javax.swing.event.SwingPropertyChangeSupport, [sourceBean]); -this.notifyOnEDT = notifyOnEDT; -}, "~O,~B"); -Clazz_defineMethod (c$, "firePropertyChangeEvt", -function (evt) { -if (evt == null) { -throw new NullPointerException (); -}if (!this.isNotifyOnEDT () || javax.swing.SwingUtilities.isEventDispatchThread ()) { -Clazz_superCall (this, javax.swing.event.SwingPropertyChangeSupport, "firePropertyChangeEvt", [evt]); -} else { -javax.swing.SwingUtilities.invokeLater (((Clazz_isClassDefined ("javax.swing.event.SwingPropertyChangeSupport$1") ? 0 : javax.swing.event.SwingPropertyChangeSupport.$SwingPropertyChangeSupport$1$ ()), Clazz_innerTypeInstance (javax.swing.event.SwingPropertyChangeSupport$1, this, Clazz_cloneFinals ("evt", evt)))); -}}, "java.beans.PropertyChangeEvent"); -Clazz_defineMethod (c$, "isNotifyOnEDT", -function () { -return this.notifyOnEDT; -}); -c$.$SwingPropertyChangeSupport$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing.event, "SwingPropertyChangeSupport$1", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -this.b$["javax.swing.event.SwingPropertyChangeSupport"].firePropertyChangeEvt (this.f$.evt); -}); -c$ = Clazz_p0p (); -}; -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent"], "javax.swing.JLayeredPane", ["java.util.ArrayList", "$.Hashtable", "java.awt.Color"], function () { -c$ = Clazz_decorateAsClass (function () { -this.componentToLayer = null; -this.optimizedDrawingPossible = true; -Clazz_instantialize (this, arguments); -}, javax.swing, "JLayeredPane", javax.swing.JComponent); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JLayeredPane, []); -this.setLayout (null); -}); -Clazz_defineMethod (c$, "validateOptimizedDrawing", - function () { -var layeredComponentFound = false; -{ -var layer = null; -for (var c, $c = 0, $$c = this.getComponents (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) { -layer = null; -if ((Clazz_instanceOf (c, javax.swing.JComponent) && (layer = (c).getClientProperty ("layeredContainerLayer")) != null)) { -if (layer != null && layer.equals (javax.swing.JLayeredPane.FRAME_CONTENT_LAYER)) continue; -layeredComponentFound = true; -break; -}} -}if (layeredComponentFound) this.optimizedDrawingPossible = false; - else this.optimizedDrawingPossible = true; -}); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -var layer = javax.swing.JLayeredPane.DEFAULT_LAYER.intValue (); -var pos; -if (Clazz_instanceOf (constraints, Integer)) { -layer = (constraints).intValue (); -this.setLayer (comp, layer); -} else layer = this.getLayer (comp); -pos = this.insertIndexForLayer (layer, index); -this.addImplSAEM (comp, constraints, pos); -comp.validate (); -comp.repaint (); -this.validateOptimizedDrawing (); -return comp; -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "remove", -function (index) { -var c = this.getComponent (index); -Clazz_superCall (this, javax.swing.JLayeredPane, "remove", [index]); -if (c != null && !(Clazz_instanceOf (c, javax.swing.JComponent))) { -this.getComponentToLayer ().remove (c); -}this.validateOptimizedDrawing (); -}, "~N"); -Clazz_defineMethod (c$, "removeAll", -function () { -var children = this.getComponents (); -var cToL = this.getComponentToLayer (); -for (var counter = children.length - 1; counter >= 0; counter--) { -var c = children[counter]; -if (c != null && !(Clazz_instanceOf (c, javax.swing.JComponent))) { -cToL.remove (c); -}} -Clazz_superCall (this, javax.swing.JLayeredPane, "removeAll", []); -}); -Clazz_overrideMethod (c$, "isOptimizedDrawingEnabled", -function () { -return this.optimizedDrawingPossible; -}); -c$.putLayer = Clazz_defineMethod (c$, "putLayer", -function (c, layer) { -var layerObj; -layerObj = new Integer (layer); -c.putClientProperty ("layeredContainerLayer", layerObj); -}, "javax.swing.JComponent,~N"); -c$.getLayer = Clazz_defineMethod (c$, "getLayer", -function (c) { -var i; -if ((i = c.getClientProperty ("layeredContainerLayer")) != null) return i.intValue (); -return javax.swing.JLayeredPane.DEFAULT_LAYER.intValue (); -}, "javax.swing.JComponent"); -c$.getLayeredPaneAbove = Clazz_defineMethod (c$, "getLayeredPaneAbove", -function (c) { -if (c == null) return null; -var parent = c.getParent (); -while (parent != null && !(Clazz_instanceOf (parent, javax.swing.JLayeredPane))) parent = parent.getParent (); - -return parent; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "setLayer", -function (c, layer) { -this.setLayer (c, layer, -1); -}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "setLayer", -function (c, layer, position) { -var layerObj; -layerObj = this.getObjectForLayer (layer); -if (layer == this.getLayer (c) && position == this.getPosition (c)) { -this.repaint (c.getBounds ()); -return; -}if (Clazz_instanceOf (c, javax.swing.JComponent)) (c).putClientProperty ("layeredContainerLayer", layerObj); - else this.getComponentToLayer ().put (c, layerObj); -if (c.getParent () == null || c.getParent () !== this) { -this.repaint (c.getBounds ()); -return; -}var index = this.insertIndexForLayer (c, layer, position); -this.setComponentZOrder (c, index); -this.repaint (c.getBounds ()); -}, "java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getLayer", -function (c) { -var i; -if (Clazz_instanceOf (c, javax.swing.JComponent)) i = (c).getClientProperty ("layeredContainerLayer"); - else i = this.getComponentToLayer ().get (c); -if (i == null) return javax.swing.JLayeredPane.DEFAULT_LAYER.intValue (); -return i.intValue (); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getIndexOf", -function (c) { -var i; -var count; -count = this.getComponentCount (); -for (i = 0; i < count; i++) { -if (c === this.getComponent (i)) return i; -} -return -1; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "moveToFront", -function (c) { -this.setPosition (c, 0); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "moveToBack", -function (c) { -this.setPosition (c, -1); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "setPosition", -function (c, position) { -this.setLayer (c, this.getLayer (c), position); -}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "getPosition", -function (c) { -var i; -var count; -var startLayer; -var curLayer; -var startLocation; -var pos = 0; -count = this.getComponentCount (); -startLocation = this.getIndexOf (c); -if (startLocation == -1) return -1; -startLayer = this.getLayer (c); -for (i = startLocation - 1; i >= 0; i--) { -curLayer = this.getLayer (this.getComponent (i)); -if (curLayer == startLayer) pos++; - else return pos; -} -return pos; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "highestLayer", -function () { -if (this.getComponentCount () > 0) return this.getLayer (this.getComponent (0)); -return 0; -}); -Clazz_defineMethod (c$, "lowestLayer", -function () { -var count = this.getComponentCount (); -if (count > 0) return this.getLayer (this.getComponent (count - 1)); -return 0; -}); -Clazz_defineMethod (c$, "getComponentCountInLayer", -function (layer) { -var i; -var count; -var curLayer; -var layerCount = 0; -count = this.getComponentCount (); -for (i = 0; i < count; i++) { -curLayer = this.getLayer (this.getComponent (i)); -if (curLayer == layer) { -layerCount++; -} else if (layerCount > 0 || curLayer < layer) { -break; -}} -return layerCount; -}, "~N"); -Clazz_defineMethod (c$, "getComponentsInLayer", -function (layer) { -var i; -var count; -var curLayer; -var layerCount = 0; -var results; -results = new Array (this.getComponentCountInLayer (layer)); -count = this.getComponentCount (); -for (i = 0; i < count; i++) { -curLayer = this.getLayer (this.getComponent (i)); -if (curLayer == layer) { -results[layerCount++] = this.getComponent (i); -} else if (layerCount > 0 || curLayer < layer) { -break; -}} -return results; -}, "~N"); -Clazz_defineMethod (c$, "paint", -function (g) { -if (this.isOpaque ()) { -var r = g.getClipBounds (); -var c = this.getBackground (); -if (c == null) c = java.awt.Color.lightGray; -g.setColor (c); -if (r != null) { -g.fillRect (r.x, r.y, r.width, r.height); -} else { -g.fillRect (0, 0, this.getWidth (), this.getHeight ()); -}}Clazz_superCall (this, javax.swing.JLayeredPane, "paint", [g]); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "getComponentToLayer", -function () { -if (this.componentToLayer == null) this.componentToLayer = new java.util.Hashtable (4); -return this.componentToLayer; -}); -Clazz_defineMethod (c$, "getObjectForLayer", -function (layer) { -var layerObj; -switch (layer) { -case 0: -layerObj = javax.swing.JLayeredPane.DEFAULT_LAYER; -break; -case 100: -layerObj = javax.swing.JLayeredPane.PALETTE_LAYER; -break; -case 200: -layerObj = javax.swing.JLayeredPane.MODAL_LAYER; -break; -case 300: -layerObj = javax.swing.JLayeredPane.POPUP_LAYER; -break; -case 400: -layerObj = javax.swing.JLayeredPane.DRAG_LAYER; -break; -default: -layerObj = new Integer (layer); -} -return layerObj; -}, "~N"); -Clazz_defineMethod (c$, "insertIndexForLayer", -function (layer, position) { -return this.insertIndexForLayer (null, layer, position); -}, "~N,~N"); -Clazz_defineMethod (c$, "insertIndexForLayer", - function (comp, layer, position) { -var i; -var count; -var curLayer; -var layerStart = -1; -var layerEnd = -1; -var componentCount = this.getComponentCount (); -var compList = new java.util.ArrayList (componentCount); -for (var index = 0; index < componentCount; index++) { -if (this.getComponent (index) !== comp) { -compList.add (this.getComponent (index)); -}} -count = compList.size (); -for (i = 0; i < count; i++) { -curLayer = this.getLayer (compList.get (i)); -if (layerStart == -1 && curLayer == layer) { -layerStart = i; -}if (curLayer < layer) { -if (i == 0) { -layerStart = 0; -layerEnd = 0; -} else { -layerEnd = i; -}break; -}} -if (layerStart == -1 && layerEnd == -1) return count; -if (layerStart != -1 && layerEnd == -1) layerEnd = count; -if (layerEnd != -1 && layerStart == -1) layerStart = layerEnd; -if (position == -1) return layerEnd; -if (position > -1 && layerStart + position <= layerEnd) return layerStart + position; -return layerEnd; -}, "java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "paramString", -function () { -var optimizedDrawingPossibleString = (this.optimizedDrawingPossible ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JLayeredPane, "paramString", []) + ",optimizedDrawingPossible=" + optimizedDrawingPossibleString; -}); -c$.DEFAULT_LAYER = c$.prototype.DEFAULT_LAYER = new Integer (0); -c$.PALETTE_LAYER = c$.prototype.PALETTE_LAYER = new Integer (100); -c$.MODAL_LAYER = c$.prototype.MODAL_LAYER = new Integer (200); -c$.POPUP_LAYER = c$.prototype.POPUP_LAYER = new Integer (300); -c$.DRAG_LAYER = c$.prototype.DRAG_LAYER = new Integer (400); -c$.FRAME_CONTENT_LAYER = c$.prototype.FRAME_CONTENT_LAYER = new Integer (-30000); -Clazz_defineStatics (c$, -"LAYER_PROPERTY", "layeredContainerLayer"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent"], "javax.swing.JPanel", ["java.lang.Boolean", "java.awt.FlowLayout", "javax.swing.UIManager"], function () { -c$ = Clazz_declareType (javax.swing, "JPanel", javax.swing.JComponent); -Clazz_makeConstructor (c$, -function (layout, isDoubleBuffered) { -Clazz_superConstructor (this, javax.swing.JPanel, []); -this.setLayout (layout); -this.setUIProperty ("opaque", Boolean.TRUE); -this.updateUI (); -}, "java.awt.LayoutManager,~B"); -Clazz_makeConstructor (c$, -function (layout) { -this.construct (layout, true); -}, "java.awt.LayoutManager"); -Clazz_makeConstructor (c$, -function (isDoubleBuffered) { -this.construct ( new java.awt.FlowLayout (), isDoubleBuffered); -}, "~B"); -Clazz_makeConstructor (c$, -function () { -this.construct (true); -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "PanelUI"; -}); -Clazz_defineStatics (c$, -"$uiClassID", "PanelUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.lang.Enum", "java.util.Enumeration", "javax.swing.UIDefaults"], "javax.swing.MultiUIDefaults", ["java.lang.StringBuffer", "java.util.HashSet"], function () { -c$ = Clazz_decorateAsClass (function () { -this.tables = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "MultiUIDefaults", javax.swing.UIDefaults); -Clazz_makeConstructor (c$, -function (defaults) { -Clazz_superConstructor (this, javax.swing.MultiUIDefaults); -this.tables = defaults; -}, "~A"); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.MultiUIDefaults); -this.tables = new Array (0); -}); -Clazz_defineMethod (c$, "get", -function (key) { -var value = Clazz_superCall (this, javax.swing.MultiUIDefaults, "get", [key]); -if (value != null) { -return value; -}for (var i = 0; i < this.tables.length; i++) { -var table = this.tables[i]; -value = (table != null) ? table.get (key) : null; -if (value != null) { -return value; -}} -return null; -}, "~O"); -Clazz_defineMethod (c$, "get", -function (key, l) { -var value = Clazz_superCall (this, javax.swing.MultiUIDefaults, "get", [key, l]); -if (value != null) { -return value; -}for (var i = 0; i < this.tables.length; i++) { -var table = this.tables[i]; -value = (table != null) ? table.get (key, l) : null; -if (value != null) { -return value; -}} -return null; -}, "~O,java.util.Locale"); -Clazz_overrideMethod (c$, "size", -function () { -return this.entrySet ().size (); -}); -Clazz_overrideMethod (c$, "isEmpty", -function () { -return this.size () == 0; -}); -Clazz_overrideMethod (c$, "keys", -function () { -return new javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator (javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.KEYS, this.entrySet ()); -}); -Clazz_overrideMethod (c$, "elements", -function () { -return new javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator (javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.ELEMENTS, this.entrySet ()); -}); -Clazz_defineMethod (c$, "entrySet", -function () { -var set = new java.util.HashSet (); -for (var i = this.tables.length - 1; i >= 0; i--) { -if (this.tables[i] != null) { -set.addAll (this.tables[i].entrySet ()); -}} -set.addAll (Clazz_superCall (this, javax.swing.MultiUIDefaults, "entrySet", [])); -return set; -}); -Clazz_defineMethod (c$, "getUIError", -function (msg) { -if (this.tables.length > 0) { -this.tables[0].getUIError (msg); -} else { -Clazz_superCall (this, javax.swing.MultiUIDefaults, "getUIError", [msg]); -}}, "~S"); -Clazz_defineMethod (c$, "remove", -function (key) { -var value = null; -for (var i = this.tables.length - 1; i >= 0; i--) { -if (this.tables[i] != null) { -var v = this.tables[i].remove (key); -if (v != null) { -value = v; -}}} -var v = Clazz_superCall (this, javax.swing.MultiUIDefaults, "remove", [key]); -if (v != null) { -value = v; -}return value; -}, "~O"); -Clazz_defineMethod (c$, "clear", -function () { -Clazz_superCall (this, javax.swing.MultiUIDefaults, "clear", []); -for (var i = 0; i < this.tables.length; i++) { -var table = this.tables[i]; -if (table != null) { -table.clear (); -}} -}); -Clazz_overrideMethod (c$, "toString", -function () { -var buf = new StringBuffer (); -buf.append ("{"); -var keys = this.keys (); -while (keys.hasMoreElements ()) { -var key = keys.nextElement (); -buf.append (key + "=" + this.get (key) + ", "); -} -var length = buf.length (); -if (length > 1) { -buf.$delete (length - 2, length); -}buf.append ("}"); -return buf.toString (); -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.iterator = null; -this.type = null; -Clazz_instantialize (this, arguments); -}, javax.swing.MultiUIDefaults, "MultiUIDefaultsEnumerator", null, java.util.Enumeration); -Clazz_makeConstructor (c$, -function (a, b) { -this.type = a; -this.iterator = b.iterator (); -}, "javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type,java.util.Set"); -Clazz_overrideMethod (c$, "hasMoreElements", -function () { -return this.iterator.hasNext (); -}); -Clazz_overrideMethod (c$, "nextElement", -function () { -switch (this.type) { -case javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.KEYS: -return this.iterator.next ().getKey (); -case javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.ELEMENTS: -return this.iterator.next ().getValue (); -default: -return null; -} -}); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator, "Type", Enum); -Clazz_defineEnumConstant (c$, "KEYS", 0, []); -Clazz_defineEnumConstant (c$, "ELEMENTS", 1, []); -c$ = Clazz_p0p (); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (null, "java.awt.Font", ["java.awt.font.TextAttribute", "java.awt.geom.AffineTransform", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.family = null; -this.name = null; -this.style = 0; -this.size = 0; -this.pointSize = 0; -this.$hasLayoutAttributes = false; -this.nonIdentityTx = false; -this.hash = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "Font"); -Clazz_makeConstructor (c$, -function (name, style, size) { -this.name = (name != null) ? name : "Default"; -this.style = (style & -4) == 0 ? style : 0; -this.size = size; -this.pointSize = size; -}, "~S,~N,~N"); -Clazz_makeConstructor (c$, - function (name, style, sizePts) { -this.name = (name != null) ? name : "Default"; -this.style = (style & -4) == 0 ? style : 0; -this.size = Clazz_doubleToInt (sizePts + 0.5); -this.pointSize = sizePts; -}, "~S,~N,~N"); -Clazz_makeConstructor (c$, -function (font) { -this.name = font.name; -this.style = font.style; -this.size = font.size; -this.pointSize = font.pointSize; -}, "java.awt.Font"); -Clazz_defineMethod (c$, "getTransform", -function () { -return new java.awt.geom.AffineTransform (); -}); -Clazz_defineMethod (c$, "getFamily", -function () { -return (this.family == null ? this.family = swingjs.JSToolkit.getFontFamily (this) : this.family); -}); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getFontName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getStyle", -function () { -return this.style; -}); -Clazz_defineMethod (c$, "getSize", -function () { -return this.size; -}); -Clazz_defineMethod (c$, "getSize2D", -function () { -return this.pointSize; -}); -Clazz_defineMethod (c$, "isPlain", -function () { -return this.style == 0; -}); -Clazz_defineMethod (c$, "isBold", -function () { -return (this.style & 1) != 0; -}); -Clazz_defineMethod (c$, "isItalic", -function () { -return (this.style & 2) != 0; -}); -Clazz_defineMethod (c$, "isTransformed", -function () { -return this.nonIdentityTx; -}); -Clazz_defineMethod (c$, "hasLayoutAttributes", -function () { -return this.$hasLayoutAttributes; -}); -c$.getFont = Clazz_defineMethod (c$, "getFont", -function (nm) { -return java.awt.Font.getFont (nm, null); -}, "~S"); -c$.decode = Clazz_defineMethod (c$, "decode", -function (str) { -var fontName = str; -var styleName = ""; -var fontSize = 12; -var fontStyle = 0; -if (str == null) { -return new java.awt.Font ("Dialog", fontStyle, fontSize); -}var lastHyphen = str.lastIndexOf ('-'); -var lastSpace = str.lastIndexOf (' '); -var sepChar = (lastHyphen > lastSpace) ? '-' : ' '; -var sizeIndex = str.lastIndexOf (sepChar); -var styleIndex = str.lastIndexOf (sepChar, sizeIndex - 1); -var strlen = str.length; -if (sizeIndex > 0 && sizeIndex + 1 < strlen) { -try { -fontSize = Integer.$valueOf (str.substring (sizeIndex + 1)).intValue (); -if (fontSize <= 0) { -fontSize = 12; -}} catch (e) { -if (Clazz_exceptionOf (e, NumberFormatException)) { -styleIndex = sizeIndex; -sizeIndex = strlen; -if (str.charAt (sizeIndex - 1) == sepChar) { -sizeIndex--; -}} else { -throw e; -} -} -}if (styleIndex >= 0 && styleIndex + 1 < strlen) { -styleName = str.substring (styleIndex + 1, sizeIndex); -styleName = styleName.toLowerCase (); -if (styleName.equals ("bolditalic")) { -fontStyle = 3; -} else if (styleName.equals ("italic")) { -fontStyle = 2; -} else if (styleName.equals ("bold")) { -fontStyle = 1; -} else if (styleName.equals ("plain")) { -fontStyle = 0; -} else { -styleIndex = sizeIndex; -if (str.charAt (styleIndex - 1) == sepChar) { -styleIndex--; -}}fontName = str.substring (0, styleIndex); -} else { -var fontEnd = strlen; -if (styleIndex > 0) { -fontEnd = styleIndex; -} else if (sizeIndex > 0) { -fontEnd = sizeIndex; -}if (fontEnd > 0 && str.charAt (fontEnd - 1) == sepChar) { -fontEnd--; -}fontName = str.substring (0, fontEnd); -}return new java.awt.Font (fontName, fontStyle, fontSize); -}, "~S"); -c$.getFont = Clazz_defineMethod (c$, "getFont", -function (nm, font) { -var str = null; -try { -str = System.getProperty (nm); -} catch (e) { -if (Clazz_exceptionOf (e, SecurityException)) { -} else { -throw e; -} -} -if (str == null) { -return font; -}return java.awt.Font.decode (str); -}, "~S,java.awt.Font"); -Clazz_overrideMethod (c$, "hashCode", -function () { -if (this.hash == 0) { -this.hash = this.name.hashCode () ^ this.style ^ this.size; -}return this.hash; -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (obj === this) { -return true; -}if (obj != null) { -try { -var font = obj; -if (this.size == font.size && this.style == font.style && this.nonIdentityTx == font.nonIdentityTx && this.$hasLayoutAttributes == font.$hasLayoutAttributes && this.pointSize == font.pointSize && this.name.equals (font.name)) { -return true; -}} catch (e) { -if (Clazz_exceptionOf (e, ClassCastException)) { -} else { -throw e; -} -} -}return false; -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -var strStyle; -if (this.isBold ()) { -strStyle = this.isItalic () ? "bolditalic" : "bold"; -} else { -strStyle = this.isItalic () ? "italic" : "plain"; -}return this.getClass ().getName () + "[family=" + this.getFamily () + ",name=" + this.name + ",style=" + strStyle + ",size=" + this.size + "]"; -}); -Clazz_defineMethod (c$, "getAvailableAttributes", -function () { -var attributes = Clazz_newArray (-1, [java.awt.font.TextAttribute.FAMILY, java.awt.font.TextAttribute.WEIGHT, java.awt.font.TextAttribute.WIDTH, java.awt.font.TextAttribute.SIZE, java.awt.font.TextAttribute.UNDERLINE, java.awt.font.TextAttribute.STRIKETHROUGH]); -return attributes; -}); -Clazz_defineMethod (c$, "deriveFont", -function (style, size) { -return new java.awt.Font (this.name, style, size); -}, "~N,~N"); -Clazz_defineMethod (c$, "deriveFont", -function (size) { -return new java.awt.Font (this.name, this.style, size); -}, "~N"); -Clazz_defineMethod (c$, "deriveFont", -function (style) { -return new java.awt.Font (this.name, style, this.size); -}, "~N"); -Clazz_defineMethod (c$, "hasUniformLineMetrics", -function () { -return false; -}); -Clazz_overrideMethod (c$, "finalize", -function () { -}); -Clazz_defineStatics (c$, -"DIALOG", "Dialog", -"DIALOG_INPUT", "DialogInput", -"SANS_SERIF", "SansSerif", -"SERIF", "Serif", -"MONOSPACED", "Monospaced", -"PLAIN", 0, -"BOLD", 1, -"ITALIC", 2, -"ROMAN_BASELINE", 0, -"CENTER_BASELINE", 1, -"HANGING_BASELINE", 2, -"TRUETYPE_FONT", 0, -"TYPE1_FONT", 1, -"LAYOUT_LEFT_TO_RIGHT", 0, -"LAYOUT_RIGHT_TO_LEFT", 1, -"LAYOUT_NO_START_CONTEXT", 2, -"LAYOUT_NO_LIMIT_CONTEXT", 4); -}); -Clazz_declarePackage ("java.awt.font"); -Clazz_load (["java.text.AttributedCharacterIterator", "java.lang.Boolean", "$.Float", "java.util.HashMap"], "java.awt.font.TextAttribute", ["java.io.InvalidObjectException"], function () { -c$ = Clazz_declareType (java.awt.font, "TextAttribute", java.text.AttributedCharacterIterator.Attribute); -Clazz_makeConstructor (c$, -function (name) { -Clazz_superConstructor (this, java.awt.font.TextAttribute, [name]); -if (this.getClass () === java.awt.font.TextAttribute) { -java.awt.font.TextAttribute.$instanceMap.put (name, this); -}}, "~S"); -Clazz_overrideMethod (c$, "readResolve", -function () { -if (this.getClass () !== java.awt.font.TextAttribute) { -throw new java.io.InvalidObjectException ("subclass didn't correctly implement readResolve"); -}var instance = java.awt.font.TextAttribute.$instanceMap.get (this.getName ()); -if (instance != null) { -return instance; -} else { -throw new java.io.InvalidObjectException ("unknown attribute name"); -}}); -c$.$instanceMap = c$.prototype.$instanceMap = new java.util.HashMap (29); -c$.FAMILY = c$.prototype.FAMILY = new java.awt.font.TextAttribute ("family"); -c$.WEIGHT = c$.prototype.WEIGHT = new java.awt.font.TextAttribute ("weight"); -c$.WEIGHT_EXTRA_LIGHT = c$.prototype.WEIGHT_EXTRA_LIGHT = Float.$valueOf (0.5); -c$.WEIGHT_LIGHT = c$.prototype.WEIGHT_LIGHT = Float.$valueOf (0.75); -c$.WEIGHT_DEMILIGHT = c$.prototype.WEIGHT_DEMILIGHT = Float.$valueOf (0.875); -c$.WEIGHT_REGULAR = c$.prototype.WEIGHT_REGULAR = Float.$valueOf (1.0); -c$.WEIGHT_SEMIBOLD = c$.prototype.WEIGHT_SEMIBOLD = Float.$valueOf (1.25); -c$.WEIGHT_MEDIUM = c$.prototype.WEIGHT_MEDIUM = Float.$valueOf (1.5); -c$.WEIGHT_DEMIBOLD = c$.prototype.WEIGHT_DEMIBOLD = Float.$valueOf (1.75); -c$.WEIGHT_BOLD = c$.prototype.WEIGHT_BOLD = Float.$valueOf (2.0); -c$.WEIGHT_HEAVY = c$.prototype.WEIGHT_HEAVY = Float.$valueOf (2.25); -c$.WEIGHT_EXTRABOLD = c$.prototype.WEIGHT_EXTRABOLD = Float.$valueOf (2.5); -c$.WEIGHT_ULTRABOLD = c$.prototype.WEIGHT_ULTRABOLD = Float.$valueOf (2.75); -c$.WIDTH = c$.prototype.WIDTH = new java.awt.font.TextAttribute ("width"); -c$.WIDTH_CONDENSED = c$.prototype.WIDTH_CONDENSED = Float.$valueOf (0.75); -c$.WIDTH_SEMI_CONDENSED = c$.prototype.WIDTH_SEMI_CONDENSED = Float.$valueOf (0.875); -c$.WIDTH_REGULAR = c$.prototype.WIDTH_REGULAR = Float.$valueOf (1.0); -c$.WIDTH_SEMI_EXTENDED = c$.prototype.WIDTH_SEMI_EXTENDED = Float.$valueOf (1.25); -c$.WIDTH_EXTENDED = c$.prototype.WIDTH_EXTENDED = Float.$valueOf (1.5); -c$.POSTURE = c$.prototype.POSTURE = new java.awt.font.TextAttribute ("posture"); -c$.POSTURE_REGULAR = c$.prototype.POSTURE_REGULAR = Float.$valueOf (0.0); -c$.POSTURE_OBLIQUE = c$.prototype.POSTURE_OBLIQUE = Float.$valueOf (0.20); -c$.SIZE = c$.prototype.SIZE = new java.awt.font.TextAttribute ("size"); -c$.TRANSFORM = c$.prototype.TRANSFORM = new java.awt.font.TextAttribute ("transform"); -c$.SUPERSCRIPT = c$.prototype.SUPERSCRIPT = new java.awt.font.TextAttribute ("superscript"); -c$.SUPERSCRIPT_SUPER = c$.prototype.SUPERSCRIPT_SUPER = Integer.$valueOf (1); -c$.SUPERSCRIPT_SUB = c$.prototype.SUPERSCRIPT_SUB = Integer.$valueOf (-1); -c$.FONT = c$.prototype.FONT = new java.awt.font.TextAttribute ("font"); -c$.CHAR_REPLACEMENT = c$.prototype.CHAR_REPLACEMENT = new java.awt.font.TextAttribute ("char_replacement"); -c$.FOREGROUND = c$.prototype.FOREGROUND = new java.awt.font.TextAttribute ("foreground"); -c$.BACKGROUND = c$.prototype.BACKGROUND = new java.awt.font.TextAttribute ("background"); -c$.UNDERLINE = c$.prototype.UNDERLINE = new java.awt.font.TextAttribute ("underline"); -c$.UNDERLINE_ON = c$.prototype.UNDERLINE_ON = Integer.$valueOf (0); -c$.STRIKETHROUGH = c$.prototype.STRIKETHROUGH = new java.awt.font.TextAttribute ("strikethrough"); -c$.STRIKETHROUGH_ON = c$.prototype.STRIKETHROUGH_ON = Boolean.TRUE; -c$.RUN_DIRECTION = c$.prototype.RUN_DIRECTION = new java.awt.font.TextAttribute ("run_direction"); -c$.RUN_DIRECTION_LTR = c$.prototype.RUN_DIRECTION_LTR = Boolean.FALSE; -c$.RUN_DIRECTION_RTL = c$.prototype.RUN_DIRECTION_RTL = Boolean.TRUE; -c$.BIDI_EMBEDDING = c$.prototype.BIDI_EMBEDDING = new java.awt.font.TextAttribute ("bidi_embedding"); -c$.JUSTIFICATION = c$.prototype.JUSTIFICATION = new java.awt.font.TextAttribute ("justification"); -c$.JUSTIFICATION_FULL = c$.prototype.JUSTIFICATION_FULL = Float.$valueOf (1.0); -c$.JUSTIFICATION_NONE = c$.prototype.JUSTIFICATION_NONE = Float.$valueOf (0.0); -c$.INPUT_METHOD_HIGHLIGHT = c$.prototype.INPUT_METHOD_HIGHLIGHT = new java.awt.font.TextAttribute ("input method highlight"); -c$.INPUT_METHOD_UNDERLINE = c$.prototype.INPUT_METHOD_UNDERLINE = new java.awt.font.TextAttribute ("input method underline"); -c$.UNDERLINE_LOW_ONE_PIXEL = c$.prototype.UNDERLINE_LOW_ONE_PIXEL = Integer.$valueOf (1); -c$.UNDERLINE_LOW_TWO_PIXEL = c$.prototype.UNDERLINE_LOW_TWO_PIXEL = Integer.$valueOf (2); -c$.UNDERLINE_LOW_DOTTED = c$.prototype.UNDERLINE_LOW_DOTTED = Integer.$valueOf (3); -c$.UNDERLINE_LOW_GRAY = c$.prototype.UNDERLINE_LOW_GRAY = Integer.$valueOf (4); -c$.UNDERLINE_LOW_DASHED = c$.prototype.UNDERLINE_LOW_DASHED = Integer.$valueOf (5); -c$.SWAP_COLORS = c$.prototype.SWAP_COLORS = new java.awt.font.TextAttribute ("swap_colors"); -c$.SWAP_COLORS_ON = c$.prototype.SWAP_COLORS_ON = Boolean.TRUE; -c$.NUMERIC_SHAPING = c$.prototype.NUMERIC_SHAPING = new java.awt.font.TextAttribute ("numeric_shaping"); -c$.KERNING = c$.prototype.KERNING = new java.awt.font.TextAttribute ("kerning"); -c$.KERNING_ON = c$.prototype.KERNING_ON = Integer.$valueOf (1); -c$.LIGATURES = c$.prototype.LIGATURES = new java.awt.font.TextAttribute ("ligatures"); -c$.LIGATURES_ON = c$.prototype.LIGATURES_ON = Integer.$valueOf (1); -c$.TRACKING = c$.prototype.TRACKING = new java.awt.font.TextAttribute ("tracking"); -c$.TRACKING_TIGHT = c$.prototype.TRACKING_TIGHT = Float.$valueOf (-0.04); -c$.TRACKING_LOOSE = c$.prototype.TRACKING_LOOSE = Float.$valueOf (.04); -}); -Clazz_declarePackage ("java.text"); -Clazz_load (["java.text.CharacterIterator", "java.io.InvalidObjectException", "java.util.HashMap"], "java.text.AttributedCharacterIterator", null, function () { -Clazz_declareInterface (java.text, "AttributedCharacterIterator", java.text.CharacterIterator); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.name = null; -Clazz_instantialize (this, arguments); -}, java.text.AttributedCharacterIterator, "Attribute", null, java.io.Serializable); -Clazz_makeConstructor (c$, -function (a) { -this.name = a; -if (this.getClass () === java.text.AttributedCharacterIterator.Attribute) { -java.text.AttributedCharacterIterator.Attribute.instanceMap.put (a, this); -}}, "~S"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "(" + this.name + ")"; -}); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "readResolve", -function () { -if (this.getClass () !== java.text.AttributedCharacterIterator.Attribute) { -throw new java.io.InvalidObjectException ("subclass didn't correctly implement readResolve"); -}var a = java.text.AttributedCharacterIterator.Attribute.instanceMap.get (this.getName ()); -if (a != null) { -return a; -} else { -throw new java.io.InvalidObjectException ("unknown attribute name"); -}}); -c$.instanceMap = c$.prototype.instanceMap = new java.util.HashMap (7); -c$.LANGUAGE = c$.prototype.LANGUAGE = new java.text.AttributedCharacterIterator.Attribute ("language"); -c$.READING = c$.prototype.READING = new java.text.AttributedCharacterIterator.Attribute ("reading"); -c$.INPUT_METHOD_SEGMENT = c$.prototype.INPUT_METHOD_SEGMENT = new java.text.AttributedCharacterIterator.Attribute ("input_method_segment"); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.text"); -c$ = Clazz_declareInterface (java.text, "CharacterIterator", Cloneable); -Clazz_defineStatics (c$, -"DONE", '\uFFFF'); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (null, "java.awt.geom.Point2D", ["java.lang.Double", "$.InternalError"], function () { -c$ = Clazz_declareType (java.awt.geom, "Point2D", null, Cloneable); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setLocation", -function (p) { -this.setLocation (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -c$.distanceSq = Clazz_defineMethod (c$, "distanceSq", -function (x1, y1, x2, y2) { -x1 -= x2; -y1 -= y2; -return (x1 * x1 + y1 * y1); -}, "~N,~N,~N,~N"); -c$.distance = Clazz_defineMethod (c$, "distance", -function (x1, y1, x2, y2) { -x1 -= x2; -y1 -= y2; -return Math.sqrt (x1 * x1 + y1 * y1); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "distanceSq", -function (px, py) { -px -= this.getX (); -py -= this.getY (); -return (px * px + py * py); -}, "~N,~N"); -Clazz_defineMethod (c$, "distanceSq", -function (pt) { -var px = pt.getX () - this.getX (); -var py = pt.getY () - this.getY (); -return (px * px + py * py); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "distance", -function (px, py) { -px -= this.getX (); -py -= this.getY (); -return Math.sqrt (px * px + py * py); -}, "~N,~N"); -Clazz_defineMethod (c$, "distance", -function (pt) { -var px = pt.getX () - this.getX (); -var py = pt.getY () - this.getY (); -return Math.sqrt (px * px + py * py); -}, "java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.Point2D, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_overrideMethod (c$, "hashCode", -function () { -var bits = java.lang.Double.doubleToLongBits (this.getX ()); -bits ^= java.lang.Double.doubleToLongBits (this.getY ()) * 31; -return ((bits) ^ ((bits >> 32))); -}); -Clazz_defineMethod (c$, "equals", -function (obj) { -if (Clazz_instanceOf (obj, java.awt.geom.Point2D)) { -var p2d = obj; -return (this.getX () == p2d.getX ()) && (this.getY () == p2d.getY ()); -}return Clazz_superCall (this, java.awt.geom.Point2D, "equals", [obj]); -}, "~O"); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Point2D, "Float", java.awt.geom.Point2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.Point2D.Float, []); -}); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Point2D.Float, []); -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "setLocation", -function (a, b) { -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz_defineMethod (c$, "setLocation", -function (a, b) { -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz_overrideMethod (c$, "toString", -function () { -return "Point2D.Float[" + this.x + ", " + this.y + "]"; -}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Point2D, "Double", java.awt.geom.Point2D); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.geom.Point2D.Double, []); -}); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Point2D.Double, []); -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz_overrideMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_overrideMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "setLocation", -function (a, b) { -this.x = a; -this.y = b; -}, "~N,~N"); -Clazz_overrideMethod (c$, "toString", -function () { -return "Point2D.Double[" + this.x + ", " + this.y + "]"; -}); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (null, "java.awt.geom.AffineTransform", ["java.lang.Double", "$.InternalError", "JU.AU", "java.awt.geom.NoninvertibleTransformException", "$.Path2D", "$.Point2D", "java.awt.geom.Point2D.Double"], function () { -c$ = Clazz_decorateAsClass (function () { -this.m00 = 0; -this.m10 = 0; -this.m01 = 0; -this.m11 = 0; -this.m02 = 0; -this.m12 = 0; -this.state = 0; -this.type = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "AffineTransform", null, [Cloneable, java.io.Serializable]); -Clazz_makeConstructor (c$, - function (m00, m10, m01, m11, m02, m12, state) { -{ -switch (arguments.length) { case 0: this.m00 = this.m11 = 1.0; -return; -case 1: -if (Clazz_instanceOf(m00, java.awt.geom.AffineTransform)) { -var Tx = m00; this.m00 = -Tx.m00; this.m10 = Tx.m10; this.m01 = Tx.m01; this.m11 = -Tx.m11; this.m02 = Tx.m02; this.m12 = Tx.m12; this.state = -Tx.state; this.type = Tx.type; -} else { -var flatmatrix = m00; -this.m00 = flatmatrix[0]; -this.m10 = flatmatrix[1]; -this.m01 = flatmatrix[2]; -this.m11 = flatmatrix[3]; -if (flatmatrix.length > 5) { -this.m02 = flatmatrix[4]; -this.m12 = flatmatrix[5]; -} -this.updateState(); -} -return; -case 6: -this.m00 = m00; -this.m10 = m10; -this.m01 = m01; -this.m11 = m11; -this.m02 = m02; -this.m12 = m12; -this.updateState(); -return; -} -}this.m00 = m00; -this.m10 = m10; -this.m01 = m01; -this.m11 = m11; -this.m02 = m02; -this.m12 = m12; -this.state = state; -this.type = -1; -}, "~N,~N,~N,~N,~N,~N,~N"); -c$.getTranslateInstance = Clazz_defineMethod (c$, "getTranslateInstance", -function (tx, ty) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToTranslation (tx, ty); -return Tx; -}, "~N,~N"); -c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", -function (theta) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToRotation (theta); -return Tx; -}, "~N"); -c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", -function (theta, anchorx, anchory) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToRotation (theta, anchorx, anchory); -return Tx; -}, "~N,~N,~N"); -c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", -function (vecx, vecy) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToRotation (vecx, vecy); -return Tx; -}, "~N,~N"); -c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", -function (vecx, vecy, anchorx, anchory) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToRotation (vecx, vecy, anchorx, anchory); -return Tx; -}, "~N,~N,~N,~N"); -c$.getQuadrantRotateInstance = Clazz_defineMethod (c$, "getQuadrantRotateInstance", -function (numquadrants) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToQuadrantRotation (numquadrants); -return Tx; -}, "~N"); -c$.getQuadrantRotateInstance = Clazz_defineMethod (c$, "getQuadrantRotateInstance", -function (numquadrants, anchorx, anchory) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToQuadrantRotation (numquadrants, anchorx, anchory); -return Tx; -}, "~N,~N,~N"); -c$.getScaleInstance = Clazz_defineMethod (c$, "getScaleInstance", -function (sx, sy) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToScale (sx, sy); -return Tx; -}, "~N,~N"); -c$.getShearInstance = Clazz_defineMethod (c$, "getShearInstance", -function (shx, shy) { -var Tx = new java.awt.geom.AffineTransform (); -Tx.setToShear (shx, shy); -return Tx; -}, "~N,~N"); -Clazz_defineMethod (c$, "getType", -function () { -if (this.type == -1) { -this.calculateType (); -}return this.type; -}); -Clazz_defineMethod (c$, "calculateType", - function () { -var ret = 0; -var sgn0; -var sgn1; -var M0; -var M1; -var M2; -var M3; -this.updateState (); -switch (this.state) { -default: -this.stateError (); -case (7): -ret = 1; -case (6): -if ((M0 = this.m00) * (M2 = this.m01) + (M3 = this.m10) * (M1 = this.m11) != 0) { -this.type = 32; -return; -}sgn0 = (M0 >= 0.0); -sgn1 = (M1 >= 0.0); -if (sgn0 == sgn1) { -if (M0 != M1 || M2 != -M3) { -ret |= (20); -} else if (M0 * M1 - M2 * M3 != 1.0) { -ret |= (18); -} else { -ret |= 16; -}} else { -if (M0 != -M1 || M2 != M3) { -ret |= (84); -} else if (M0 * M1 - M2 * M3 != 1.0) { -ret |= (82); -} else { -ret |= (80); -}}break; -case (5): -ret = 1; -case (4): -sgn0 = ((M0 = this.m01) >= 0.0); -sgn1 = ((M1 = this.m10) >= 0.0); -if (sgn0 != sgn1) { -if (M0 != -M1) { -ret |= (12); -} else if (M0 != 1.0 && M0 != -1.0) { -ret |= (10); -} else { -ret |= 8; -}} else { -if (M0 == M1) { -ret |= (74); -} else { -ret |= (76); -}}break; -case (3): -ret = 1; -case (2): -sgn0 = ((M0 = this.m00) >= 0.0); -sgn1 = ((M1 = this.m11) >= 0.0); -if (sgn0 == sgn1) { -if (sgn0) { -if (M0 == M1) { -ret |= 2; -} else { -ret |= 4; -}} else { -if (M0 != M1) { -ret |= (12); -} else if (M0 != -1.0) { -ret |= (10); -} else { -ret |= 8; -}}} else { -if (M0 == -M1) { -if (M0 == 1.0 || M0 == -1.0) { -ret |= 64; -} else { -ret |= (66); -}} else { -ret |= (68); -}}break; -case (1): -ret = 1; -break; -case (0): -break; -} -this.type = ret; -}); -Clazz_defineMethod (c$, "getDeterminant", -function () { -switch (this.state) { -default: -this.stateError (); -case (7): -case (6): -return this.m00 * this.m11 - this.m01 * this.m10; -case (5): -case (4): -return -(this.m01 * this.m10); -case (3): -case (2): -return this.m00 * this.m11; -case (1): -case (0): -return 1.0; -} -}); -Clazz_defineMethod (c$, "updateState", -function () { -if (this.m01 == 0.0 && this.m10 == 0.0) { -if (this.m00 == 1.0 && this.m11 == 1.0) { -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 0; -this.type = 0; -} else { -this.state = 1; -this.type = 1; -}} else { -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 2; -this.type = -1; -} else { -this.state = (3); -this.type = -1; -}}} else { -if (this.m00 == 0.0 && this.m11 == 0.0) { -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 4; -this.type = -1; -} else { -this.state = (5); -this.type = -1; -}} else { -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = (6); -this.type = -1; -} else { -this.state = (7); -this.type = -1; -}}}}); -Clazz_defineMethod (c$, "stateError", - function () { -throw new InternalError ("missing case in transform state switch"); -}); -Clazz_defineMethod (c$, "getMatrix", -function (flatmatrix) { -flatmatrix[0] = this.m00; -flatmatrix[1] = this.m10; -flatmatrix[2] = this.m01; -flatmatrix[3] = this.m11; -if (flatmatrix.length > 5) { -flatmatrix[4] = this.m02; -flatmatrix[5] = this.m12; -}}, "~A"); -Clazz_defineMethod (c$, "getScaleX", -function () { -return this.m00; -}); -Clazz_defineMethod (c$, "getScaleY", -function () { -return this.m11; -}); -Clazz_defineMethod (c$, "getShearX", -function () { -return this.m01; -}); -Clazz_defineMethod (c$, "getShearY", -function () { -return this.m10; -}); -Clazz_defineMethod (c$, "getTranslateX", -function () { -return this.m02; -}); -Clazz_defineMethod (c$, "getTranslateY", -function () { -return this.m12; -}); -Clazz_defineMethod (c$, "translate", -function (tx, ty) { -switch (this.state) { -default: -this.stateError (); -case (7): -this.m02 = tx * this.m00 + ty * this.m01 + this.m02; -this.m12 = tx * this.m10 + ty * this.m11 + this.m12; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 6; -if (this.type != -1) { -this.type -= 1; -}}return; -case (6): -this.m02 = tx * this.m00 + ty * this.m01; -this.m12 = tx * this.m10 + ty * this.m11; -if (this.m02 != 0.0 || this.m12 != 0.0) { -this.state = 7; -this.type |= 1; -}return; -case (5): -this.m02 = ty * this.m01 + this.m02; -this.m12 = tx * this.m10 + this.m12; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 4; -if (this.type != -1) { -this.type -= 1; -}}return; -case (4): -this.m02 = ty * this.m01; -this.m12 = tx * this.m10; -if (this.m02 != 0.0 || this.m12 != 0.0) { -this.state = 5; -this.type |= 1; -}return; -case (3): -this.m02 = tx * this.m00 + this.m02; -this.m12 = ty * this.m11 + this.m12; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 2; -if (this.type != -1) { -this.type -= 1; -}}return; -case (2): -this.m02 = tx * this.m00; -this.m12 = ty * this.m11; -if (this.m02 != 0.0 || this.m12 != 0.0) { -this.state = 3; -this.type |= 1; -}return; -case (1): -this.m02 = tx + this.m02; -this.m12 = ty + this.m12; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 0; -this.type = 0; -}return; -case (0): -this.m02 = tx; -this.m12 = ty; -if (tx != 0.0 || ty != 0.0) { -this.state = 1; -this.type = 1; -}return; -} -}, "~N,~N"); -Clazz_defineMethod (c$, "rotate90", - function () { -var M0 = this.m00; -this.m00 = this.m01; -this.m01 = -M0; -M0 = this.m10; -this.m10 = this.m11; -this.m11 = -M0; -var state = java.awt.geom.AffineTransform.rot90conversion[this.state]; -if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) { -state -= 2; -}this.state = state; -this.type = -1; -}); -Clazz_defineMethod (c$, "rotate180", - function () { -this.m00 = -this.m00; -this.m11 = -this.m11; -var state = this.state; -if ((state & (4)) != 0) { -this.m01 = -this.m01; -this.m10 = -this.m10; -} else { -if (this.m00 == 1.0 && this.m11 == 1.0) { -this.state = state & -3; -} else { -this.state = state | 2; -}}this.type = -1; -}); -Clazz_defineMethod (c$, "rotate270", - function () { -var M0 = this.m00; -this.m00 = -this.m01; -this.m01 = M0; -M0 = this.m10; -this.m10 = -this.m11; -this.m11 = M0; -var state = java.awt.geom.AffineTransform.rot90conversion[this.state]; -if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) { -state -= 2; -}this.state = state; -this.type = -1; -}); -Clazz_defineMethod (c$, "rotate", -function (theta) { -var sin = Math.sin (theta); -if (sin == 1.0) { -this.rotate90 (); -} else if (sin == -1.0) { -this.rotate270 (); -} else { -var cos = Math.cos (theta); -if (cos == -1.0) { -this.rotate180 (); -} else if (cos != 1.0) { -var M0; -var M1; -M0 = this.m00; -M1 = this.m01; -this.m00 = cos * M0 + sin * M1; -this.m01 = -sin * M0 + cos * M1; -M0 = this.m10; -M1 = this.m11; -this.m10 = cos * M0 + sin * M1; -this.m11 = -sin * M0 + cos * M1; -this.updateState (); -}}}, "~N"); -Clazz_defineMethod (c$, "rotate", -function (theta, anchorx, anchory) { -this.translate (anchorx, anchory); -this.rotate (theta); -this.translate (-anchorx, -anchory); -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "rotate", -function (vecx, vecy) { -if (vecy == 0.0) { -if (vecx < 0.0) { -this.rotate180 (); -}} else if (vecx == 0.0) { -if (vecy > 0.0) { -this.rotate90 (); -} else { -this.rotate270 (); -}} else { -var len = Math.sqrt (vecx * vecx + vecy * vecy); -var sin = vecy / len; -var cos = vecx / len; -var M0; -var M1; -M0 = this.m00; -M1 = this.m01; -this.m00 = cos * M0 + sin * M1; -this.m01 = -sin * M0 + cos * M1; -M0 = this.m10; -M1 = this.m11; -this.m10 = cos * M0 + sin * M1; -this.m11 = -sin * M0 + cos * M1; -this.updateState (); -}}, "~N,~N"); -Clazz_defineMethod (c$, "rotate", -function (vecx, vecy, anchorx, anchory) { -this.translate (anchorx, anchory); -this.rotate (vecx, vecy); -this.translate (-anchorx, -anchory); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "quadrantRotate", -function (numquadrants) { -switch (numquadrants & 3) { -case 0: -break; -case 1: -this.rotate90 (); -break; -case 2: -this.rotate180 (); -break; -case 3: -this.rotate270 (); -break; -} -}, "~N"); -Clazz_defineMethod (c$, "quadrantRotate", -function (numquadrants, anchorx, anchory) { -switch (numquadrants & 3) { -case 0: -return; -case 1: -this.m02 += anchorx * (this.m00 - this.m01) + anchory * (this.m01 + this.m00); -this.m12 += anchorx * (this.m10 - this.m11) + anchory * (this.m11 + this.m10); -this.rotate90 (); -break; -case 2: -this.m02 += anchorx * (this.m00 + this.m00) + anchory * (this.m01 + this.m01); -this.m12 += anchorx * (this.m10 + this.m10) + anchory * (this.m11 + this.m11); -this.rotate180 (); -break; -case 3: -this.m02 += anchorx * (this.m00 + this.m01) + anchory * (this.m01 - this.m00); -this.m12 += anchorx * (this.m10 + this.m11) + anchory * (this.m11 - this.m10); -this.rotate270 (); -break; -} -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state &= -2; -} else { -this.state |= 1; -}}, "~N,~N,~N"); -Clazz_defineMethod (c$, "scale", -function (sx, sy) { -var state = this.state; -switch (state) { -default: -this.stateError (); -case (7): -case (6): -this.m00 *= sx; -this.m11 *= sy; -case (5): -case (4): -this.m01 *= sy; -this.m10 *= sx; -if (this.m01 == 0 && this.m10 == 0) { -state &= 1; -if (this.m00 == 1.0 && this.m11 == 1.0) { -this.type = (state == 0 ? 0 : 1); -} else { -state |= 2; -this.type = -1; -}this.state = state; -}return; -case (3): -case (2): -this.m00 *= sx; -this.m11 *= sy; -if (this.m00 == 1.0 && this.m11 == 1.0) { -this.state = (state &= 1); -this.type = (state == 0 ? 0 : 1); -} else { -this.type = -1; -}return; -case (1): -case (0): -this.m00 = sx; -this.m11 = sy; -if (sx != 1.0 || sy != 1.0) { -this.state = state | 2; -this.type = -1; -}return; -} -}, "~N,~N"); -Clazz_defineMethod (c$, "shear", -function (shx, shy) { -var state = this.state; -switch (state) { -default: -this.stateError (); -case (7): -case (6): -var M0; -var M1; -M0 = this.m00; -M1 = this.m01; -this.m00 = M0 + M1 * shy; -this.m01 = M0 * shx + M1; -M0 = this.m10; -M1 = this.m11; -this.m10 = M0 + M1 * shy; -this.m11 = M0 * shx + M1; -this.updateState (); -return; -case (5): -case (4): -this.m00 = this.m01 * shy; -this.m11 = this.m10 * shx; -if (this.m00 != 0.0 || this.m11 != 0.0) { -this.state = state | 2; -}this.type = -1; -return; -case (3): -case (2): -this.m01 = this.m00 * shx; -this.m10 = this.m11 * shy; -if (this.m01 != 0.0 || this.m10 != 0.0) { -this.state = state | 4; -}this.type = -1; -return; -case (1): -case (0): -this.m01 = shx; -this.m10 = shy; -if (this.m01 != 0.0 || this.m10 != 0.0) { -this.state = state | 2 | 4; -this.type = -1; -}return; -} -}, "~N,~N"); -Clazz_defineMethod (c$, "setToIdentity", -function () { -this.m00 = this.m11 = 1.0; -this.m10 = this.m01 = this.m02 = this.m12 = 0.0; -this.state = 0; -this.type = 0; -}); -Clazz_defineMethod (c$, "setToTranslation", -function (tx, ty) { -this.m00 = 1.0; -this.m10 = 0.0; -this.m01 = 0.0; -this.m11 = 1.0; -this.m02 = tx; -this.m12 = ty; -if (tx != 0.0 || ty != 0.0) { -this.state = 1; -this.type = 1; -} else { -this.state = 0; -this.type = 0; -}}, "~N,~N"); -Clazz_defineMethod (c$, "setToRotation", -function (theta) { -var sin = Math.sin (theta); -var cos; -if (sin == 1.0 || sin == -1.0) { -cos = 0.0; -this.state = 4; -this.type = 8; -} else { -cos = Math.cos (theta); -if (cos == -1.0) { -sin = 0.0; -this.state = 2; -this.type = 8; -} else if (cos == 1.0) { -sin = 0.0; -this.state = 0; -this.type = 0; -} else { -this.state = 6; -this.type = 16; -}}this.m00 = cos; -this.m10 = sin; -this.m01 = -sin; -this.m11 = cos; -this.m02 = 0.0; -this.m12 = 0.0; -}, "~N"); -Clazz_defineMethod (c$, "setToRotation", -function (theta, anchorx, anchory) { -this.setToRotation (theta); -var sin = this.m10; -var oneMinusCos = 1.0 - this.m00; -this.m02 = anchorx * oneMinusCos + anchory * sin; -this.m12 = anchory * oneMinusCos - anchorx * sin; -if (this.m02 != 0.0 || this.m12 != 0.0) { -this.state |= 1; -this.type |= 1; -}}, "~N,~N,~N"); -Clazz_defineMethod (c$, "setToRotation", -function (vecx, vecy) { -var sin; -var cos; -if (vecy == 0) { -sin = 0.0; -if (vecx < 0.0) { -cos = -1.0; -this.state = 2; -this.type = 8; -} else { -cos = 1.0; -this.state = 0; -this.type = 0; -}} else if (vecx == 0) { -cos = 0.0; -sin = (vecy > 0.0) ? 1.0 : -1.0; -this.state = 4; -this.type = 8; -} else { -var len = Math.sqrt (vecx * vecx + vecy * vecy); -cos = vecx / len; -sin = vecy / len; -this.state = 6; -this.type = 16; -}this.m00 = cos; -this.m10 = sin; -this.m01 = -sin; -this.m11 = cos; -this.m02 = 0.0; -this.m12 = 0.0; -}, "~N,~N"); -Clazz_defineMethod (c$, "setToRotation", -function (vecx, vecy, anchorx, anchory) { -this.setToRotation (vecx, vecy); -var sin = this.m10; -var oneMinusCos = 1.0 - this.m00; -this.m02 = anchorx * oneMinusCos + anchory * sin; -this.m12 = anchory * oneMinusCos - anchorx * sin; -if (this.m02 != 0.0 || this.m12 != 0.0) { -this.state |= 1; -this.type |= 1; -}}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setToQuadrantRotation", -function (numquadrants) { -switch (numquadrants & 3) { -case 0: -this.m00 = 1.0; -this.m10 = 0.0; -this.m01 = 0.0; -this.m11 = 1.0; -this.m02 = 0.0; -this.m12 = 0.0; -this.state = 0; -this.type = 0; -break; -case 1: -this.m00 = 0.0; -this.m10 = 1.0; -this.m01 = -1.0; -this.m11 = 0.0; -this.m02 = 0.0; -this.m12 = 0.0; -this.state = 4; -this.type = 8; -break; -case 2: -this.m00 = -1.0; -this.m10 = 0.0; -this.m01 = 0.0; -this.m11 = -1.0; -this.m02 = 0.0; -this.m12 = 0.0; -this.state = 2; -this.type = 8; -break; -case 3: -this.m00 = 0.0; -this.m10 = -1.0; -this.m01 = 1.0; -this.m11 = 0.0; -this.m02 = 0.0; -this.m12 = 0.0; -this.state = 4; -this.type = 8; -break; -} -}, "~N"); -Clazz_defineMethod (c$, "setToQuadrantRotation", -function (numquadrants, anchorx, anchory) { -switch (numquadrants & 3) { -case 0: -this.m00 = 1.0; -this.m10 = 0.0; -this.m01 = 0.0; -this.m11 = 1.0; -this.m02 = 0.0; -this.m12 = 0.0; -this.state = 0; -this.type = 0; -break; -case 1: -this.m00 = 0.0; -this.m10 = 1.0; -this.m01 = -1.0; -this.m11 = 0.0; -this.m02 = anchorx + anchory; -this.m12 = anchory - anchorx; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 4; -this.type = 8; -} else { -this.state = 5; -this.type = 9; -}break; -case 2: -this.m00 = -1.0; -this.m10 = 0.0; -this.m01 = 0.0; -this.m11 = -1.0; -this.m02 = anchorx + anchorx; -this.m12 = anchory + anchory; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 2; -this.type = 8; -} else { -this.state = 3; -this.type = 9; -}break; -case 3: -this.m00 = 0.0; -this.m10 = -1.0; -this.m01 = 1.0; -this.m11 = 0.0; -this.m02 = anchorx - anchory; -this.m12 = anchory + anchorx; -if (this.m02 == 0.0 && this.m12 == 0.0) { -this.state = 4; -this.type = 8; -} else { -this.state = 5; -this.type = 9; -}break; -} -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "setToScale", -function (sx, sy) { -this.m00 = sx; -this.m10 = 0.0; -this.m01 = 0.0; -this.m11 = sy; -this.m02 = 0.0; -this.m12 = 0.0; -if (sx != 1.0 || sy != 1.0) { -this.state = 2; -this.type = -1; -} else { -this.state = 0; -this.type = 0; -}}, "~N,~N"); -Clazz_defineMethod (c$, "setToShear", -function (shx, shy) { -this.m00 = 1.0; -this.m01 = shx; -this.m10 = shy; -this.m11 = 1.0; -this.m02 = 0.0; -this.m12 = 0.0; -if (shx != 0.0 || shy != 0.0) { -this.state = (6); -this.type = -1; -} else { -this.state = 0; -this.type = 0; -}}, "~N,~N"); -Clazz_defineMethod (c$, "setTransform", -function (Tx) { -this.m00 = Tx.m00; -this.m10 = Tx.m10; -this.m01 = Tx.m01; -this.m11 = Tx.m11; -this.m02 = Tx.m02; -this.m12 = Tx.m12; -this.state = Tx.state; -this.type = Tx.type; -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "setTransform", -function (m00, m10, m01, m11, m02, m12) { -this.m00 = m00; -this.m10 = m10; -this.m01 = m01; -this.m11 = m11; -this.m02 = m02; -this.m12 = m12; -this.updateState (); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "concatenate", -function (Tx) { -var M0; -var M1; -var T00; -var T01; -var T10; -var T11; -var T02; -var T12; -var mystate = this.state; -var txstate = Tx.state; -switch ((txstate << 3) | mystate) { -case (0): -case (1): -case (2): -case (3): -case (4): -case (5): -case (6): -case (7): -return; -case (56): -this.m01 = Tx.m01; -this.m10 = Tx.m10; -case (24): -this.m00 = Tx.m00; -this.m11 = Tx.m11; -case (8): -this.m02 = Tx.m02; -this.m12 = Tx.m12; -this.state = txstate; -this.type = Tx.type; -return; -case (48): -this.m01 = Tx.m01; -this.m10 = Tx.m10; -case (16): -this.m00 = Tx.m00; -this.m11 = Tx.m11; -this.state = txstate; -this.type = Tx.type; -return; -case (40): -this.m02 = Tx.m02; -this.m12 = Tx.m12; -case (32): -this.m01 = Tx.m01; -this.m10 = Tx.m10; -this.m00 = this.m11 = 0.0; -this.state = txstate; -this.type = Tx.type; -return; -case (15): -case (14): -case (13): -case (12): -case (11): -case (10): -case (9): -this.translate (Tx.m02, Tx.m12); -return; -case (23): -case (22): -case (21): -case (20): -case (19): -case (18): -case (17): -this.scale (Tx.m00, Tx.m11); -return; -case (39): -case (38): -T01 = Tx.m01; -T10 = Tx.m10; -M0 = this.m00; -this.m00 = this.m01 * T10; -this.m01 = M0 * T01; -M0 = this.m10; -this.m10 = this.m11 * T10; -this.m11 = M0 * T01; -this.type = -1; -return; -case (37): -case (36): -this.m00 = this.m01 * Tx.m10; -this.m01 = 0.0; -this.m11 = this.m10 * Tx.m01; -this.m10 = 0.0; -this.state = mystate ^ (6); -this.type = -1; -return; -case (35): -case (34): -this.m01 = this.m00 * Tx.m01; -this.m00 = 0.0; -this.m10 = this.m11 * Tx.m10; -this.m11 = 0.0; -this.state = mystate ^ (6); -this.type = -1; -return; -case (33): -this.m00 = 0.0; -this.m01 = Tx.m01; -this.m10 = Tx.m10; -this.m11 = 0.0; -this.state = 5; -this.type = -1; -return; -} -T00 = Tx.m00; -T01 = Tx.m01; -T02 = Tx.m02; -T10 = Tx.m10; -T11 = Tx.m11; -T12 = Tx.m12; -switch (mystate) { -default: -this.stateError (); -case (6): -this.state = mystate | txstate; -case (7): -M0 = this.m00; -M1 = this.m01; -this.m00 = T00 * M0 + T10 * M1; -this.m01 = T01 * M0 + T11 * M1; -this.m02 += T02 * M0 + T12 * M1; -M0 = this.m10; -M1 = this.m11; -this.m10 = T00 * M0 + T10 * M1; -this.m11 = T01 * M0 + T11 * M1; -this.m12 += T02 * M0 + T12 * M1; -this.type = -1; -return; -case (5): -case (4): -M0 = this.m01; -this.m00 = T10 * M0; -this.m01 = T11 * M0; -this.m02 += T12 * M0; -M0 = this.m10; -this.m10 = T00 * M0; -this.m11 = T01 * M0; -this.m12 += T02 * M0; -break; -case (3): -case (2): -M0 = this.m00; -this.m00 = T00 * M0; -this.m01 = T01 * M0; -this.m02 += T02 * M0; -M0 = this.m11; -this.m10 = T10 * M0; -this.m11 = T11 * M0; -this.m12 += T12 * M0; -break; -case (1): -this.m00 = T00; -this.m01 = T01; -this.m02 += T02; -this.m10 = T10; -this.m11 = T11; -this.m12 += T12; -this.state = txstate | 1; -this.type = -1; -return; -} -this.updateState (); -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "preConcatenate", -function (Tx) { -var M0; -var M1; -var T00; -var T01; -var T10; -var T11; -var T02; -var T12; -var mystate = this.state; -var txstate = Tx.state; -switch ((txstate << 3) | mystate) { -case (0): -case (1): -case (2): -case (3): -case (4): -case (5): -case (6): -case (7): -return; -case (8): -case (10): -case (12): -case (14): -this.m02 = Tx.m02; -this.m12 = Tx.m12; -this.state = mystate | 1; -this.type |= 1; -return; -case (9): -case (11): -case (13): -case (15): -this.m02 = this.m02 + Tx.m02; -this.m12 = this.m12 + Tx.m12; -return; -case (17): -case (16): -this.state = mystate | 2; -case (23): -case (22): -case (21): -case (20): -case (19): -case (18): -T00 = Tx.m00; -T11 = Tx.m11; -if ((mystate & 4) != 0) { -this.m01 = this.m01 * T00; -this.m10 = this.m10 * T11; -if ((mystate & 2) != 0) { -this.m00 = this.m00 * T00; -this.m11 = this.m11 * T11; -}} else { -this.m00 = this.m00 * T00; -this.m11 = this.m11 * T11; -}if ((mystate & 1) != 0) { -this.m02 = this.m02 * T00; -this.m12 = this.m12 * T11; -}this.type = -1; -return; -case (37): -case (36): -mystate = mystate | 2; -case (33): -case (32): -case (35): -case (34): -this.state = mystate ^ 4; -case (39): -case (38): -T01 = Tx.m01; -T10 = Tx.m10; -M0 = this.m00; -this.m00 = this.m10 * T01; -this.m10 = M0 * T10; -M0 = this.m01; -this.m01 = this.m11 * T01; -this.m11 = M0 * T10; -M0 = this.m02; -this.m02 = this.m12 * T01; -this.m12 = M0 * T10; -this.type = -1; -return; -} -T00 = Tx.m00; -T01 = Tx.m01; -T02 = Tx.m02; -T10 = Tx.m10; -T11 = Tx.m11; -T12 = Tx.m12; -switch (mystate) { -default: -this.stateError (); -case (7): -M0 = this.m02; -M1 = this.m12; -T02 += M0 * T00 + M1 * T01; -T12 += M0 * T10 + M1 * T11; -case (6): -this.m02 = T02; -this.m12 = T12; -M0 = this.m00; -M1 = this.m10; -this.m00 = M0 * T00 + M1 * T01; -this.m10 = M0 * T10 + M1 * T11; -M0 = this.m01; -M1 = this.m11; -this.m01 = M0 * T00 + M1 * T01; -this.m11 = M0 * T10 + M1 * T11; -break; -case (5): -M0 = this.m02; -M1 = this.m12; -T02 += M0 * T00 + M1 * T01; -T12 += M0 * T10 + M1 * T11; -case (4): -this.m02 = T02; -this.m12 = T12; -M0 = this.m10; -this.m00 = M0 * T01; -this.m10 = M0 * T11; -M0 = this.m01; -this.m01 = M0 * T00; -this.m11 = M0 * T10; -break; -case (3): -M0 = this.m02; -M1 = this.m12; -T02 += M0 * T00 + M1 * T01; -T12 += M0 * T10 + M1 * T11; -case (2): -this.m02 = T02; -this.m12 = T12; -M0 = this.m00; -this.m00 = M0 * T00; -this.m10 = M0 * T10; -M0 = this.m11; -this.m01 = M0 * T01; -this.m11 = M0 * T11; -break; -case (1): -M0 = this.m02; -M1 = this.m12; -T02 += M0 * T00 + M1 * T01; -T12 += M0 * T10 + M1 * T11; -case (0): -this.m02 = T02; -this.m12 = T12; -this.m00 = T00; -this.m10 = T10; -this.m01 = T01; -this.m11 = T11; -this.state = mystate | txstate; -this.type = -1; -return; -} -this.updateState (); -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "createInverse", -function () { -var det; -switch (this.state) { -default: -this.stateError (); -case (7): -det = this.m00 * this.m11 - this.m01 * this.m10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}return new java.awt.geom.AffineTransform (this.m11 / det, -this.m10 / det, -this.m01 / det, this.m00 / det, (this.m01 * this.m12 - this.m11 * this.m02) / det, (this.m10 * this.m02 - this.m00 * this.m12) / det, (7)); -case (6): -det = this.m00 * this.m11 - this.m01 * this.m10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}return new java.awt.geom.AffineTransform (this.m11 / det, -this.m10 / det, -this.m01 / det, this.m00 / det, 0.0, 0.0, (6)); -case (5): -if (this.m01 == 0.0 || this.m10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}return new java.awt.geom.AffineTransform (0.0, 1.0 / this.m01, 1.0 / this.m10, 0.0, -this.m12 / this.m10, -this.m02 / this.m01, (5)); -case (4): -if (this.m01 == 0.0 || this.m10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}return new java.awt.geom.AffineTransform (0.0, 1.0 / this.m01, 1.0 / this.m10, 0.0, 0.0, 0.0, (4)); -case (3): -if (this.m00 == 0.0 || this.m11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}return new java.awt.geom.AffineTransform (1.0 / this.m00, 0.0, 0.0, 1.0 / this.m11, -this.m02 / this.m00, -this.m12 / this.m11, (3)); -case (2): -if (this.m00 == 0.0 || this.m11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}return new java.awt.geom.AffineTransform (1.0 / this.m00, 0.0, 0.0, 1.0 / this.m11, 0.0, 0.0, (2)); -case (1): -return new java.awt.geom.AffineTransform (1.0, 0.0, 0.0, 1.0, -this.m02, -this.m12, (1)); -case (0): -return new java.awt.geom.AffineTransform (); -} -}); -Clazz_defineMethod (c$, "invert", -function () { -var M00; -var M01; -var M02; -var M10; -var M11; -var M12; -var det; -switch (this.state) { -default: -this.stateError (); -case (7): -M00 = this.m00; -M01 = this.m01; -M02 = this.m02; -M10 = this.m10; -M11 = this.m11; -M12 = this.m12; -det = M00 * M11 - M01 * M10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}this.m00 = M11 / det; -this.m10 = -M10 / det; -this.m01 = -M01 / det; -this.m11 = M00 / det; -this.m02 = (M01 * M12 - M11 * M02) / det; -this.m12 = (M10 * M02 - M00 * M12) / det; -break; -case (6): -M00 = this.m00; -M01 = this.m01; -M10 = this.m10; -M11 = this.m11; -det = M00 * M11 - M01 * M10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}this.m00 = M11 / det; -this.m10 = -M10 / det; -this.m01 = -M01 / det; -this.m11 = M00 / det; -break; -case (5): -M01 = this.m01; -M02 = this.m02; -M10 = this.m10; -M12 = this.m12; -if (M01 == 0.0 || M10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}this.m10 = 1.0 / M01; -this.m01 = 1.0 / M10; -this.m02 = -M12 / M10; -this.m12 = -M02 / M01; -break; -case (4): -M01 = this.m01; -M10 = this.m10; -if (M01 == 0.0 || M10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}this.m10 = 1.0 / M01; -this.m01 = 1.0 / M10; -break; -case (3): -M00 = this.m00; -M02 = this.m02; -M11 = this.m11; -M12 = this.m12; -if (M00 == 0.0 || M11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}this.m00 = 1.0 / M00; -this.m11 = 1.0 / M11; -this.m02 = -M02 / M00; -this.m12 = -M12 / M11; -break; -case (2): -M00 = this.m00; -M11 = this.m11; -if (M00 == 0.0 || M11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}this.m00 = 1.0 / M00; -this.m11 = 1.0 / M11; -break; -case (1): -this.m02 = -this.m02; -this.m12 = -this.m12; -break; -case (0): -break; -} -}); -Clazz_defineMethod (c$, "transform", -function (ptSrc, ptDst) { -if (ptDst == null) { -if (Clazz_instanceOf (ptSrc, java.awt.geom.Point2D.Double)) { -ptDst = new java.awt.geom.Point2D.Double (); -} else { -ptDst = new java.awt.geom.Point2D.Float (); -}}var x = ptSrc.getX (); -var y = ptSrc.getY (); -switch (this.state) { -default: -this.stateError (); -case (7): -ptDst.setLocation (x * this.m00 + y * this.m01 + this.m02, x * this.m10 + y * this.m11 + this.m12); -return ptDst; -case (6): -ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11); -return ptDst; -case (5): -ptDst.setLocation (y * this.m01 + this.m02, x * this.m10 + this.m12); -return ptDst; -case (4): -ptDst.setLocation (y * this.m01, x * this.m10); -return ptDst; -case (3): -ptDst.setLocation (x * this.m00 + this.m02, y * this.m11 + this.m12); -return ptDst; -case (2): -ptDst.setLocation (x * this.m00, y * this.m11); -return ptDst; -case (1): -ptDst.setLocation (x + this.m02, y + this.m12); -return ptDst; -case (0): -ptDst.setLocation (x, y); -return ptDst; -} -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "transform", -function (srcPts, srcOff, dstPts, dstOff, numPts) { -if (numPts == 0) return; -if (!JU.AU.isAD (srcPts)) { -var src = srcPts; -var dst = dstPts; -this.transform (src, srcOff, dst, dstOff, numPts); -return; -}var M00; -var M01; -var M02; -var M10; -var M11; -var M12; -if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) { -System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); -srcOff = dstOff; -}switch (this.state) { -default: -this.stateError (); -case (7): -M00 = this.m00; -M01 = this.m01; -M02 = this.m02; -M10 = this.m10; -M11 = this.m11; -M12 = this.m12; -while (--numPts >= 0) { -var x = srcPts[srcOff++]; -var y = srcPts[srcOff++]; -dstPts[dstOff++] = M00 * x + M01 * y + M02; -dstPts[dstOff++] = M10 * x + M11 * y + M12; -} -return; -case (6): -M00 = this.m00; -M01 = this.m01; -M10 = this.m10; -M11 = this.m11; -while (--numPts >= 0) { -var x = srcPts[srcOff++]; -var y = srcPts[srcOff++]; -dstPts[dstOff++] = M00 * x + M01 * y; -dstPts[dstOff++] = M10 * x + M11 * y; -} -return; -case (5): -M01 = this.m01; -M02 = this.m02; -M10 = this.m10; -M12 = this.m12; -while (--numPts >= 0) { -var x = srcPts[srcOff++]; -dstPts[dstOff++] = M01 * srcPts[srcOff++] + M02; -dstPts[dstOff++] = M10 * x + M12; -} -return; -case (4): -M01 = this.m01; -M10 = this.m10; -while (--numPts >= 0) { -var x = srcPts[srcOff++]; -dstPts[dstOff++] = M01 * srcPts[srcOff++]; -dstPts[dstOff++] = M10 * x; -} -return; -case (3): -M00 = this.m00; -M02 = this.m02; -M11 = this.m11; -M12 = this.m12; -while (--numPts >= 0) { -dstPts[dstOff++] = M00 * srcPts[srcOff++] + M02; -dstPts[dstOff++] = M11 * srcPts[srcOff++] + M12; -} -return; -case (2): -M00 = this.m00; -M11 = this.m11; -while (--numPts >= 0) { -dstPts[dstOff++] = M00 * srcPts[srcOff++]; -dstPts[dstOff++] = M11 * srcPts[srcOff++]; -} -return; -case (1): -M02 = this.m02; -M12 = this.m12; -while (--numPts >= 0) { -dstPts[dstOff++] = srcPts[srcOff++] + M02; -dstPts[dstOff++] = srcPts[srcOff++] + M12; -} -return; -case (0): -if (srcPts !== dstPts || srcOff != dstOff) { -System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); -}return; -} -}, "~A,~N,~A,~N,~N"); -Clazz_defineMethod (c$, "inverseTransform", -function (ptSrc, ptDst) { -if (ptDst == null) { -if (Clazz_instanceOf (ptSrc, java.awt.geom.Point2D.Double)) { -ptDst = new java.awt.geom.Point2D.Double (); -} else { -ptDst = new java.awt.geom.Point2D.Float (); -}}var x = ptSrc.getX (); -var y = ptSrc.getY (); -switch (this.state) { -default: -this.stateError (); -case (7): -x -= this.m02; -y -= this.m12; -case (6): -var det = this.m00 * this.m11 - this.m01 * this.m10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}ptDst.setLocation ((x * this.m11 - y * this.m01) / det, (y * this.m00 - x * this.m10) / det); -return ptDst; -case (5): -x -= this.m02; -y -= this.m12; -case (4): -if (this.m01 == 0.0 || this.m10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}ptDst.setLocation (y / this.m10, x / this.m01); -return ptDst; -case (3): -x -= this.m02; -y -= this.m12; -case (2): -if (this.m00 == 0.0 || this.m11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}ptDst.setLocation (x / this.m00, y / this.m11); -return ptDst; -case (1): -ptDst.setLocation (x - this.m02, y - this.m12); -return ptDst; -case (0): -ptDst.setLocation (x, y); -return ptDst; -} -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "inverseTransform", -function (srcPts, srcOff, dstPts, dstOff, numPts) { -var M00; -var M01; -var M02; -var M10; -var M11; -var M12; -var det; -if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) { -System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); -srcOff = dstOff; -}switch (this.state) { -default: -this.stateError (); -case (7): -M00 = this.m00; -M01 = this.m01; -M02 = this.m02; -M10 = this.m10; -M11 = this.m11; -M12 = this.m12; -det = M00 * M11 - M01 * M10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}while (--numPts >= 0) { -var x = srcPts[srcOff++] - M02; -var y = srcPts[srcOff++] - M12; -dstPts[dstOff++] = (x * M11 - y * M01) / det; -dstPts[dstOff++] = (y * M00 - x * M10) / det; -} -return; -case (6): -M00 = this.m00; -M01 = this.m01; -M10 = this.m10; -M11 = this.m11; -det = M00 * M11 - M01 * M10; -if (Math.abs (det) <= 4.9E-324) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); -}while (--numPts >= 0) { -var x = srcPts[srcOff++]; -var y = srcPts[srcOff++]; -dstPts[dstOff++] = (x * M11 - y * M01) / det; -dstPts[dstOff++] = (y * M00 - x * M10) / det; -} -return; -case (5): -M01 = this.m01; -M02 = this.m02; -M10 = this.m10; -M12 = this.m12; -if (M01 == 0.0 || M10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}while (--numPts >= 0) { -var x = srcPts[srcOff++] - M02; -dstPts[dstOff++] = (srcPts[srcOff++] - M12) / M10; -dstPts[dstOff++] = x / M01; -} -return; -case (4): -M01 = this.m01; -M10 = this.m10; -if (M01 == 0.0 || M10 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}while (--numPts >= 0) { -var x = srcPts[srcOff++]; -dstPts[dstOff++] = srcPts[srcOff++] / M10; -dstPts[dstOff++] = x / M01; -} -return; -case (3): -M00 = this.m00; -M02 = this.m02; -M11 = this.m11; -M12 = this.m12; -if (M00 == 0.0 || M11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}while (--numPts >= 0) { -dstPts[dstOff++] = (srcPts[srcOff++] - M02) / M00; -dstPts[dstOff++] = (srcPts[srcOff++] - M12) / M11; -} -return; -case (2): -M00 = this.m00; -M11 = this.m11; -if (M00 == 0.0 || M11 == 0.0) { -throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); -}while (--numPts >= 0) { -dstPts[dstOff++] = srcPts[srcOff++] / M00; -dstPts[dstOff++] = srcPts[srcOff++] / M11; -} -return; -case (1): -M02 = this.m02; -M12 = this.m12; -while (--numPts >= 0) { -dstPts[dstOff++] = srcPts[srcOff++] - M02; -dstPts[dstOff++] = srcPts[srcOff++] - M12; -} -return; -case (0): -if (srcPts !== dstPts || srcOff != dstOff) { -System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); -}return; -} -}, "~A,~N,~A,~N,~N"); -Clazz_defineMethod (c$, "deltaTransform", -function (ptSrc, ptDst) { -if (ptDst == null) { -if (Clazz_instanceOf (ptSrc, java.awt.geom.Point2D.Double)) { -ptDst = new java.awt.geom.Point2D.Double (); -} else { -ptDst = new java.awt.geom.Point2D.Float (); -}}var x = ptSrc.getX (); -var y = ptSrc.getY (); -switch (this.state) { -default: -this.stateError (); -case (7): -case (6): -ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11); -return ptDst; -case (5): -case (4): -ptDst.setLocation (y * this.m01, x * this.m10); -return ptDst; -case (3): -case (2): -ptDst.setLocation (x * this.m00, y * this.m11); -return ptDst; -case (1): -case (0): -ptDst.setLocation (x, y); -return ptDst; -} -}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "deltaTransform", -function (srcPts, srcOff, dstPts, dstOff, numPts) { -var M00; -var M01; -var M10; -var M11; -if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) { -System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); -srcOff = dstOff; -}switch (this.state) { -default: -this.stateError (); -case (7): -case (6): -M00 = this.m00; -M01 = this.m01; -M10 = this.m10; -M11 = this.m11; -while (--numPts >= 0) { -var x = srcPts[srcOff++]; -var y = srcPts[srcOff++]; -dstPts[dstOff++] = x * M00 + y * M01; -dstPts[dstOff++] = x * M10 + y * M11; -} -return; -case (5): -case (4): -M01 = this.m01; -M10 = this.m10; -while (--numPts >= 0) { -var x = srcPts[srcOff++]; -dstPts[dstOff++] = srcPts[srcOff++] * M01; -dstPts[dstOff++] = x * M10; -} -return; -case (3): -case (2): -M00 = this.m00; -M11 = this.m11; -while (--numPts >= 0) { -dstPts[dstOff++] = srcPts[srcOff++] * M00; -dstPts[dstOff++] = srcPts[srcOff++] * M11; -} -return; -case (1): -case (0): -if (srcPts !== dstPts || srcOff != dstOff) { -System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); -}return; -} -}, "~A,~N,~A,~N,~N"); -Clazz_defineMethod (c$, "createTransformedShape", -function (pSrc) { -if (pSrc == null) { -return null; -}return new java.awt.geom.Path2D.Double (pSrc, this); -}, "java.awt.Shape"); -c$._matround = Clazz_defineMethod (c$, "_matround", - function (matval) { -return Math.rint (matval * 1E15) / 1E15; -}, "~N"); -Clazz_overrideMethod (c$, "toString", -function () { -return ("AffineTransform[[" + java.awt.geom.AffineTransform._matround (this.m00) + ", " + java.awt.geom.AffineTransform._matround (this.m01) + ", " + java.awt.geom.AffineTransform._matround (this.m02) + "], [" + java.awt.geom.AffineTransform._matround (this.m10) + ", " + java.awt.geom.AffineTransform._matround (this.m11) + ", " + java.awt.geom.AffineTransform._matround (this.m12) + "]]"); -}); -Clazz_defineMethod (c$, "isIdentity", -function () { -return (this.state == 0 || (this.getType () == 0)); -}); -Clazz_defineMethod (c$, "clone", -function () { -try { -return Clazz_superCall (this, java.awt.geom.AffineTransform, "clone", []); -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -throw new InternalError (); -} else { -throw e; -} -} -}); -Clazz_overrideMethod (c$, "hashCode", -function () { -var bits = Double.doubleToLongBits (this.m00); -bits = bits * 31 + Double.doubleToLongBits (this.m01); -bits = bits * 31 + Double.doubleToLongBits (this.m02); -bits = bits * 31 + Double.doubleToLongBits (this.m10); -bits = bits * 31 + Double.doubleToLongBits (this.m11); -bits = bits * 31 + Double.doubleToLongBits (this.m12); -return ((bits) ^ ((bits >> 32))); -}); -Clazz_overrideMethod (c$, "equals", -function (obj) { -if (!(Clazz_instanceOf (obj, java.awt.geom.AffineTransform))) { -return false; -}var a = obj; -return ((this.m00 == a.m00) && (this.m01 == a.m01) && (this.m02 == a.m02) && (this.m10 == a.m10) && (this.m11 == a.m11) && (this.m12 == a.m12)); -}, "~O"); -Clazz_defineStatics (c$, -"TYPE_UNKNOWN", -1, -"TYPE_IDENTITY", 0, -"TYPE_TRANSLATION", 1, -"TYPE_UNIFORM_SCALE", 2, -"TYPE_GENERAL_SCALE", 4, -"TYPE_MASK_SCALE", (6), -"TYPE_FLIP", 64, -"TYPE_QUADRANT_ROTATION", 8, -"TYPE_GENERAL_ROTATION", 16, -"TYPE_MASK_ROTATION", (24), -"TYPE_GENERAL_TRANSFORM", 32, -"APPLY_IDENTITY", 0, -"APPLY_TRANSLATE", 1, -"APPLY_SCALE", 2, -"APPLY_SHEAR", 4, -"HI_SHIFT", 3, -"HI_IDENTITY", 0, -"HI_TRANSLATE", 8, -"HI_SCALE", 16, -"HI_SHEAR", 32, -"rot90conversion", Clazz_newIntArray (-1, [4, 5, 4, 5, 2, 3, 6, 7])); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.lang.Exception"], "java.awt.geom.NoninvertibleTransformException", null, function () { -c$ = Clazz_declareType (java.awt.geom, "NoninvertibleTransformException", Exception); -}); -Clazz_declarePackage ("java.awt.geom"); -Clazz_load (["java.awt.Shape", "java.awt.geom.PathIterator"], "java.awt.geom.Path2D", ["java.lang.Double", "$.IllegalArgumentException", "java.util.Arrays", "java.awt.geom.FlatteningPathIterator", "$.IllegalPathStateException", "$.Point2D", "$.Rectangle2D", "jssun.awt.geom.Curve"], function () { -c$ = Clazz_decorateAsClass (function () { -this.pointTypes = null; -this.numTypes = 0; -this.numCoords = 0; -this.windingRule = 0; -Clazz_instantialize (this, arguments); -}, java.awt.geom, "Path2D", null, [java.awt.Shape, Cloneable]); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_makeConstructor (c$, -function (rule, initialTypes) { -this.setWindingRule (rule); -this.pointTypes = Clazz_newByteArray (initialTypes, 0); -}, "~N,~N"); -Clazz_defineMethod (c$, "closePath", -function () { -if (this.numTypes == 0 || this.pointTypes[this.numTypes - 1] != 4) { -this.needRoom (true, 0); -this.pointTypes[this.numTypes++] = 4; -}}); -Clazz_defineMethod (c$, "append", -function (s, connect) { -this.append (s.getPathIterator (null), connect); -}, "java.awt.Shape,~B"); -Clazz_defineMethod (c$, "getWindingRule", -function () { -return this.windingRule; -}); -Clazz_defineMethod (c$, "setWindingRule", -function (rule) { -if (rule != 0 && rule != 1) { -throw new IllegalArgumentException ("winding rule must be WIND_EVEN_ODD or WIND_NON_ZERO"); -}this.windingRule = rule; -}, "~N"); -Clazz_defineMethod (c$, "getCurrentPoint", -function () { -var index = this.numCoords; -if (this.numTypes < 1 || index < 1) { -return null; -}if (this.pointTypes[this.numTypes - 1] == 4) { -loop : for (var i = this.numTypes - 2; i > 0; i--) { -switch (this.pointTypes[i]) { -case 0: -break loop; -case 1: -index -= 2; -break; -case 2: -index -= 4; -break; -case 3: -index -= 6; -break; -case 4: -break; -} -} -}return this.getPoint (index - 2); -}); -Clazz_defineMethod (c$, "reset", -function () { -this.numTypes = this.numCoords = 0; -}); -Clazz_defineMethod (c$, "createTransformedShape", -function (at) { -var p2d = this.clone (); -if (at != null) { -p2d.transform (at); -}return p2d; -}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getBounds", -function () { -return this.getBounds2D ().getBounds (); -}); -c$.contains = Clazz_defineMethod (c$, "contains", -function (pi, x, y) { -if (x * 0.0 + y * 0.0 == 0.0) { -var mask = (pi.getWindingRule () == 1 ? -1 : 1); -var cross = jssun.awt.geom.Curve.pointCrossingsForPath (pi, x, y); -return ((cross & mask) != 0); -} else { -return false; -}}, "java.awt.geom.PathIterator,~N,~N"); -c$.contains = Clazz_defineMethod (c$, "contains", -function (pi, p) { -return java.awt.geom.Path2D.contains (pi, p.getX (), p.getY ()); -}, "java.awt.geom.PathIterator,java.awt.geom.Point2D"); -Clazz_defineMethod (c$, "contains", -function (x, y) { -if (x * 0.0 + y * 0.0 == 0.0) { -if (this.numTypes < 2) { -return false; -}var mask = (this.windingRule == 1 ? -1 : 1); -return ((this.pointCrossings (x, y) & mask) != 0); -} else { -return false; -}}, "~N,~N"); -Clazz_defineMethod (c$, "contains", -function (p) { -return this.contains (p.getX (), p.getY ()); -}, "java.awt.geom.Point2D"); -c$.contains = Clazz_defineMethod (c$, "contains", -function (pi, x, y, w, h) { -if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { -return false; -}if (w <= 0 || h <= 0) { -return false; -}var mask = (pi.getWindingRule () == 1 ? -1 : 2); -var crossings = jssun.awt.geom.Curve.rectCrossingsForPath (pi, x, y, x + w, y + h); -return (crossings != -2147483648 && (crossings & mask) != 0); -}, "java.awt.geom.PathIterator,~N,~N,~N,~N"); -c$.contains = Clazz_defineMethod (c$, "contains", -function (pi, r) { -return java.awt.geom.Path2D.contains (pi, r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.PathIterator,java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "contains", -function (x, y, w, h) { -if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { -return false; -}if (w <= 0 || h <= 0) { -return false; -}var mask = (this.windingRule == 1 ? -1 : 2); -var crossings = this.rectCrossings (x, y, x + w, y + h); -return (crossings != -2147483648 && (crossings & mask) != 0); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "contains", -function (r) { -return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -c$.intersects = Clazz_defineMethod (c$, "intersects", -function (pi, x, y, w, h) { -if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { -return false; -}if (w <= 0 || h <= 0) { -return false; -}var mask = (pi.getWindingRule () == 1 ? -1 : 2); -var crossings = jssun.awt.geom.Curve.rectCrossingsForPath (pi, x, y, x + w, y + h); -return (crossings == -2147483648 || (crossings & mask) != 0); -}, "java.awt.geom.PathIterator,~N,~N,~N,~N"); -c$.intersects = Clazz_defineMethod (c$, "intersects", -function (pi, r) { -return java.awt.geom.Path2D.intersects (pi, r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.PathIterator,java.awt.geom.Rectangle2D"); -Clazz_defineMethod (c$, "intersects", -function (x, y, w, h) { -if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { -return false; -}if (w <= 0 || h <= 0) { -return false; -}var mask = (this.windingRule == 1 ? -1 : 2); -var crossings = this.rectCrossings (x, y, x + w, y + h); -return (crossings == -2147483648 || (crossings & mask) != 0); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "intersects", -function (r) { -return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); -}, "java.awt.geom.Rectangle2D"); -Clazz_overrideMethod (c$, "getPathIterator", -function (at, flatness) { -return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); -}, "java.awt.geom.AffineTransform,~N"); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.typeIdx = 0; -this.pointIdx = 0; -this.path = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D, "Iterator", null, java.awt.geom.PathIterator); -Clazz_makeConstructor (c$, -function (a) { -this.path = a; -}, "java.awt.geom.Path2D"); -Clazz_overrideMethod (c$, "getWindingRule", -function () { -return this.path.getWindingRule (); -}); -Clazz_overrideMethod (c$, "isDone", -function () { -return (this.typeIdx >= this.path.numTypes); -}); -Clazz_overrideMethod (c$, "next", -function () { -var a = this.path.pointTypes[this.typeIdx++]; -this.pointIdx += java.awt.geom.Path2D.Iterator.curvecoords[a]; -}); -Clazz_defineStatics (c$, -"curvecoords", Clazz_newIntArray (-1, [2, 2, 4, 6, 0])); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.floatCoords = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D, "Float", java.awt.geom.Path2D); -Clazz_makeConstructor (c$, -function () { -this.construct (1, 20); -}); -Clazz_makeConstructor (c$, -function (a) { -this.construct (a, 20); -}, "~N"); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Float, []); -this.setWindingRule (a); -this.pointTypes = Clazz_newByteArray (b, 0); -this.floatCoords = Clazz_newFloatArray (b * 2, 0); -}, "~N,~N"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (a, null); -}, "java.awt.Shape"); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Float, []); -this.setPath (a, b); -}, "java.awt.Shape,java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "setPath", - function (a, b) { -if (Clazz_instanceOf (a, java.awt.geom.Path2D)) { -var c = a; -this.setWindingRule (c.windingRule); -this.numTypes = c.numTypes; -this.pointTypes = java.util.Arrays.copyOf (c.pointTypes, c.pointTypes.length); -this.numCoords = c.numCoords; -this.floatCoords = c.cloneCoordsFloat (b); -} else { -var c = a.getPathIterator (b); -this.setWindingRule (c.getWindingRule ()); -this.pointTypes = Clazz_newByteArray (20, 0); -this.floatCoords = Clazz_newFloatArray (40, 0); -this.append (c, false); -}}, "java.awt.Shape,java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "cloneCoordsFloat", -function (a) { -var b; -if (a == null) { -b = java.util.Arrays.copyOf (this.floatCoords, this.floatCoords.length); -} else { -b = Clazz_newFloatArray (this.floatCoords.length, 0); -a.transform (this.floatCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); -}return b; -}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "cloneCoordsDouble", -function (a) { -var b = Clazz_newDoubleArray (this.floatCoords.length, 0); -if (a == null) { -for (var c = 0; c < this.numCoords; c++) { -b[c] = this.floatCoords[c]; -} -} else { -a.transform (this.floatCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); -}return b; -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "append", -function (a, b) { -{ -if (typeof pi == "number") { -this.floatCoords[this.numCoords++] = pi; -this.floatCoords[this.numCoords++] = connect; -return; -} -}var c = Clazz_newFloatArray (6, 0); -while (!a.isDone ()) { -switch (a.currentSegment (c)) { -case 0: -if (!b || this.numTypes < 1 || this.numCoords < 1) { -this.moveTo (c[0], c[1]); -break; -}if (this.pointTypes[this.numTypes - 1] != 4 && this.floatCoords[this.numCoords - 2] == c[0] && this.floatCoords[this.numCoords - 1] == c[1]) { -break; -}case 1: -this.lineTo (c[0], c[1]); -break; -case 2: -this.quadTo (c[0], c[1], c[2], c[3]); -break; -case 3: -this.curveTo (c[0], c[1], c[2], c[3], c[4], c[5]); -break; -case 4: -this.closePath (); -break; -} -a.next (); -b = false; -} -}, "java.awt.geom.PathIterator,~B"); -Clazz_overrideMethod (c$, "getPoint", -function (a) { -return new java.awt.geom.Point2D.Float (this.floatCoords[a], this.floatCoords[a + 1]); -}, "~N"); -Clazz_overrideMethod (c$, "needRoom", -function (a, b) { -if (a && this.numTypes == 0) { -throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); -}var c = this.pointTypes.length; -if (this.numTypes >= c) { -var d = c; -if (d > 500) { -d = 500; -}this.pointTypes = java.util.Arrays.copyOf (this.pointTypes, c + d); -}c = this.floatCoords.length; -if (this.numCoords + b > c) { -var d = c; -if (d > 1000) { -d = 1000; -}if (d < b) { -d = b; -}this.floatCoords = java.util.Arrays.copyOf (this.floatCoords, c + d); -}}, "~B,~N"); -Clazz_defineMethod (c$, "moveTo", -function (a, b) { -if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) { -this.floatCoords[this.numCoords - 2] = a; -this.floatCoords[this.numCoords - 1] = b; -} else { -this.needRoom (false, 2); -this.pointTypes[this.numTypes++] = 0; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -}}, "~N,~N"); -Clazz_defineMethod (c$, "moveTo", -function (a, b) { -if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) { -this.floatCoords[this.numCoords - 2] = a; -this.floatCoords[this.numCoords - 1] = b; -} else { -this.needRoom (false, 2); -this.pointTypes[this.numTypes++] = 0; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -}}, "~N,~N"); -Clazz_defineMethod (c$, "lineTo", -function (a, b) { -this.needRoom (true, 2); -this.pointTypes[this.numTypes++] = 1; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -}, "~N,~N"); -Clazz_defineMethod (c$, "lineTo", -function (a, b) { -this.needRoom (true, 2); -this.pointTypes[this.numTypes++] = 1; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -}, "~N,~N"); -Clazz_defineMethod (c$, "quadTo", -function (a, b, c, d) { -this.needRoom (true, 4); -this.pointTypes[this.numTypes++] = 2; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -this.floatCoords[this.numCoords++] = c; -this.floatCoords[this.numCoords++] = d; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "quadTo", -function (a, b, c, d) { -this.needRoom (true, 4); -this.pointTypes[this.numTypes++] = 2; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -this.floatCoords[this.numCoords++] = c; -this.floatCoords[this.numCoords++] = d; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "curveTo", -function (a, b, c, d, e, f) { -this.needRoom (true, 6); -this.pointTypes[this.numTypes++] = 3; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -this.floatCoords[this.numCoords++] = c; -this.floatCoords[this.numCoords++] = d; -this.floatCoords[this.numCoords++] = e; -this.floatCoords[this.numCoords++] = f; -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "curveTo", -function (a, b, c, d, e, f) { -this.needRoom (true, 6); -this.pointTypes[this.numTypes++] = 3; -this.floatCoords[this.numCoords++] = a; -this.floatCoords[this.numCoords++] = b; -this.floatCoords[this.numCoords++] = c; -this.floatCoords[this.numCoords++] = d; -this.floatCoords[this.numCoords++] = e; -this.floatCoords[this.numCoords++] = f; -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "pointCrossings", -function (a, b) { -var c; -var d; -var e; -var f; -var g; -var h; -var i = this.floatCoords; -e = c = i[0]; -f = d = i[1]; -var j = 0; -var k = 2; -for (var l = 1; l < this.numTypes; l++) { -switch (this.pointTypes[l]) { -case 0: -if (f != d) { -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); -}c = e = i[k++]; -d = f = i[k++]; -break; -case 1: -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, g = i[k++], h = i[k++]); -e = g; -f = h; -break; -case 2: -j += jssun.awt.geom.Curve.pointCrossingsForQuad (a, b, e, f, i[k++], i[k++], g = i[k++], h = i[k++], 0); -e = g; -f = h; -break; -case 3: -j += jssun.awt.geom.Curve.pointCrossingsForCubic (a, b, e, f, i[k++], i[k++], i[k++], i[k++], g = i[k++], h = i[k++], 0); -e = g; -f = h; -break; -case 4: -if (f != d) { -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); -}e = c; -f = d; -break; -} -} -if (f != d) { -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); -}return j; -}, "~N,~N"); -Clazz_overrideMethod (c$, "rectCrossings", -function (a, b, c, d) { -var e = this.floatCoords; -var f; -var g; -var h; -var i; -var j; -var k; -f = h = e[0]; -g = i = e[1]; -var l = 0; -var m = 2; -for (var n = 1; l != -2147483648 && n < this.numTypes; n++) { -switch (this.pointTypes[n]) { -case 0: -if (f != h || g != i) { -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); -}h = f = e[m++]; -i = g = e[m++]; -break; -case 1: -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, j = e[m++], k = e[m++]); -f = j; -g = k; -break; -case 2: -l = jssun.awt.geom.Curve.rectCrossingsForQuad (l, a, b, c, d, f, g, e[m++], e[m++], j = e[m++], k = e[m++], 0); -f = j; -g = k; -break; -case 3: -l = jssun.awt.geom.Curve.rectCrossingsForCubic (l, a, b, c, d, f, g, e[m++], e[m++], e[m++], e[m++], j = e[m++], k = e[m++], 0); -f = j; -g = k; -break; -case 4: -if (f != h || g != i) { -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); -}f = h; -g = i; -break; -} -} -if (l != -2147483648 && (f != h || g != i)) { -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); -}return l; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "transform", -function (a) { -a.transform (this.floatCoords, 0, this.floatCoords, 0, Clazz_doubleToInt (this.numCoords / 2)); -}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a; -var b; -var c; -var d; -var e = this.numCoords; -if (e > 0) { -b = d = this.floatCoords[--e]; -a = c = this.floatCoords[--e]; -while (e > 0) { -var f = this.floatCoords[--e]; -var g = this.floatCoords[--e]; -if (g < a) a = g; -if (f < b) b = f; -if (g > c) c = g; -if (f > d) d = f; -} -} else { -a = b = c = d = 0.0; -}return new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b); -}); -Clazz_defineMethod (c$, "getPathIterator", -function (a) { -if (a == null) { -return new java.awt.geom.Path2D.Float.CopyIterator (this); -} else { -return new java.awt.geom.Path2D.Float.TxIterator (this, a); -}}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "clone", -function () { -return new java.awt.geom.Path2D.Float (this); -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.floatCoords = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D.Float, "CopyIterator", java.awt.geom.Path2D.Iterator); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Float.CopyIterator, [a]); -this.floatCoords = a.floatCoords; -}, "java.awt.geom.Path2D.Float"); -Clazz_defineMethod (c$, "currentSegment", -function (a) { -var b = this.path.pointTypes[this.typeIdx]; -var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; -if (c > 0) { -for (var d = 0; d < c; d++) { -a[d] = this.floatCoords[this.pointIdx + d]; -} -}return b; -}, "~A"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.floatCoords = null; -this.affine = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D.Float, "TxIterator", java.awt.geom.Path2D.Iterator); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Float.TxIterator, [a]); -this.floatCoords = a.floatCoords; -this.affine = b; -}, "java.awt.geom.Path2D.Float,java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "currentSegment", -function (a) { -var b = this.path.pointTypes[this.typeIdx]; -var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; -if (c > 0) { -this.affine.transform (this.floatCoords, this.pointIdx, a, 0, Clazz_doubleToInt (c / 2)); -}return b; -}, "~A"); -c$ = Clazz_p0p (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.doubleCoords = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D, "Double", java.awt.geom.Path2D); -Clazz_makeConstructor (c$, -function () { -this.construct (1, 20); -}); -Clazz_makeConstructor (c$, -function (a) { -this.construct (a, 20); -}, "~N"); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Double, [a, b]); -this.doubleCoords = Clazz_newDoubleArray (b * 2, 0); -}, "~N,~N"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (a, null); -}, "java.awt.Shape"); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Double, []); -if (Clazz_instanceOf (a, java.awt.geom.Path2D)) { -var c = a; -this.setWindingRule (c.windingRule); -this.numTypes = c.numTypes; -this.pointTypes = java.util.Arrays.copyOf (c.pointTypes, c.pointTypes.length); -this.numCoords = c.numCoords; -this.doubleCoords = c.cloneCoordsDouble (b); -} else { -var c = a.getPathIterator (b); -this.setWindingRule (c.getWindingRule ()); -this.pointTypes = Clazz_newByteArray (20, 0); -this.doubleCoords = Clazz_newDoubleArray (40, 0); -this.append (c, false); -}}, "java.awt.Shape,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "cloneCoordsFloat", -function (a) { -var b = Clazz_newFloatArray (this.doubleCoords.length, 0); -if (a == null) { -for (var c = 0; c < this.numCoords; c++) { -b[c] = this.doubleCoords[c]; -} -} else { -a.transform (this.doubleCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); -}return b; -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "cloneCoordsDouble", -function (a) { -var b; -if (a == null) { -b = java.util.Arrays.copyOf (this.doubleCoords, this.doubleCoords.length); -} else { -b = Clazz_newDoubleArray (this.doubleCoords.length, 0); -a.transform (this.doubleCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); -}return b; -}, "java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "append", -function (a, b) { -{ -if (typeof pi == "number") { -this.floatCoords[this.numCoords++] = pi; -this.floatCoords[this.numCoords++] = connect; -return; -} -}var c = Clazz_newDoubleArray (6, 0); -while (!a.isDone ()) { -switch (a.currentSegment (c)) { -case 0: -if (!b || this.numTypes < 1 || this.numCoords < 1) { -this.moveTo (c[0], c[1]); -break; -}if (this.pointTypes[this.numTypes - 1] != 4 && this.doubleCoords[this.numCoords - 2] == c[0] && this.doubleCoords[this.numCoords - 1] == c[1]) { -break; -}case 1: -this.lineTo (c[0], c[1]); -break; -case 2: -this.quadTo (c[0], c[1], c[2], c[3]); -break; -case 3: -this.curveTo (c[0], c[1], c[2], c[3], c[4], c[5]); -break; -case 4: -this.closePath (); -break; -} -a.next (); -b = false; -} -}, "java.awt.geom.PathIterator,~B"); -Clazz_overrideMethod (c$, "getPoint", -function (a) { -return new java.awt.geom.Point2D.Double (this.doubleCoords[a], this.doubleCoords[a + 1]); -}, "~N"); -Clazz_overrideMethod (c$, "needRoom", -function (a, b) { -if (a && this.numTypes == 0) { -throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); -}var c = this.pointTypes.length; -if (this.numTypes >= c) { -var d = c; -if (d > 500) { -d = 500; -}this.pointTypes = java.util.Arrays.copyOf (this.pointTypes, c + d); -}c = this.doubleCoords.length; -if (this.numCoords + b > c) { -var d = c; -if (d > 1000) { -d = 1000; -}if (d < b) { -d = b; -}this.doubleCoords = java.util.Arrays.copyOf (this.doubleCoords, c + d); -}}, "~B,~N"); -Clazz_overrideMethod (c$, "moveTo", -function (a, b) { -if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) { -this.doubleCoords[this.numCoords - 2] = a; -this.doubleCoords[this.numCoords - 1] = b; -} else { -this.needRoom (false, 2); -this.pointTypes[this.numTypes++] = 0; -this.doubleCoords[this.numCoords++] = a; -this.doubleCoords[this.numCoords++] = b; -}}, "~N,~N"); -Clazz_overrideMethod (c$, "lineTo", -function (a, b) { -this.needRoom (true, 2); -this.pointTypes[this.numTypes++] = 1; -this.doubleCoords[this.numCoords++] = a; -this.doubleCoords[this.numCoords++] = b; -}, "~N,~N"); -Clazz_overrideMethod (c$, "quadTo", -function (a, b, c, d) { -this.needRoom (true, 4); -this.pointTypes[this.numTypes++] = 2; -this.doubleCoords[this.numCoords++] = a; -this.doubleCoords[this.numCoords++] = b; -this.doubleCoords[this.numCoords++] = c; -this.doubleCoords[this.numCoords++] = d; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "curveTo", -function (a, b, c, d, e, f) { -this.needRoom (true, 6); -this.pointTypes[this.numTypes++] = 3; -this.doubleCoords[this.numCoords++] = a; -this.doubleCoords[this.numCoords++] = b; -this.doubleCoords[this.numCoords++] = c; -this.doubleCoords[this.numCoords++] = d; -this.doubleCoords[this.numCoords++] = e; -this.doubleCoords[this.numCoords++] = f; -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "pointCrossings", -function (a, b) { -var c; -var d; -var e; -var f; -var g; -var h; -var i = this.doubleCoords; -e = c = i[0]; -f = d = i[1]; -var j = 0; -var k = 2; -for (var l = 1; l < this.numTypes; l++) { -switch (this.pointTypes[l]) { -case 0: -if (f != d) { -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); -}c = e = i[k++]; -d = f = i[k++]; -break; -case 1: -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, g = i[k++], h = i[k++]); -e = g; -f = h; -break; -case 2: -j += jssun.awt.geom.Curve.pointCrossingsForQuad (a, b, e, f, i[k++], i[k++], g = i[k++], h = i[k++], 0); -e = g; -f = h; -break; -case 3: -j += jssun.awt.geom.Curve.pointCrossingsForCubic (a, b, e, f, i[k++], i[k++], i[k++], i[k++], g = i[k++], h = i[k++], 0); -e = g; -f = h; -break; -case 4: -if (f != d) { -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); -}e = c; -f = d; -break; -} -} -if (f != d) { -j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); -}return j; -}, "~N,~N"); -Clazz_overrideMethod (c$, "rectCrossings", -function (a, b, c, d) { -var e = this.doubleCoords; -var f; -var g; -var h; -var i; -var j; -var k; -f = h = e[0]; -g = i = e[1]; -var l = 0; -var m = 2; -for (var n = 1; l != -2147483648 && n < this.numTypes; n++) { -switch (this.pointTypes[n]) { -case 0: -if (f != h || g != i) { -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); -}h = f = e[m++]; -i = g = e[m++]; -break; -case 1: -j = e[m++]; -k = e[m++]; -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, j, k); -f = j; -g = k; -break; -case 2: -l = jssun.awt.geom.Curve.rectCrossingsForQuad (l, a, b, c, d, f, g, e[m++], e[m++], j = e[m++], k = e[m++], 0); -f = j; -g = k; -break; -case 3: -l = jssun.awt.geom.Curve.rectCrossingsForCubic (l, a, b, c, d, f, g, e[m++], e[m++], e[m++], e[m++], j = e[m++], k = e[m++], 0); -f = j; -g = k; -break; -case 4: -if (f != h || g != i) { -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); -}f = h; -g = i; -break; -} -} -if (l != -2147483648 && (f != h || g != i)) { -l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); -}return l; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "transform", -function (a) { -a.transform (this.doubleCoords, 0, this.doubleCoords, 0, Clazz_doubleToInt (this.numCoords / 2)); -}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getBounds2D", -function () { -var a; -var b; -var c; -var d; -var e = this.numCoords; -if (e > 0) { -b = d = this.doubleCoords[--e]; -a = c = this.doubleCoords[--e]; -while (e > 0) { -var f = this.doubleCoords[--e]; -var g = this.doubleCoords[--e]; -if (g < a) a = g; -if (f < b) b = f; -if (g > c) c = g; -if (f > d) d = f; -} -} else { -a = b = c = d = 0.0; -}return new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b); -}); -Clazz_defineMethod (c$, "getPathIterator", -function (a) { -if (a == null) { -return new java.awt.geom.Path2D.Double.CopyIterator (this); -} else { -return new java.awt.geom.Path2D.Double.TxIterator (this, a); -}}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "clone", -function () { -return new java.awt.geom.Path2D.Double (this); -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.doubleCoords = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D.Double, "CopyIterator", java.awt.geom.Path2D.Iterator); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Double.CopyIterator, [a]); -this.doubleCoords = a.doubleCoords; -}, "java.awt.geom.Path2D.Double"); -Clazz_defineMethod (c$, "currentSegment", -function (a) { -var b = this.path.pointTypes[this.typeIdx]; -var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; -if (c > 0) { -for (var d = 0; d < c; d++) { -a[d] = this.doubleCoords[this.pointIdx + d]; -} -}return b; -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (a) { -var b = this.path.pointTypes[this.typeIdx]; -var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; -if (c > 0) { -System.arraycopy (this.doubleCoords, this.pointIdx, a, 0, c); -}return b; -}, "~A"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.doubleCoords = null; -this.affine = null; -Clazz_instantialize (this, arguments); -}, java.awt.geom.Path2D.Double, "TxIterator", java.awt.geom.Path2D.Iterator); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, java.awt.geom.Path2D.Double.TxIterator, [a]); -this.doubleCoords = a.doubleCoords; -this.affine = b; -}, "java.awt.geom.Path2D.Double,java.awt.geom.AffineTransform"); -Clazz_defineMethod (c$, "currentSegment", -function (a) { -var b = this.path.pointTypes[this.typeIdx]; -var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; -if (c > 0) { -this.affine.transform (this.doubleCoords, this.pointIdx, a, 0, Clazz_doubleToInt (c / 2)); -}return b; -}, "~A"); -Clazz_defineMethod (c$, "currentSegment", -function (a) { -var b = this.path.pointTypes[this.typeIdx]; -var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; -if (c > 0) { -this.affine.transform (this.doubleCoords, this.pointIdx, a, 0, Clazz_doubleToInt (c / 2)); -}return b; -}, "~A"); -c$ = Clazz_p0p (); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"WIND_EVEN_ODD", 0, -"WIND_NON_ZERO", 1, -"SEG_MOVETO", 0, -"SEG_LINETO", 1, -"SEG_QUADTO", 2, -"SEG_CUBICTO", 3, -"SEG_CLOSE", 4, -"INIT_SIZE", 20, -"EXPAND_MAX", 500); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "Icon"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JTextField"], "javax.swing.JPasswordField", ["javax.swing.text.Segment"], function () { -c$ = Clazz_decorateAsClass (function () { -this.echoChar = '\0'; -this.echoCharSet = false; -Clazz_instantialize (this, arguments); -}, javax.swing, "JPasswordField", javax.swing.JTextField); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, 0); -}); -Clazz_makeConstructor (c$, -function (text) { -this.construct (null, text, 0); -}, "~S"); -Clazz_makeConstructor (c$, -function (columns) { -this.construct (null, null, columns); -}, "~N"); -Clazz_makeConstructor (c$, -function (text, columns) { -this.construct (null, text, columns); -}, "~S,~N"); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "PasswordFieldUI"; -}); -Clazz_defineMethod (c$, "updateUI", -function () { -if (!this.echoCharSet) { -this.echoChar = '*'; -}Clazz_superCall (this, javax.swing.JPasswordField, "updateUI", []); -}); -Clazz_defineMethod (c$, "getEchoChar", -function () { -return this.echoChar; -}); -Clazz_defineMethod (c$, "setEchoChar", -function (c) { -this.echoChar = c; -this.echoCharSet = true; -this.repaint (); -this.revalidate (); -}, "~S"); -Clazz_defineMethod (c$, "echoCharIsSet", -function () { -return this.echoChar.charCodeAt (0) != 0; -}); -Clazz_overrideMethod (c$, "cut", -function () { -}); -Clazz_overrideMethod (c$, "copy", -function () { -}); -Clazz_defineMethod (c$, "getPassword", -function () { -var doc = this.getDocument (); -var txt = new javax.swing.text.Segment (); -try { -doc.getText (0, doc.getLength (), txt); -} catch (e) { -if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) { -return null; -} else { -throw e; -} -} -var retValue = Clazz_newCharArray (txt.count, '\0'); -System.arraycopy (txt.array, txt.offset, retValue, 0, txt.count); -return retValue; -}); -Clazz_defineMethod (c$, "paramString", -function () { -return Clazz_superCall (this, javax.swing.JPasswordField, "paramString", []) + ",echoChar=" + this.echoChar; -}); -Clazz_defineMethod (c$, "customSetUIProperty", -function (propertyName, value) { -if (propertyName === "echoChar") { -if (!this.echoCharSet) { -this.setEchoChar ((value).charValue ()); -this.echoCharSet = false; -}return true; -}return false; -}, "~S,~O"); -Clazz_defineStatics (c$, -"$$uiClassID", "PasswordFieldUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.ActionPropertyChangeListener", "$.SwingConstants", "javax.swing.event.ChangeListener", "javax.swing.text.JTextComponent", "$.TextAction"], "javax.swing.JTextField", ["java.lang.Boolean", "$.IllegalArgumentException", "java.awt.EventQueue", "java.awt.event.ActionEvent", "$.ActionListener", "$.InputEvent", "javax.swing.AbstractAction", "$.JViewport", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.$action = null; -this.actionPropertyChangeListener = null; -this.horizontalAlignment = 10; -this.columns = 0; -this.columnWidth = 0; -this.command = null; -if (!Clazz_isClassDefined ("javax.swing.JTextField.ScrollRepainter")) { -javax.swing.JTextField.$JTextField$ScrollRepainter$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "JTextField", javax.swing.text.JTextComponent, javax.swing.SwingConstants); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, 0); -}); -Clazz_makeConstructor (c$, -function (text) { -this.construct (null, text, 0); -}, "~S"); -Clazz_makeConstructor (c$, -function (columns) { -this.construct (null, null, columns); -}, "~N"); -Clazz_makeConstructor (c$, -function (text, columns) { -this.construct (null, text, columns); -}, "~S,~N"); -Clazz_makeConstructor (c$, -function (doc, text, columns) { -Clazz_superConstructor (this, javax.swing.JTextField); -if (columns < 0) { -throw new IllegalArgumentException ("columns less than zero."); -}this.columns = columns; -if (doc == null) { -doc = this.createDefaultModel (); -}this.setDocument (doc); -if (text != null) { -this.setText (text); -}}, "javax.swing.text.Document,~S,~N"); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "TextFieldUI"; -}); -Clazz_defineMethod (c$, "setDocument", -function (doc) { -if (doc != null) { -doc.putProperty ("filterNewlines", Boolean.TRUE); -}Clazz_superCall (this, javax.swing.JTextField, "setDocument", [doc]); -}, "javax.swing.text.Document"); -Clazz_overrideMethod (c$, "isValidateRoot", -function () { -var parent = this.getParent (); -if (Clazz_instanceOf (parent, javax.swing.JViewport)) { -return false; -}return true; -}); -Clazz_defineMethod (c$, "getHorizontalAlignment", -function () { -return this.horizontalAlignment; -}); -Clazz_defineMethod (c$, "setHorizontalAlignment", -function (alignment) { -if (alignment == this.horizontalAlignment) return; -var oldValue = this.horizontalAlignment; -if ((alignment == 2) || (alignment == 0) || (alignment == 4) || (alignment == 10) || (alignment == 11)) { -this.horizontalAlignment = alignment; -} else { -throw new IllegalArgumentException ("horizontalAlignment"); -}this.firePropertyChangeInt ("horizontalAlignment", oldValue, this.horizontalAlignment); -this.invalidate (); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "createDefaultModel", -function () { -return swingjs.JSToolkit.getPlainDocument (this); -}); -Clazz_defineMethod (c$, "getColumns", -function () { -return this.columns; -}); -Clazz_defineMethod (c$, "setColumns", -function (columns) { -var oldVal = this.columns; -if (columns < 0) { -throw new IllegalArgumentException ("columns less than zero."); -}if (columns != oldVal) { -this.columns = columns; -this.invalidate (); -}}, "~N"); -Clazz_defineMethod (c$, "getColumnWidth", -function () { -if (this.columnWidth == 0) { -var metrics = this.getFontMetrics (this.getFont ()); -this.columnWidth = metrics.charWidth ('m'); -}return this.columnWidth; -}); -Clazz_overrideMethod (c$, "getPreferredSize", -function () { -return this.getPrefSizeJTF (); -}); -Clazz_defineMethod (c$, "getPrefSizeJTF", -function () { -var size = this.getPrefSizeJComp (); -if (this.columns != 0) { -var insets = this.getInsets (); -size.width = this.columns * this.getColumnWidth () + insets.left + insets.right; -}return size; -}); -Clazz_defineMethod (c$, "setFont", -function (f) { -Clazz_superCall (this, javax.swing.JTextField, "setFont", [f]); -this.columnWidth = 0; -}, "java.awt.Font"); -Clazz_defineMethod (c$, "addActionListener", -function (l) { -this.listenerList.add (java.awt.event.ActionListener, l); -}, "java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "removeActionListener", -function (l) { -if ((l != null) && (this.getAction () === l)) { -this.setAction (null); -} else { -this.listenerList.remove (java.awt.event.ActionListener, l); -}}, "java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "getActionListeners", -function () { -return this.listenerList.getListeners (java.awt.event.ActionListener); -}); -Clazz_defineMethod (c$, "fireActionPerformed", -function () { -var listeners = this.listenerList.getListenerList (); -var modifiers = 0; -var currentEvent = java.awt.EventQueue.getCurrentEvent (); -if (Clazz_instanceOf (currentEvent, java.awt.event.InputEvent)) { -modifiers = (currentEvent).getModifiers (); -} else if (Clazz_instanceOf (currentEvent, java.awt.event.ActionEvent)) { -modifiers = (currentEvent).getModifiers (); -}var e = new java.awt.event.ActionEvent (this, 1001, (this.command != null) ? this.command : this.getText (), java.awt.EventQueue.getMostRecentEventTime (), modifiers); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === java.awt.event.ActionListener) { -(listeners[i + 1]).actionPerformed (e); -}} -}); -Clazz_defineMethod (c$, "setActionCommand", -function (command) { -this.command = command; -}, "~S"); -Clazz_defineMethod (c$, "setAction", -function (a) { -var oldValue = this.getAction (); -if (this.$action == null || !this.$action.equals (a)) { -this.$action = a; -if (oldValue != null) { -this.removeActionListener (oldValue); -oldValue.removePropertyChangeListener (this.actionPropertyChangeListener); -this.actionPropertyChangeListener = null; -}this.configurePropertiesFromAction (this.$action); -if (this.$action != null) { -if (!this.isListener (java.awt.event.ActionListener, this.$action)) { -this.addActionListener (this.$action); -}this.actionPropertyChangeListener = this.createActionPropertyChangeListener (this.$action); -this.$action.addPropertyChangeListener (this.actionPropertyChangeListener); -}this.firePropertyChangeObject ("action", oldValue, this.$action); -}}, "javax.swing.Action"); -Clazz_defineMethod (c$, "isListener", - function (c, a) { -var isListener = false; -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === c && listeners[i + 1] === a) { -isListener = true; -}} -return isListener; -}, "Class,java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "getAction", -function () { -return this.$action; -}); -Clazz_defineMethod (c$, "configurePropertiesFromAction", -function (a) { -javax.swing.AbstractAction.setEnabledFromAction (this, a); -javax.swing.AbstractAction.setToolTipTextFromAction (this, a); -this.setActionCommandFromAction (a); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "actionPropertyChanged", -function (action, propertyName) { -if (propertyName === "ActionCommandKey") { -this.setActionCommandFromAction (action); -} else if (propertyName === "enabled") { -javax.swing.AbstractAction.setEnabledFromAction (this, action); -} else if (propertyName === "ShortDescription") { -javax.swing.AbstractAction.setToolTipTextFromAction (this, action); -}}, "javax.swing.Action,~S"); -Clazz_defineMethod (c$, "setActionCommandFromAction", - function (action) { -this.setActionCommand ((action == null) ? null : action.getValue ("ActionCommandKey")); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createActionPropertyChangeListener", -function (a) { -return new javax.swing.JTextField.TextFieldActionPropertyChangeListener (this, a); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "getActions", -function () { -return javax.swing.text.TextAction.augmentList (Clazz_superCall (this, javax.swing.JTextField, "getActions", []), javax.swing.JTextField.defaultActions); -}); -Clazz_defineMethod (c$, "postActionEvent", -function () { -this.fireActionPerformed (); -}); -Clazz_defineMethod (c$, "hasActionListener", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === java.awt.event.ActionListener) { -return true; -}} -return false; -}); -Clazz_defineMethod (c$, "paramString", -function () { -var horizontalAlignmentString; -if (this.horizontalAlignment == 2) { -horizontalAlignmentString = "LEFT"; -} else if (this.horizontalAlignment == 0) { -horizontalAlignmentString = "CENTER"; -} else if (this.horizontalAlignment == 4) { -horizontalAlignmentString = "RIGHT"; -} else if (this.horizontalAlignment == 10) { -horizontalAlignmentString = "LEADING"; -} else if (this.horizontalAlignment == 11) { -horizontalAlignmentString = "TRAILING"; -} else horizontalAlignmentString = ""; -var commandString = (this.command != null ? this.command : ""); -return Clazz_superCall (this, javax.swing.JTextField, "paramString", []) + ",columns=" + this.columns + ",columnWidth=" + this.columnWidth + ",command=" + commandString + ",horizontalAlignment=" + horizontalAlignmentString; -}); -c$.$JTextField$ScrollRepainter$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, javax.swing.JTextField, "ScrollRepainter", null, javax.swing.event.ChangeListener); -Clazz_overrideMethod (c$, "stateChanged", -function (a) { -this.b$["javax.swing.JTextField"].repaint (); -}, "javax.swing.event.ChangeEvent"); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.JTextField, "TextFieldActionPropertyChangeListener", javax.swing.ActionPropertyChangeListener); -Clazz_overrideMethod (c$, "actionPropertyChanged", -function (a, b, c) { -if (javax.swing.AbstractAction.shouldReconfigure (c)) { -a.configurePropertiesFromAction (b); -} else { -a.actionPropertyChanged (b, c.getPropertyName ()); -}}, "javax.swing.JTextField,javax.swing.Action,java.beans.PropertyChangeEvent"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.JTextField, "NotifyAction", javax.swing.text.TextAction); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JTextField.NotifyAction, ["notify-field-accept"]); -}); -Clazz_overrideMethod (c$, "actionPerformed", -function (a) { -var b = this.getFocusedComponent (); -if (Clazz_instanceOf (b, javax.swing.JTextField)) { -var c = b; -c.postActionEvent (); -}}, "java.awt.event.ActionEvent"); -Clazz_overrideMethod (c$, "isEnabled", -function () { -var a = this.getFocusedComponent (); -if (Clazz_instanceOf (a, javax.swing.JTextField)) { -return (a).hasActionListener (); -}return false; -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"notifyAction", "notify-field-accept"); -c$.defaultActions = c$.prototype.defaultActions = Clazz_newArray (-1, [ new javax.swing.JTextField.NotifyAction ()]); -Clazz_defineStatics (c$, -"$uiClassID", "TextFieldUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.beans.PropertyChangeListener"], "javax.swing.ActionPropertyChangeListener", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.action = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "ActionPropertyChangeListener", null, java.beans.PropertyChangeListener); -Clazz_makeConstructor (c$, -function (c, a) { -this.setTarget (c); -this.action = a; -}, "~O,javax.swing.Action"); -Clazz_overrideMethod (c$, "propertyChange", -function (e) { -var target = this.getTarget (); -if (target == null) { -this.getAction ().removePropertyChangeListener (this); -} else { -this.actionPropertyChanged (target, this.getAction (), e); -}}, "java.beans.PropertyChangeEvent"); -Clazz_defineMethod (c$, "setTarget", - function (c) { -}, "~O"); -Clazz_defineMethod (c$, "getTarget", -function () { -return null; -}); -Clazz_defineMethod (c$, "getAction", -function () { -return this.action; -}); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.ChangeListener", null, function () { -Clazz_declareInterface (javax.swing.event, "ChangeListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (null, "javax.swing.ActionMap", ["java.util.HashMap", "javax.swing.ArrayTable"], function () { -c$ = Clazz_decorateAsClass (function () { -this.arrayTable = null; -this.parent = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "ActionMap"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setParent", -function (map) { -this.parent = map; -}, "javax.swing.ActionMap"); -Clazz_defineMethod (c$, "getParent", -function () { -return this.parent; -}); -Clazz_defineMethod (c$, "put", -function (key, action) { -if (key == null) { -return; -}if (action == null) { -this.remove (key); -} else { -if (this.arrayTable == null) { -this.arrayTable = new javax.swing.ArrayTable (); -}this.arrayTable.put (key, action); -}}, "~O,javax.swing.Action"); -Clazz_defineMethod (c$, "get", -function (key) { -var value = (this.arrayTable == null) ? null : this.arrayTable.get (key); -if (value == null) { -var parent = this.getParent (); -if (parent != null) { -return parent.get (key); -}}return value; -}, "~O"); -Clazz_defineMethod (c$, "remove", -function (key) { -if (this.arrayTable != null) { -this.arrayTable.remove (key); -}}, "~O"); -Clazz_defineMethod (c$, "clear", -function () { -if (this.arrayTable != null) { -this.arrayTable.clear (); -}}); -Clazz_defineMethod (c$, "keys", -function () { -if (this.arrayTable == null) { -return null; -}return this.arrayTable.getKeys (null); -}); -Clazz_defineMethod (c$, "size", -function () { -if (this.arrayTable == null) { -return 0; -}return this.arrayTable.size (); -}); -Clazz_defineMethod (c$, "allKeys", -function () { -var count = this.size (); -var parent = this.getParent (); -if (count == 0) { -if (parent != null) { -return parent.allKeys (); -}return this.keys (); -}if (parent == null) { -return this.keys (); -}var keys = this.keys (); -var pKeys = parent.allKeys (); -if (pKeys == null) { -return keys; -}if (keys == null) { -return pKeys; -}var keyMap = new java.util.HashMap (); -var counter; -for (counter = keys.length - 1; counter >= 0; counter--) { -keyMap.put (keys[counter], keys[counter]); -} -for (counter = pKeys.length - 1; counter >= 0; counter--) { -keyMap.put (pKeys[counter], pKeys[counter]); -} -return keyMap.keySet ().toArray (); -}); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (null, "javax.swing.InputMap", ["java.util.HashMap", "javax.swing.ArrayTable"], function () { -c$ = Clazz_decorateAsClass (function () { -this.arrayTable = null; -this.parent = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "InputMap"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "setParent", -function (map) { -this.parent = map; -}, "javax.swing.InputMap"); -Clazz_defineMethod (c$, "getParent", -function () { -return this.parent; -}); -Clazz_defineMethod (c$, "put", -function (keyStroke, actionMapKey) { -if (keyStroke == null) { -return; -}if (actionMapKey == null) { -this.remove (keyStroke); -} else { -if (this.arrayTable == null) { -this.arrayTable = new javax.swing.ArrayTable (); -}this.arrayTable.put (keyStroke, actionMapKey); -}}, "javax.swing.KeyStroke,~O"); -Clazz_defineMethod (c$, "get", -function (keyStroke) { -if (this.arrayTable == null) { -var parent = this.getParent (); -if (parent != null) { -return parent.get (keyStroke); -}return null; -}var value = this.arrayTable.get (keyStroke); -if (value == null) { -var parent = this.getParent (); -if (parent != null) { -return parent.get (keyStroke); -}}return value; -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "remove", -function (key) { -if (this.arrayTable != null) { -this.arrayTable.remove (key); -}}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "clear", -function () { -if (this.arrayTable != null) { -this.arrayTable.clear (); -}}); -Clazz_defineMethod (c$, "keys", -function () { -if (this.arrayTable == null) { -return null; -}var keys = new Array (this.arrayTable.size ()); -this.arrayTable.getKeys (keys); -return keys; -}); -Clazz_defineMethod (c$, "size", -function () { -if (this.arrayTable == null) { -return 0; -}return this.arrayTable.size (); -}); -Clazz_defineMethod (c$, "allKeys", -function () { -var count = this.size (); -var parent = this.getParent (); -if (count == 0) { -if (parent != null) { -return parent.allKeys (); -}return this.keys (); -}if (parent == null) { -return this.keys (); -}var keys = this.keys (); -var pKeys = parent.allKeys (); -if (pKeys == null) { -return keys; -}if (keys == null) { -return pKeys; -}var keyMap = new java.util.HashMap (); -var counter; -for (counter = keys.length - 1; counter >= 0; counter--) { -keyMap.put (keys[counter], keys[counter]); -} -for (counter = pKeys.length - 1; counter >= 0; counter--) { -keyMap.put (pKeys[counter], pKeys[counter]); -} -var allKeys = new Array (keyMap.size ()); -return keyMap.keySet ().toArray (allKeys); -}); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "Scrollable"); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventObject"], "javax.swing.event.CaretEvent", null, function () { -c$ = Clazz_declareType (javax.swing.event, "CaretEvent", java.util.EventObject); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.DocumentListener", null, function () { -Clazz_declareInterface (javax.swing.event, "DocumentListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (null, "javax.swing.event.EventListenerList", ["java.lang.reflect.Array"], function () { -c$ = Clazz_decorateAsClass (function () { -this.listenerList = null; -Clazz_instantialize (this, arguments); -}, javax.swing.event, "EventListenerList"); -Clazz_prepareFields (c$, function () { -this.listenerList = javax.swing.event.EventListenerList.NULL_ARRAY; -}); -Clazz_defineMethod (c$, "getListenerList", -function () { -return this.listenerList; -}); -Clazz_defineMethod (c$, "getListeners", -function (t) { -var lList = this.listenerList; -var n = this.getListenerCount (lList, t); -var result = java.lang.reflect.Array.newInstance (t, n); -var j = 0; -for (var i = lList.length - 2; i >= 0; i -= 2) { -if (lList[i] === t) { -result[j++] = lList[i + 1]; -}} -return result; -}, "Class"); -Clazz_defineMethod (c$, "getListenerCount", -function () { -return Clazz_doubleToInt (this.listenerList.length / 2); -}); -Clazz_defineMethod (c$, "getListenerCount", -function (t) { -var lList = this.listenerList; -return this.getListenerCount (lList, t); -}, "Class"); -Clazz_defineMethod (c$, "getListenerCount", - function (list, t) { -var count = 0; -for (var i = 0; i < list.length; i += 2) { -if (t === list[i]) count++; -} -return count; -}, "~A,Class"); -Clazz_defineMethod (c$, "add", -function (t, l) { -if (l == null) { -return; -}if (this.listenerList === javax.swing.event.EventListenerList.NULL_ARRAY) { -this.listenerList = Clazz_newArray (-1, [t, l]); -} else { -var i = this.listenerList.length; -var tmp = new Array (i + 2); -System.arraycopy (this.listenerList, 0, tmp, 0, i); -tmp[i] = t; -tmp[i + 1] = l; -this.listenerList = tmp; -}}, "Class,~O"); -Clazz_defineMethod (c$, "remove", -function (t, l) { -if (l == null) { -return; -}var index = -1; -for (var i = this.listenerList.length - 2; i >= 0; i -= 2) { -if ((this.listenerList[i] === t) && (this.listenerList[i + 1].equals (l) == true)) { -index = i; -break; -}} -if (index != -1) { -var tmp = new Array (this.listenerList.length - 2); -System.arraycopy (this.listenerList, 0, tmp, 0, index); -if (index < tmp.length) System.arraycopy (this.listenerList, index + 2, tmp, index, tmp.length - index); -this.listenerList = (tmp.length == 0) ? javax.swing.event.EventListenerList.NULL_ARRAY : tmp; -}}, "Class,~O"); -Clazz_overrideMethod (c$, "toString", -function () { -var lList = this.listenerList; -var s = "EventListenerList: "; -s += Clazz_doubleToInt (lList.length / 2) + " listeners: "; -for (var i = 0; i <= lList.length - 2; i += 2) { -s += " type " + (lList[i]).getName (); -s += " listener " + lList[i + 1]; -} -return s; -}); -c$.NULL_ARRAY = c$.prototype.NULL_ARRAY = new Array (0); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventObject"], "javax.swing.event.ChangeEvent", null, function () { -c$ = Clazz_declareType (javax.swing.event, "ChangeEvent", java.util.EventObject); -}); -Clazz_declarePackage ("jssun.swing"); -Clazz_load (["jssun.swing.UIClientPropertyKey"], "jssun.swing.StringUIClientPropertyKey", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.key = null; -Clazz_instantialize (this, arguments); -}, jssun.swing, "StringUIClientPropertyKey", null, jssun.swing.UIClientPropertyKey); -Clazz_makeConstructor (c$, -function (key) { -this.key = key; -}, "~S"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.key; -}); -}); -Clazz_declarePackage ("jssun.swing"); -Clazz_declareInterface (jssun.swing, "UIClientPropertyKey"); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.Graphics"], "java.awt.Graphics2D", null, function () { -c$ = Clazz_declareType (java.awt, "Graphics2D", java.awt.Graphics); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.Graphics2D, []); -}); -Clazz_overrideMethod (c$, "draw3DRect", -function (x, y, width, height, raised) { -var p = this.getPaint (); -var c = this.getColor (); -var brighter = c.brighter (); -var darker = c.darker (); -this.setColor (raised ? brighter : darker); -this.fillRect (x, y, 1, height + 1); -this.fillRect (x + 1, y, width - 1, 1); -this.setColor (raised ? darker : brighter); -this.fillRect (x + 1, y + height, width, 1); -this.fillRect (x + width, y, 1, height); -this.setPaint (p); -}, "~N,~N,~N,~N,~B"); -Clazz_overrideMethod (c$, "fill3DRect", -function (x, y, width, height, raised) { -var p = this.getPaint (); -var c = this.getColor (); -var brighter = c.brighter (); -var darker = c.darker (); -if (!raised) { -this.setColor (darker); -} else if (p !== c) { -this.setColor (c); -}this.fillRect (x + 1, y + 1, width - 2, height - 2); -this.setColor (raised ? brighter : darker); -this.fillRect (x, y, 1, height); -this.fillRect (x + 1, y, width - 2, 1); -this.setColor (raised ? darker : brighter); -this.fillRect (x + 1, y + height - 1, width - 1, 1); -this.fillRect (x + width - 1, y, 1, height - 1); -this.setPaint (p); -}, "~N,~N,~N,~N,~B"); -}); -Clazz_declarePackage ("java.awt"); -c$ = Clazz_declareType (java.awt, "Graphics"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "create", -function () { -return this.createSwingJS (); -}); -Clazz_defineMethod (c$, "create", -function (x, y, width, height) { -return this.create4 (x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "create4", -function (x, y, width, height) { -var g = this.createSwingJS (); -if (g == null) return null; -g.translate (x, y); -g.clipRect (0, 0, width, height); -return g; -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getFontMetrics", -function () { -return this.getFontMetrics (this.getFont ()); -}); -Clazz_defineMethod (c$, "drawRect", -function (x, y, width, height) { -if ((width < 0) || (height < 0)) { -return; -}if (height == 0 || width == 0) { -this.drawLine (x, y, x + width, y + height); -} else { -this.drawLine (x, y, x + width - 1, y); -this.drawLine (x + width, y, x + width, y + height - 1); -this.drawLine (x + width, y + height, x + 1, y + height); -this.drawLine (x, y + height, x, y + 1); -}}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "draw3DRect", -function (x, y, width, height, raised) { -var c = this.getColor (); -var brighter = c.brighter (); -var darker = c.darker (); -this.setColor (raised ? brighter : darker); -this.drawLine (x, y, x, y + height); -this.drawLine (x + 1, y, x + width - 1, y); -this.setColor (raised ? darker : brighter); -this.drawLine (x + 1, y + height, x + width, y + height); -this.drawLine (x + width, y, x + width, y + height - 1); -this.setColor (c); -}, "~N,~N,~N,~N,~B"); -Clazz_defineMethod (c$, "fill3DRect", -function (x, y, width, height, raised) { -var c = this.getColor (); -var brighter = c.brighter (); -var darker = c.darker (); -if (!raised) { -this.setColor (darker); -}this.fillRect (x + 1, y + 1, width - 2, height - 2); -this.setColor (raised ? brighter : darker); -this.drawLine (x, y, x, y + height - 1); -this.drawLine (x + 1, y, x + width - 2, y); -this.setColor (raised ? darker : brighter); -this.drawLine (x + 1, y + height - 1, x + width - 1, y + height - 1); -this.drawLine (x + width - 1, y, x + width - 1, y + height - 2); -this.setColor (c); -}, "~N,~N,~N,~N,~B"); -Clazz_defineMethod (c$, "drawPolygon", -function (p) { -this.drawPolygon (p.xpoints, p.ypoints, p.npoints); -}, "java.awt.Polygon"); -Clazz_defineMethod (c$, "fillPolygon", -function (p) { -this.fillPolygon (p.xpoints, p.ypoints, p.npoints); -}, "java.awt.Polygon"); -Clazz_defineMethod (c$, "drawChars", -function (data, offset, length, x, y) { -this.drawString ( String.instantialize (data, offset, length), x, y); -}, "~A,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "drawBytes", -function (data, offset, length, x, y) { -this.drawString ( String.instantialize (data, 0, offset, length), x, y); -}, "~A,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "finalize", -function () { -this.dispose (); -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[font=" + this.getFont () + ",color=" + this.getColor () + "]"; -}); -Clazz_defineMethod (c$, "getClipRect", -function () { -return this.getClipBounds (); -}); -Clazz_defineMethod (c$, "hitClip", -function (x, y, width, height) { -var clipRect = this.getClipBounds (); -if (clipRect == null) { -return true; -}return clipRect.intersects (x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_declarePackage ("jssun.font"); -Clazz_load (["java.awt.FontMetrics", "java.util.Hashtable"], "jssun.font.FontDesignMetrics", ["java.lang.IndexOutOfBoundsException", "java.awt.Toolkit", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.ascent = 0; -this.descent = 0; -this.leading = 0; -this.height = -1; -Clazz_instantialize (this, arguments); -}, jssun.font, "FontDesignMetrics", java.awt.FontMetrics); -c$.getMetrics = Clazz_defineMethod (c$, "getMetrics", -function (font) { -var m = null; -var r; -r = jssun.font.FontDesignMetrics.metricsCache.get (font); -if (r != null) { -m = r.get (); -}if (m == null) { -m = new jssun.font.FontDesignMetrics (font); -jssun.font.FontDesignMetrics.metricsCache.put (font, new jssun.font.FontDesignMetrics.KeyReference (font, m)); -}for (var i = 0; i < jssun.font.FontDesignMetrics.recentMetrics.length; i++) { -if (jssun.font.FontDesignMetrics.recentMetrics[i] === m) { -return m; -}} -{ -jssun.font.FontDesignMetrics.recentMetrics[jssun.font.FontDesignMetrics.recentIndex++] = m; -if (jssun.font.FontDesignMetrics.recentIndex == 5) { -jssun.font.FontDesignMetrics.recentIndex = 0; -}}return m; -}, "java.awt.Font"); -Clazz_makeConstructor (c$, - function (font) { -Clazz_superConstructor (this, jssun.font.FontDesignMetrics, [font]); -this.font = font; -this.initMatrixAndMetrics (); -}, "java.awt.Font"); -Clazz_defineMethod (c$, "initMatrixAndMetrics", - function () { -{ -//need to calculate ascent, descent, leading, and maxAdvance -}}); -Clazz_defineMethod (c$, "charWidth", -function (ch) { -var s = ""; -{ -s = "" + ch; -}return this.stringWidth (s); -}, "~S"); -Clazz_overrideMethod (c$, "stringWidth", -function (str) { -return Clazz_doubleToInt (0.5 + this.getWidth (str)); -}, "~S"); -Clazz_defineMethod (c$, "getWidth", - function (str) { -return swingjs.JSToolkit.getStringWidth (null, this.font, str); -}, "~S"); -Clazz_overrideMethod (c$, "charsWidth", -function (data, off, len) { -var width = 0; -if (len < 0) { -throw new IndexOutOfBoundsException ("len=" + len); -}var limit = off + len; -for (var i = off; i < limit; i++) { -var ch = data[i]; -width += this.stringWidth ("" + ch); -} -return Clazz_doubleToInt (0.5 + width); -}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "getWidths", -function () { -var widths = Clazz_newIntArray (256, 0); -return widths; -}); -Clazz_defineMethod (c$, "getAscent", -function () { -if (this.ascent == 0) this.ascent = java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (this.font).getAscent (); -return Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.ascent); -}); -Clazz_defineMethod (c$, "getDescent", -function () { -if (this.descent == 0) this.descent = java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (this.font).getDescent (); -return Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent); -}); -Clazz_overrideMethod (c$, "getLeading", -function () { -return Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent + this.leading) - Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent); -}); -Clazz_overrideMethod (c$, "getHeight", -function () { -if (this.height < 0) { -this.height = this.getAscent () + Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent + this.leading); -}return this.height; -}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.key = null; -this.val = null; -Clazz_instantialize (this, arguments); -}, jssun.font.FontDesignMetrics, "KeyReference"); -Clazz_makeConstructor (c$, -function (a, b) { -this.key = a; -this.val = b; -}, "~O,~O"); -Clazz_defineMethod (c$, "get", -function () { -return this.val; -}); -Clazz_defineMethod (c$, "dispose", -function () { -if (jssun.font.FontDesignMetrics.metricsCache.get (this.key) === this) { -jssun.font.FontDesignMetrics.metricsCache.remove (this.key); -}}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"roundingUpValue", 0.95); -c$.metricsCache = c$.prototype.metricsCache = new java.util.Hashtable (); -Clazz_defineStatics (c$, -"MAXRECENT", 5); -c$.recentMetrics = c$.prototype.recentMetrics = new Array (5); -Clazz_defineStatics (c$, -"recentIndex", 0); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.font.FontRenderContext"], "java.awt.FontMetrics", ["java.lang.Character"], function () { -c$ = Clazz_decorateAsClass (function () { -this.font = null; -Clazz_instantialize (this, arguments); -}, java.awt, "FontMetrics"); -Clazz_makeConstructor (c$, -function (font) { -this.font = font; -}, "java.awt.Font"); -Clazz_defineMethod (c$, "getFont", -function () { -return this.font; -}); -Clazz_defineMethod (c$, "getFontRenderContext", -function () { -return java.awt.FontMetrics.DEFAULT_FRC; -}); -Clazz_defineMethod (c$, "getLeading", -function () { -return 0; -}); -Clazz_defineMethod (c$, "getAscent", -function () { -return this.font.getSize (); -}); -Clazz_defineMethod (c$, "getDescent", -function () { -return 0; -}); -Clazz_defineMethod (c$, "getHeight", -function () { -return this.getLeading () + this.getAscent () + this.getDescent (); -}); -Clazz_defineMethod (c$, "getMaxAscent", -function () { -return this.getAscent (); -}); -Clazz_defineMethod (c$, "getMaxDescent", -function () { -return this.getDescent (); -}); -Clazz_defineMethod (c$, "getMaxDecent", -function () { -return this.getMaxDescent (); -}); -Clazz_defineMethod (c$, "getMaxAdvance", -function () { -return -1; -}); -Clazz_defineMethod (c$, "charWidth", -function (codePoint) { -if (!Character.isValidCodePoint (codePoint)) { -codePoint = 0xffff; -}if (codePoint < 256) { -return this.getWidths ()[codePoint]; -} else { -var buffer = Clazz_newCharArray (2, '\0'); -var len = Character.toChars (codePoint, buffer, 0); -return this.charsWidth (buffer, 0, len); -}}, "~N"); -Clazz_defineMethod (c$, "charWidth", -function (ch) { -if (ch.charCodeAt (0) < 256) { -return this.getWidths ()[ch.charCodeAt (0)]; -}var data = Clazz_newCharArray (-1, [ch]); -return this.charsWidth (data, 0, 1); -}, "~S"); -Clazz_defineMethod (c$, "stringWidth", -function (str) { -var len = str.length; -var data = Clazz_newCharArray (len, '\0'); -str.getChars (0, len, data, 0); -return this.charsWidth (data, 0, len); -}, "~S"); -Clazz_defineMethod (c$, "charsWidth", -function (data, off, len) { -return this.stringWidth ( String.instantialize (data, off, len)); -}, "~A,~N,~N"); -Clazz_defineMethod (c$, "bytesWidth", -function (data, off, len) { -return this.stringWidth ( String.instantialize (data, 0, off, len)); -}, "~A,~N,~N"); -Clazz_defineMethod (c$, "getWidths", -function () { -var widths = Clazz_newIntArray (256, 0); -for (var ch = String.fromCharCode (0); ch.charCodeAt (0) < 256; ch = String.fromCharCode (ch.charCodeAt (0) + 1)) { -widths[ch.charCodeAt (0)] = this.charWidth (ch); -} -return widths; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[font=" + this.getFont () + "ascent=" + this.getAscent () + ", descent=" + this.getDescent () + ", height=" + this.getHeight () + "]"; -}); -c$.DEFAULT_FRC = c$.prototype.DEFAULT_FRC = new java.awt.font.FontRenderContext (null, false, false); -}); -Clazz_declarePackage ("JU"); -Clazz_load (null, "JU.PT", ["java.lang.Boolean", "$.Double", "$.Float", "$.Number", "java.util.Map", "javajs.api.JSONEncodable", "JU.AU", "$.DF", "$.Lst", "$.M34", "$.M4", "$.SB"], function () { -c$ = Clazz_declareType (JU, "PT"); -c$.parseInt = Clazz_defineMethod (c$, "parseInt", -function (str) { -return JU.PT.parseIntNext (str, Clazz_newIntArray (-1, [0])); -}, "~S"); -c$.parseIntNext = Clazz_defineMethod (c$, "parseIntNext", -function (str, next) { -var cch = str.length; -if (next[0] < 0 || next[0] >= cch) return -2147483648; -return JU.PT.parseIntChecked (str, cch, next); -}, "~S,~A"); -c$.parseIntChecked = Clazz_defineMethod (c$, "parseIntChecked", -function (str, ichMax, next) { -var digitSeen = false; -var value = 0; -var ich = next[0]; -if (ich < 0) return -2147483648; -var ch; -while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; - -var negative = false; -if (ich < ichMax && str.charCodeAt (ich) == 45) { -negative = true; -++ich; -}while (ich < ichMax && (ch = str.charCodeAt (ich)) >= 48 && ch <= 57) { -value = value * 10 + (ch - 48); -digitSeen = true; -++ich; -} -if (!digitSeen) value = -2147483648; - else if (negative) value = -value; -next[0] = ich; -return value; -}, "~S,~N,~A"); -c$.isWhiteSpace = Clazz_defineMethod (c$, "isWhiteSpace", -function (str, ich) { -var ch; -return (ich >= 0 && ((ch = str.charAt (ich)) == ' ' || ch == '\t' || ch == '\n')); -}, "~S,~N"); -c$.parseFloatChecked = Clazz_defineMethod (c$, "parseFloatChecked", -function (str, ichMax, next, isStrict) { -var digitSeen = false; -var ich = next[0]; -if (isStrict && str.indexOf ('\n') != str.lastIndexOf ('\n')) return NaN; -while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; - -var negative = false; -if (ich < ichMax && str.charAt (ich) == '-') { -++ich; -negative = true; -}var ch = 0; -var ival = 0; -var ival2 = 0; -while (ich < ichMax && (ch = str.charCodeAt (ich)) >= 48 && ch <= 57) { -ival = (ival * 10) + (ch - 48) * 1; -++ich; -digitSeen = true; -} -var isDecimal = false; -var iscale = 0; -var nzero = (ival == 0 ? -1 : 0); -if (ch == 46) { -isDecimal = true; -while (++ich < ichMax && (ch = str.charCodeAt (ich)) >= 48 && ch <= 57) { -digitSeen = true; -if (nzero < 0) { -if (ch == 48) { -nzero--; -continue; -}nzero = -nzero; -}if (iscale < JU.PT.decimalScale.length) { -ival2 = (ival2 * 10) + (ch - 48) * 1; -iscale++; -}} -}var value; -if (!digitSeen) { -value = NaN; -} else if (ival2 > 0) { -value = ival2 * JU.PT.decimalScale[iscale - 1]; -if (nzero > 1) { -if (nzero - 2 < JU.PT.decimalScale.length) { -value *= JU.PT.decimalScale[nzero - 2]; -} else { -value *= Math.pow (10, 1 - nzero); -}} else { -value += ival; -}} else { -value = ival; -}var isExponent = false; -if (ich < ichMax && (ch == 69 || ch == 101 || ch == 68)) { -isExponent = true; -if (++ich >= ichMax) return NaN; -ch = str.charCodeAt (ich); -if ((ch == 43) && (++ich >= ichMax)) return NaN; -next[0] = ich; -var exponent = JU.PT.parseIntChecked (str, ichMax, next); -if (exponent == -2147483648) return NaN; -if (exponent > 0 && exponent <= JU.PT.tensScale.length) value *= JU.PT.tensScale[exponent - 1]; - else if (exponent < 0 && -exponent <= JU.PT.decimalScale.length) value *= JU.PT.decimalScale[-exponent - 1]; - else if (exponent != 0) value *= Math.pow (10, exponent); -} else { -next[0] = ich; -}if (negative) value = -value; -if (value == Infinity) value = 3.4028235E38; -return (!isStrict || (!isExponent || isDecimal) && JU.PT.checkTrailingText (str, next[0], ichMax) ? value : NaN); -}, "~S,~N,~A,~B"); -c$.checkTrailingText = Clazz_defineMethod (c$, "checkTrailingText", -function (str, ich, ichMax) { -var ch; -while (ich < ichMax && (JU.PT.isWhitespace (ch = str.charAt (ich)) || ch == ';')) ++ich; - -return (ich == ichMax); -}, "~S,~N,~N"); -c$.parseFloatArray = Clazz_defineMethod (c$, "parseFloatArray", -function (str) { -return JU.PT.parseFloatArrayNext (str, Clazz_newIntArray (1, 0), null, null, null); -}, "~S"); -c$.parseFloatArrayInfested = Clazz_defineMethod (c$, "parseFloatArrayInfested", -function (tokens, data) { -var len = data.length; -var nTokens = tokens.length; -var n = 0; -var max = 0; -for (var i = 0; i >= 0 && i < len && n < nTokens; i++) { -var f; -while (Float.isNaN (f = JU.PT.parseFloat (tokens[n++])) && n < nTokens) { -} -if (!Float.isNaN (f)) data[(max = i)] = f; -if (n == nTokens) break; -} -return max + 1; -}, "~A,~A"); -c$.parseFloatArrayNext = Clazz_defineMethod (c$, "parseFloatArrayNext", -function (str, next, f, strStart, strEnd) { -var n = 0; -var pt = next[0]; -if (pt >= 0) { -if (strStart != null) { -var p = str.indexOf (strStart, pt); -if (p >= 0) next[0] = p + strStart.length; -}str = str.substring (next[0]); -pt = (strEnd == null ? -1 : str.indexOf (strEnd)); -if (pt < 0) pt = str.length; - else str = str.substring (0, pt); -next[0] += pt + 1; -var tokens = JU.PT.getTokens (str); -if (f == null) f = Clazz_newFloatArray (tokens.length, 0); -n = JU.PT.parseFloatArrayInfested (tokens, f); -}if (f == null) return Clazz_newFloatArray (0, 0); -for (var i = n; i < f.length; i++) f[i] = NaN; - -return f; -}, "~S,~A,~A,~S,~S"); -c$.parseFloatRange = Clazz_defineMethod (c$, "parseFloatRange", -function (str, ichMax, next) { -var cch = str.length; -if (ichMax > cch) ichMax = cch; -if (next[0] < 0 || next[0] >= ichMax) return NaN; -return JU.PT.parseFloatChecked (str, ichMax, next, false); -}, "~S,~N,~A"); -c$.parseFloatNext = Clazz_defineMethod (c$, "parseFloatNext", -function (str, next) { -var cch = (str == null ? -1 : str.length); -return (next[0] < 0 || next[0] >= cch ? NaN : JU.PT.parseFloatChecked (str, cch, next, false)); -}, "~S,~A"); -c$.parseFloatStrict = Clazz_defineMethod (c$, "parseFloatStrict", -function (str) { -var cch = str.length; -if (cch == 0) return NaN; -return JU.PT.parseFloatChecked (str, cch, Clazz_newIntArray (-1, [0]), true); -}, "~S"); -c$.parseFloat = Clazz_defineMethod (c$, "parseFloat", -function (str) { -return JU.PT.parseFloatNext (str, Clazz_newIntArray (-1, [0])); -}, "~S"); -c$.parseIntRadix = Clazz_defineMethod (c$, "parseIntRadix", -function (s, i) { -{ -return Integer.parseIntRadix(s, i); -}}, "~S,~N"); -c$.getTokens = Clazz_defineMethod (c$, "getTokens", -function (line) { -return JU.PT.getTokensAt (line, 0); -}, "~S"); -c$.parseToken = Clazz_defineMethod (c$, "parseToken", -function (str) { -return JU.PT.parseTokenNext (str, Clazz_newIntArray (-1, [0])); -}, "~S"); -c$.parseTrimmed = Clazz_defineMethod (c$, "parseTrimmed", -function (str) { -return JU.PT.parseTrimmedRange (str, 0, str.length); -}, "~S"); -c$.parseTrimmedAt = Clazz_defineMethod (c$, "parseTrimmedAt", -function (str, ichStart) { -return JU.PT.parseTrimmedRange (str, ichStart, str.length); -}, "~S,~N"); -c$.parseTrimmedRange = Clazz_defineMethod (c$, "parseTrimmedRange", -function (str, ichStart, ichMax) { -var cch = str.length; -if (ichMax < cch) cch = ichMax; -if (cch < ichStart) return ""; -return JU.PT.parseTrimmedChecked (str, ichStart, cch); -}, "~S,~N,~N"); -c$.getTokensAt = Clazz_defineMethod (c$, "getTokensAt", -function (line, ich) { -if (line == null) return null; -var cchLine = line.length; -if (ich < 0 || ich > cchLine) return null; -var tokenCount = JU.PT.countTokens (line, ich); -var tokens = new Array (tokenCount); -var next = Clazz_newIntArray (1, 0); -next[0] = ich; -for (var i = 0; i < tokenCount; ++i) tokens[i] = JU.PT.parseTokenChecked (line, cchLine, next); - -return tokens; -}, "~S,~N"); -c$.countTokens = Clazz_defineMethod (c$, "countTokens", -function (line, ich) { -var tokenCount = 0; -if (line != null) { -var ichMax = line.length; -while (true) { -while (ich < ichMax && JU.PT.isWhiteSpace (line, ich)) ++ich; - -if (ich == ichMax) break; -++tokenCount; -do { -++ich; -} while (ich < ichMax && !JU.PT.isWhiteSpace (line, ich)); -} -}return tokenCount; -}, "~S,~N"); -c$.parseTokenNext = Clazz_defineMethod (c$, "parseTokenNext", -function (str, next) { -var cch = str.length; -return (next[0] < 0 || next[0] >= cch ? null : JU.PT.parseTokenChecked (str, cch, next)); -}, "~S,~A"); -c$.parseTokenRange = Clazz_defineMethod (c$, "parseTokenRange", -function (str, ichMax, next) { -var cch = str.length; -if (ichMax > cch) ichMax = cch; -return (next[0] < 0 || next[0] >= ichMax ? null : JU.PT.parseTokenChecked (str, ichMax, next)); -}, "~S,~N,~A"); -c$.parseTokenChecked = Clazz_defineMethod (c$, "parseTokenChecked", -function (str, ichMax, next) { -var ich = next[0]; -while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; - -var ichNonWhite = ich; -while (ich < ichMax && !JU.PT.isWhiteSpace (str, ich)) ++ich; - -next[0] = ich; -return (ichNonWhite == ich ? null : str.substring (ichNonWhite, ich)); -}, "~S,~N,~A"); -c$.parseTrimmedChecked = Clazz_defineMethod (c$, "parseTrimmedChecked", -function (str, ich, ichMax) { -while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; - -var ichLast = ichMax - 1; -while (ichLast >= ich && JU.PT.isWhiteSpace (str, ichLast)) --ichLast; - -return (ichLast < ich ? "" : str.substring (ich, ichLast + 1)); -}, "~S,~N,~N"); -c$.dVal = Clazz_defineMethod (c$, "dVal", -function (s) { -{ -if(s==null) -throw new NumberFormatException("null"); -var d=parseFloat(s); -if(isNaN(d)) -throw new NumberFormatException("Not a Number : "+s); -return d -}}, "~S"); -c$.fVal = Clazz_defineMethod (c$, "fVal", -function (s) { -{ -return this.dVal(s); -}}, "~S"); -c$.parseIntRange = Clazz_defineMethod (c$, "parseIntRange", -function (str, ichMax, next) { -var cch = str.length; -if (ichMax > cch) ichMax = cch; -return (next[0] < 0 || next[0] >= ichMax ? -2147483648 : JU.PT.parseIntChecked (str, ichMax, next)); -}, "~S,~N,~A"); -c$.parseFloatArrayData = Clazz_defineMethod (c$, "parseFloatArrayData", -function (tokens, data) { -JU.PT.parseFloatArrayDataN (tokens, data, data.length); -}, "~A,~A"); -c$.parseFloatArrayDataN = Clazz_defineMethod (c$, "parseFloatArrayDataN", -function (tokens, data, nData) { -for (var i = nData; --i >= 0; ) data[i] = (i >= tokens.length ? NaN : JU.PT.parseFloat (tokens[i])); - -}, "~A,~A,~N"); -c$.split = Clazz_defineMethod (c$, "split", -function (text, run) { -if (text.length == 0) return new Array (0); -var n = 1; -var i = text.indexOf (run); -var lines; -var runLen = run.length; -if (i < 0 || runLen == 0) { -lines = new Array (1); -lines[0] = text; -return lines; -}var len = text.length - runLen; -for (; i >= 0 && i < len; n++) i = text.indexOf (run, i + runLen); - -lines = new Array (n); -i = 0; -var ipt = 0; -var pt = 0; -for (; (ipt = text.indexOf (run, i)) >= 0 && pt + 1 < n; ) { -lines[pt++] = text.substring (i, ipt); -i = ipt + runLen; -} -if (text.indexOf (run, len) != len) len += runLen; -lines[pt] = text.substring (i, len); -return lines; -}, "~S,~S"); -c$.getQuotedStringAt = Clazz_defineMethod (c$, "getQuotedStringAt", -function (line, ipt0) { -var next = Clazz_newIntArray (-1, [ipt0]); -return JU.PT.getQuotedStringNext (line, next); -}, "~S,~N"); -c$.getQuotedStringNext = Clazz_defineMethod (c$, "getQuotedStringNext", -function (line, next) { -var i = next[0]; -if (i < 0 || (i = line.indexOf ("\"", i)) < 0) return ""; -var pt = i + 1; -var len = line.length; -while (++i < len && line.charAt (i) != '"') if (line.charAt (i) == '\\') i++; - -next[0] = i + 1; -return line.substring (pt, i); -}, "~S,~A"); -c$.getCSVString = Clazz_defineMethod (c$, "getCSVString", -function (line, next) { -var i = next[1]; -if (i < 0 || (i = line.indexOf ("\"", i)) < 0) return null; -var pt = next[0] = i; -var len = line.length; -var escaped = false; -var haveEscape = false; -while (++i < len && (line.charAt (i) != '"' || (escaped = (i + 1 < len && line.charAt (i + 1) == '"')))) if (escaped) { -escaped = false; -haveEscape = true; -i++; -} -if (i >= len) { -next[1] = -1; -return null; -}next[1] = i + 1; -var s = line.substring (pt + 1, i); -return (haveEscape ? JU.PT.rep (JU.PT.rep (s, "\"\"", "\0"), "\0", "\"") : s); -}, "~S,~A"); -c$.isOneOf = Clazz_defineMethod (c$, "isOneOf", -function (key, semiList) { -if (semiList.length == 0) return false; -if (semiList.charAt (0) != ';') semiList = ";" + semiList + ";"; -return key.indexOf (";") < 0 && semiList.indexOf (';' + key + ';') >= 0; -}, "~S,~S"); -c$.getQuotedAttribute = Clazz_defineMethod (c$, "getQuotedAttribute", -function (info, name) { -var i = info.indexOf (name + "="); -return (i < 0 ? null : JU.PT.getQuotedStringAt (info, i)); -}, "~S,~S"); -c$.approx = Clazz_defineMethod (c$, "approx", -function (f, n) { -return Math.round (f * n) / n; -}, "~N,~N"); -c$.rep = Clazz_defineMethod (c$, "rep", -function (str, strFrom, strTo) { -if (str == null || strFrom.length == 0 || str.indexOf (strFrom) < 0) return str; -var isOnce = (strTo.indexOf (strFrom) >= 0); -do { -str = str.$replace (strFrom, strTo); -} while (!isOnce && str.indexOf (strFrom) >= 0); -return str; -}, "~S,~S,~S"); -c$.formatF = Clazz_defineMethod (c$, "formatF", -function (value, width, precision, alignLeft, zeroPad) { -return JU.PT.formatS (JU.DF.formatDecimal (value, precision), width, 0, alignLeft, zeroPad); -}, "~N,~N,~N,~B,~B"); -c$.formatD = Clazz_defineMethod (c$, "formatD", -function (value, width, precision, alignLeft, zeroPad, allowOverflow) { -return JU.PT.formatS (JU.DF.formatDecimal (value, -1 - precision), width, 0, alignLeft, zeroPad); -}, "~N,~N,~N,~B,~B,~B"); -c$.formatS = Clazz_defineMethod (c$, "formatS", -function (value, width, precision, alignLeft, zeroPad) { -if (value == null) return ""; -var len = value.length; -if (precision != 2147483647 && precision > 0 && precision < len) value = value.substring (0, precision); - else if (precision < 0 && len + precision >= 0) value = value.substring (len + precision + 1); -var padLength = width - value.length; -if (padLength <= 0) return value; -var isNeg = (zeroPad && !alignLeft && value.charAt (0) == '-'); -var padChar = (zeroPad ? '0' : ' '); -var padChar0 = (isNeg ? '-' : padChar); -var sb = new JU.SB (); -if (alignLeft) sb.append (value); -sb.appendC (padChar0); -for (var i = padLength; --i > 0; ) sb.appendC (padChar); - -if (!alignLeft) sb.append (isNeg ? padChar + value.substring (1) : value); -return sb.toString (); -}, "~S,~N,~N,~B,~B"); -c$.replaceWithCharacter = Clazz_defineMethod (c$, "replaceWithCharacter", -function (str, strFrom, chTo) { -if (str == null) return null; -for (var i = strFrom.length; --i >= 0; ) str = str.$replace (strFrom.charAt (i), chTo); - -return str; -}, "~S,~S,~S"); -c$.replaceAllCharacters = Clazz_defineMethod (c$, "replaceAllCharacters", -function (str, strFrom, strTo) { -for (var i = strFrom.length; --i >= 0; ) { -var chFrom = strFrom.substring (i, i + 1); -str = JU.PT.rep (str, chFrom, strTo); -} -return str; -}, "~S,~S,~S"); -c$.trim = Clazz_defineMethod (c$, "trim", -function (str, chars) { -if (chars.length == 0) return str.trim (); -var len = str.length; -var k = 0; -while (k < len && chars.indexOf (str.charAt (k)) >= 0) k++; - -var m = str.length - 1; -while (m > k && chars.indexOf (str.charAt (m)) >= 0) m--; - -return str.substring (k, m + 1); -}, "~S,~S"); -c$.trimQuotes = Clazz_defineMethod (c$, "trimQuotes", -function (value) { -return (value != null && value.length > 1 && value.startsWith ("\"") && value.endsWith ("\"") ? value.substring (1, value.length - 1) : value); -}, "~S"); -c$.isNonStringPrimitive = Clazz_defineMethod (c$, "isNonStringPrimitive", -function (info) { -return Clazz_instanceOf (info, Number) || Clazz_instanceOf (info, Boolean); -}, "~O"); -c$.arrayGet = Clazz_defineMethod (c$, "arrayGet", - function (info, i) { -{ -return info[i]; -}}, "~O,~N"); -c$.toJSON = Clazz_defineMethod (c$, "toJSON", -function (infoType, info) { -if (info == null) return JU.PT.packageJSON (infoType, null); -if (JU.PT.isNonStringPrimitive (info)) return JU.PT.packageJSON (infoType, info.toString ()); -var s = null; -var sb = null; -while (true) { -if (Clazz_instanceOf (info, String)) { -s = info; -{ -if (typeof s == "undefined") s = "null" -}if (s.indexOf ("{\"") != 0) { -s = JU.PT.rep (s, "\"", "\\\""); -s = JU.PT.rep (s, "\n", "\\n"); -s = "\"" + s + "\""; -}break; -}if (Clazz_instanceOf (info, javajs.api.JSONEncodable)) { -if ((s = (info).toJSON ()) == null) s = "null"; -break; -}sb = new JU.SB (); -if (Clazz_instanceOf (info, java.util.Map)) { -sb.append ("{ "); -var sep = ""; -for (var key, $key = (info).keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) { -sb.append (sep).append (JU.PT.packageJSON (key, JU.PT.toJSON (null, (info).get (key)))); -sep = ","; -} -sb.append (" }"); -break; -}if (Clazz_instanceOf (info, JU.Lst)) { -sb.append ("[ "); -var n = (info).size (); -for (var i = 0; i < n; i++) { -if (i > 0) sb.appendC (','); -sb.append (JU.PT.toJSON (null, (info).get (i))); -} -sb.append (" ]"); -break; -}if (Clazz_instanceOf (info, JU.M34)) { -var len = (Clazz_instanceOf (info, JU.M4) ? 4 : 3); -var x = Clazz_newFloatArray (len, 0); -var m = info; -sb.appendC ('['); -for (var i = 0; i < len; i++) { -if (i > 0) sb.appendC (','); -m.getRow (i, x); -sb.append (JU.PT.toJSON (null, x)); -} -sb.appendC (']'); -break; -}s = JU.PT.nonArrayString (info); -if (s == null) { -sb.append ("["); -var n = JU.AU.getLength (info); -for (var i = 0; i < n; i++) { -if (i > 0) sb.appendC (','); -sb.append (JU.PT.toJSON (null, JU.PT.arrayGet (info, i))); -} -sb.append ("]"); -break; -}info = info.toString (); -} -return JU.PT.packageJSON (infoType, (s == null ? sb.toString () : s)); -}, "~S,~O"); -c$.nonArrayString = Clazz_defineMethod (c$, "nonArrayString", -function (x) { -{ -var s = x.toString(); return (s.startsWith("[object") && -s.endsWith("Array]") ? null : s); -}}, "~O"); -c$.byteArrayToJSON = Clazz_defineMethod (c$, "byteArrayToJSON", -function (data) { -var sb = new JU.SB (); -sb.append ("["); -var n = data.length; -for (var i = 0; i < n; i++) { -if (i > 0) sb.appendC (','); -sb.appendI (data[i] & 0xFF); -} -sb.append ("]"); -return sb.toString (); -}, "~A"); -c$.packageJSON = Clazz_defineMethod (c$, "packageJSON", -function (infoType, info) { -return (infoType == null ? info : "\"" + infoType + "\": " + info); -}, "~S,~S"); -c$.isAS = Clazz_defineMethod (c$, "isAS", -function (x) { -{ -return Clazz_isAS(x); -}}, "~O"); -c$.isASS = Clazz_defineMethod (c$, "isASS", -function (x) { -{ -return Clazz_isASS(x); -}}, "~O"); -c$.isAP = Clazz_defineMethod (c$, "isAP", -function (x) { -{ -return Clazz_isAP(x); -}}, "~O"); -c$.isAF = Clazz_defineMethod (c$, "isAF", -function (x) { -{ -return Clazz_isAF(x); -}}, "~O"); -c$.isAFloat = Clazz_defineMethod (c$, "isAFloat", -function (x) { -{ -return Clazz_isAFloat(x); -}}, "~O"); -c$.isAD = Clazz_defineMethod (c$, "isAD", -function (x) { -{ -return Clazz_isAF(x); -}}, "~O"); -c$.isADD = Clazz_defineMethod (c$, "isADD", -function (x) { -{ -return Clazz_isAFF(x); -}}, "~O"); -c$.isAB = Clazz_defineMethod (c$, "isAB", -function (x) { -{ -return Clazz_isAI(x); -}}, "~O"); -c$.isAI = Clazz_defineMethod (c$, "isAI", -function (x) { -{ -return Clazz_isAI(x); -}}, "~O"); -c$.isAII = Clazz_defineMethod (c$, "isAII", -function (x) { -{ -return Clazz_isAII(x); -}}, "~O"); -c$.isAFF = Clazz_defineMethod (c$, "isAFF", -function (x) { -{ -return Clazz_isAFF(x); -}}, "~O"); -c$.isAFFF = Clazz_defineMethod (c$, "isAFFF", -function (x) { -{ -return Clazz_isAFFF(x); -}}, "~O"); -c$.escapeUrl = Clazz_defineMethod (c$, "escapeUrl", -function (url) { -url = JU.PT.rep (url, "\n", ""); -url = JU.PT.rep (url, "%", "%25"); -url = JU.PT.rep (url, "#", "%23"); -url = JU.PT.rep (url, "[", "%5B"); -url = JU.PT.rep (url, "]", "%5D"); -url = JU.PT.rep (url, " ", "%20"); -return url; -}, "~S"); -c$.esc = Clazz_defineMethod (c$, "esc", -function (str) { -if (str == null || str.length == 0) return "\"\""; -var haveEscape = false; -var i = 0; -for (; i < "\\\\\tt\rr\nn\"\"".length; i += 2) if (str.indexOf ("\\\\\tt\rr\nn\"\"".charAt (i)) >= 0) { -haveEscape = true; -break; -} -if (haveEscape) while (i < "\\\\\tt\rr\nn\"\"".length) { -var pt = -1; -var ch = "\\\\\tt\rr\nn\"\"".charAt (i++); -var ch2 = "\\\\\tt\rr\nn\"\"".charAt (i++); -var sb = new JU.SB (); -var pt0 = 0; -while ((pt = str.indexOf (ch, pt + 1)) >= 0) { -sb.append (str.substring (pt0, pt)).appendC ('\\').appendC (ch2); -pt0 = pt + 1; -} -sb.append (str.substring (pt0, str.length)); -str = sb.toString (); -} -return "\"" + JU.PT.escUnicode (str) + "\""; -}, "~S"); -c$.escUnicode = Clazz_defineMethod (c$, "escUnicode", -function (str) { -for (var i = str.length; --i >= 0; ) if (str.charCodeAt (i) > 0x7F) { -var s = "0000" + Integer.toHexString (str.charCodeAt (i)); -str = str.substring (0, i) + "\\u" + s.substring (s.length - 4) + str.substring (i + 1); -} -return str; -}, "~S"); -c$.escF = Clazz_defineMethod (c$, "escF", -function (f) { -var sf = "" + f; -{ -if (sf.indexOf(".") < 0 && sf.indexOf("e") < 0) -sf += ".0"; -}return sf; -}, "~N"); -c$.join = Clazz_defineMethod (c$, "join", -function (s, c, i0) { -if (s.length < i0) return null; -var sb = new JU.SB (); -sb.append (s[i0++]); -for (var i = i0; i < s.length; i++) sb.appendC (c).append (s[i]); - -return sb.toString (); -}, "~A,~S,~N"); -c$.isLike = Clazz_defineMethod (c$, "isLike", -function (a, b) { -var areEqual = a.equals (b); -if (areEqual) return true; -var isStart = b.startsWith ("*"); -var isEnd = b.endsWith ("*"); -return (!isStart && !isEnd) ? areEqual : isStart && isEnd ? b.length == 1 || a.contains (b.substring (1, b.length - 1)) : isStart ? a.endsWith (b.substring (1)) : a.startsWith (b.substring (0, b.length - 1)); -}, "~S,~S"); -c$.getMapValueNoCase = Clazz_defineMethod (c$, "getMapValueNoCase", -function (h, key) { -if ("this".equals (key)) return h; -var val = h.get (key); -if (val == null) for (var e, $e = h.entrySet ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) if (e.getKey ().equalsIgnoreCase (key)) return e.getValue (); - -return val; -}, "java.util.Map,~S"); -c$.getMapSubset = Clazz_defineMethod (c$, "getMapSubset", -function (h, key, h2) { -var val = h.get (key); -if (val != null) { -h2.put (key, val); -return; -}for (var e, $e = h.entrySet ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) { -var k = e.getKey (); -if (JU.PT.isLike (k, key)) h2.put (k, e.getValue ()); -} -}, "java.util.Map,~S,java.util.Map"); -c$.clean = Clazz_defineMethod (c$, "clean", -function (s) { -return JU.PT.rep (JU.PT.replaceAllCharacters (s, " \t\n\r", " "), " ", " ").trim (); -}, "~S"); -c$.fdup = Clazz_defineMethod (c$, "fdup", -function (f, pt, n) { -var ch; -var count = 0; -for (var i = pt; --i >= 1; ) { -if (JU.PT.isDigit (ch = f.charAt (i))) continue; -switch (ch) { -case '.': -if (count++ != 0) return f; -continue; -case '-': -if (i != 1 && f.charAt (i - 1) != '.') return f; -continue; -default: -return f; -} -} -var s = f.substring (0, pt + 1); -var sb = new JU.SB (); -for (var i = 0; i < n; i++) sb.append (s); - -sb.append (f.substring (pt + 1)); -return sb.toString (); -}, "~S,~N,~N"); -c$.formatString = Clazz_defineMethod (c$, "formatString", -function (strFormat, key, strT, floatT, doubleT, doOne) { -if (strFormat == null) return null; -if ("".equals (strFormat)) return ""; -var len = key.length; -if (strFormat.indexOf ("%") < 0 || len == 0 || strFormat.indexOf (key) < 0) return strFormat; -var strLabel = ""; -var ich; -var ichPercent; -var ichKey; -for (ich = 0; (ichPercent = strFormat.indexOf ('%', ich)) >= 0 && (ichKey = strFormat.indexOf (key, ichPercent + 1)) >= 0; ) { -if (ich != ichPercent) strLabel += strFormat.substring (ich, ichPercent); -ich = ichPercent + 1; -if (ichKey > ichPercent + 6) { -strLabel += '%'; -continue; -}try { -var alignLeft = false; -if (strFormat.charAt (ich) == '-') { -alignLeft = true; -++ich; -}var zeroPad = false; -if (strFormat.charAt (ich) == '0') { -zeroPad = true; -++ich; -}var ch; -var width = 0; -while ((ch = strFormat.charAt (ich)) >= '0' && (ch <= '9')) { -width = (10 * width) + (ch.charCodeAt (0) - 48); -++ich; -} -var precision = 2147483647; -var isExponential = false; -if (strFormat.charAt (ich) == '.') { -++ich; -if ((ch = strFormat.charAt (ich)) == '-') { -isExponential = true; -++ich; -}if ((ch = strFormat.charAt (ich)) >= '0' && ch <= '9') { -precision = ch.charCodeAt (0) - 48; -++ich; -}if (isExponential) precision = -precision - (strT == null ? 1 : 0); -}var st = strFormat.substring (ich, ich + len); -if (!st.equals (key)) { -ich = ichPercent + 1; -strLabel += '%'; -continue; -}ich += len; -if (!Float.isNaN (floatT)) strLabel += JU.PT.formatF (floatT, width, precision, alignLeft, zeroPad); - else if (strT != null) strLabel += JU.PT.formatS (strT, width, precision, alignLeft, zeroPad); - else if (!Double.isNaN (doubleT)) strLabel += JU.PT.formatD (doubleT, width, precision, alignLeft, zeroPad, true); -if (doOne) break; -} catch (ioobe) { -if (Clazz_exceptionOf (ioobe, IndexOutOfBoundsException)) { -ich = ichPercent; -break; -} else { -throw ioobe; -} -} -} -strLabel += strFormat.substring (ich); -return strLabel; -}, "~S,~S,~S,~N,~N,~B"); -c$.formatStringS = Clazz_defineMethod (c$, "formatStringS", -function (strFormat, key, strT) { -return JU.PT.formatString (strFormat, key, strT, NaN, NaN, false); -}, "~S,~S,~S"); -c$.formatStringF = Clazz_defineMethod (c$, "formatStringF", -function (strFormat, key, floatT) { -return JU.PT.formatString (strFormat, key, null, floatT, NaN, false); -}, "~S,~S,~N"); -c$.formatStringI = Clazz_defineMethod (c$, "formatStringI", -function (strFormat, key, intT) { -return JU.PT.formatString (strFormat, key, "" + intT, NaN, NaN, false); -}, "~S,~S,~N"); -c$.sprintf = Clazz_defineMethod (c$, "sprintf", -function (strFormat, list, values) { -if (values == null) return strFormat; -var n = list.length; -if (n == values.length) try { -for (var o = 0; o < n; o++) { -if (values[o] == null) continue; -switch (list.charAt (o)) { -case 's': -strFormat = JU.PT.formatString (strFormat, "s", values[o], NaN, NaN, true); -break; -case 'f': -strFormat = JU.PT.formatString (strFormat, "f", null, (values[o]).floatValue (), NaN, true); -break; -case 'i': -strFormat = JU.PT.formatString (strFormat, "d", "" + values[o], NaN, NaN, true); -strFormat = JU.PT.formatString (strFormat, "i", "" + values[o], NaN, NaN, true); -break; -case 'd': -strFormat = JU.PT.formatString (strFormat, "e", null, NaN, (values[o]).doubleValue (), true); -break; -case 'p': -var pVal = values[o]; -strFormat = JU.PT.formatString (strFormat, "p", null, pVal.x, NaN, true); -strFormat = JU.PT.formatString (strFormat, "p", null, pVal.y, NaN, true); -strFormat = JU.PT.formatString (strFormat, "p", null, pVal.z, NaN, true); -break; -case 'q': -var qVal = values[o]; -strFormat = JU.PT.formatString (strFormat, "q", null, qVal.x, NaN, true); -strFormat = JU.PT.formatString (strFormat, "q", null, qVal.y, NaN, true); -strFormat = JU.PT.formatString (strFormat, "q", null, qVal.z, NaN, true); -strFormat = JU.PT.formatString (strFormat, "q", null, qVal.w, NaN, true); -break; -case 'S': -var sVal = values[o]; -for (var i = 0; i < sVal.length; i++) strFormat = JU.PT.formatString (strFormat, "s", sVal[i], NaN, NaN, true); - -break; -case 'F': -var fVal = values[o]; -for (var i = 0; i < fVal.length; i++) strFormat = JU.PT.formatString (strFormat, "f", null, fVal[i], NaN, true); - -break; -case 'I': -var iVal = values[o]; -for (var i = 0; i < iVal.length; i++) strFormat = JU.PT.formatString (strFormat, "d", "" + iVal[i], NaN, NaN, true); - -for (var i = 0; i < iVal.length; i++) strFormat = JU.PT.formatString (strFormat, "i", "" + iVal[i], NaN, NaN, true); - -break; -case 'D': -var dVal = values[o]; -for (var i = 0; i < dVal.length; i++) strFormat = JU.PT.formatString (strFormat, "e", null, NaN, dVal[i], true); - -} -} -return JU.PT.rep (strFormat, "%%", "%"); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -} else { -throw e; -} -} -System.out.println ("TextFormat.sprintf error " + list + " " + strFormat); -return JU.PT.rep (strFormat, "%", "?"); -}, "~S,~S,~A"); -c$.formatCheck = Clazz_defineMethod (c$, "formatCheck", -function (strFormat) { -if (strFormat == null || strFormat.indexOf ('p') < 0 && strFormat.indexOf ('q') < 0) return strFormat; -strFormat = JU.PT.rep (strFormat, "%%", "\1"); -strFormat = JU.PT.rep (strFormat, "%p", "%6.2p"); -strFormat = JU.PT.rep (strFormat, "%q", "%6.2q"); -var format = JU.PT.split (strFormat, "%"); -var sb = new JU.SB (); -sb.append (format[0]); -for (var i = 1; i < format.length; i++) { -var f = "%" + format[i]; -var pt; -if (f.length >= 3) { -if ((pt = f.indexOf ('p')) >= 0) f = JU.PT.fdup (f, pt, 3); -if ((pt = f.indexOf ('q')) >= 0) f = JU.PT.fdup (f, pt, 4); -}sb.append (f); -} -return sb.toString ().$replace ('\1', '%'); -}, "~S"); -c$.leftJustify = Clazz_defineMethod (c$, "leftJustify", -function (s, s1, s2) { -s.append (s2); -var n = s1.length - s2.length; -if (n > 0) s.append (s1.substring (0, n)); -}, "JU.SB,~S,~S"); -c$.rightJustify = Clazz_defineMethod (c$, "rightJustify", -function (s, s1, s2) { -var n = s1.length - s2.length; -if (n > 0) s.append (s1.substring (0, n)); -s.append (s2); -}, "JU.SB,~S,~S"); -c$.safeTruncate = Clazz_defineMethod (c$, "safeTruncate", -function (f, n) { -if (f > -0.001 && f < 0.001) f = 0; -return (f + " ").substring (0, n); -}, "~N,~N"); -c$.isWild = Clazz_defineMethod (c$, "isWild", -function (s) { -return s != null && (s.indexOf ("*") >= 0 || s.indexOf ("?") >= 0); -}, "~S"); -c$.isMatch = Clazz_defineMethod (c$, "isMatch", -function (search, match, checkStar, allowInitialStar) { -if (search.equals (match)) return true; -var mLen = match.length; -if (mLen == 0) return false; -var isStar0 = (checkStar && allowInitialStar ? match.charAt (0) == '*' : false); -if (mLen == 1 && isStar0) return true; -var isStar1 = (checkStar && match.endsWith ("*")); -var haveQ = (match.indexOf ('?') >= 0); -if (!haveQ) { -if (isStar0) return (isStar1 ? (mLen < 3 || search.indexOf (match.substring (1, mLen - 1)) >= 0) : search.endsWith (match.substring (1))); - else if (isStar1) return search.startsWith (match.substring (0, mLen - 1)); -}var sLen = search.length; -var qqqq = "????"; -var nq = 4; -while (nq < sLen) { -qqqq += qqqq; -nq += 4; -} -if (checkStar) { -if (isStar0) { -match = qqqq + match.substring (1); -mLen += nq - 1; -}if (isStar1) { -match = match.substring (0, mLen - 1) + qqqq; -mLen += nq - 1; -}}if (mLen < sLen) return false; -var ich = 0; -while (mLen > sLen) { -if (allowInitialStar && match.charAt (ich) == '?') { -++ich; -} else if (match.charAt (ich + mLen - 1) != '?') { -return false; -}--mLen; -} -for (var i = sLen; --i >= 0; ) { -var chm = match.charAt (ich + i); -if (chm == '?') continue; -var chs = search.charAt (i); -if (chm != chs && (chm != '\1' || chs != '?')) return false; -} -return true; -}, "~S,~S,~B,~B"); -c$.replaceQuotedStrings = Clazz_defineMethod (c$, "replaceQuotedStrings", -function (s, list, newList) { -var n = list.size (); -for (var i = 0; i < n; i++) { -var name = list.get (i); -var newName = newList.get (i); -if (!newName.equals (name)) s = JU.PT.rep (s, "\"" + name + "\"", "\"" + newName + "\""); -} -return s; -}, "~S,JU.Lst,JU.Lst"); -c$.replaceStrings = Clazz_defineMethod (c$, "replaceStrings", -function (s, list, newList) { -var n = list.size (); -for (var i = 0; i < n; i++) { -var name = list.get (i); -var newName = newList.get (i); -if (!newName.equals (name)) s = JU.PT.rep (s, name, newName); -} -return s; -}, "~S,JU.Lst,JU.Lst"); -c$.isDigit = Clazz_defineMethod (c$, "isDigit", -function (ch) { -var c = (ch).charCodeAt (0); -return (48 <= c && c <= 57); -}, "~S"); -c$.isUpperCase = Clazz_defineMethod (c$, "isUpperCase", -function (ch) { -var c = (ch).charCodeAt (0); -return (65 <= c && c <= 90); -}, "~S"); -c$.isLowerCase = Clazz_defineMethod (c$, "isLowerCase", -function (ch) { -var c = (ch).charCodeAt (0); -return (97 <= c && c <= 122); -}, "~S"); -c$.isLetter = Clazz_defineMethod (c$, "isLetter", -function (ch) { -var c = (ch).charCodeAt (0); -return (65 <= c && c <= 90 || 97 <= c && c <= 122); -}, "~S"); -c$.isLetterOrDigit = Clazz_defineMethod (c$, "isLetterOrDigit", -function (ch) { -var c = (ch).charCodeAt (0); -return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57); -}, "~S"); -c$.isWhitespace = Clazz_defineMethod (c$, "isWhitespace", -function (ch) { -var c = (ch).charCodeAt (0); -return (c >= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd); -}, "~S"); -c$.fixPtFloats = Clazz_defineMethod (c$, "fixPtFloats", -function (pt, f) { -pt.x = Math.round (pt.x * f) / f; -pt.y = Math.round (pt.y * f) / f; -pt.z = Math.round (pt.z * f) / f; -}, "JU.T3,~N"); -c$.fixDouble = Clazz_defineMethod (c$, "fixDouble", -function (d, f) { -return Math.round (d * f) / f; -}, "~N,~N"); -c$.parseFloatFraction = Clazz_defineMethod (c$, "parseFloatFraction", -function (s) { -var pt = s.indexOf ("/"); -return (pt < 0 ? JU.PT.parseFloat (s) : JU.PT.parseFloat (s.substring (0, pt)) / JU.PT.parseFloat (s.substring (pt + 1))); -}, "~S"); -Clazz_defineStatics (c$, -"tensScale", Clazz_newFloatArray (-1, [10, 100, 1000, 10000, 100000, 1000000]), -"decimalScale", Clazz_newFloatArray (-1, [0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001, 0.00000001, 0.000000001]), -"FLOAT_MIN_SAFE", 2E-45, -"escapable", "\\\\\tt\rr\nn\"\"", -"FRACTIONAL_PRECISION", 100000, -"CARTESIAN_PRECISION", 10000); -}); -Clazz_declarePackage ("javajs.api"); -Clazz_declareInterface (javajs.api, "JSONEncodable"); -Clazz_declarePackage ("JU"); -Clazz_load (null, "JU.AU", ["java.util.Arrays", "JU.Lst"], function () { -c$ = Clazz_declareType (JU, "AU"); -c$.ensureLength = Clazz_defineMethod (c$, "ensureLength", -function (array, minimumLength) { -if (array != null && JU.AU.getLength (array) >= minimumLength) return array; -return JU.AU.arrayCopyObject (array, minimumLength); -}, "~O,~N"); -c$.ensureLengthS = Clazz_defineMethod (c$, "ensureLengthS", -function (array, minimumLength) { -if (array != null && array.length >= minimumLength) return array; -return JU.AU.arrayCopyS (array, minimumLength); -}, "~A,~N"); -c$.ensureLengthA = Clazz_defineMethod (c$, "ensureLengthA", -function (array, minimumLength) { -if (array != null && array.length >= minimumLength) return array; -return JU.AU.arrayCopyF (array, minimumLength); -}, "~A,~N"); -c$.ensureLengthI = Clazz_defineMethod (c$, "ensureLengthI", -function (array, minimumLength) { -if (array != null && array.length >= minimumLength) return array; -return JU.AU.arrayCopyI (array, minimumLength); -}, "~A,~N"); -c$.ensureLengthShort = Clazz_defineMethod (c$, "ensureLengthShort", -function (array, minimumLength) { -if (array != null && array.length >= minimumLength) return array; -return JU.AU.arrayCopyShort (array, minimumLength); -}, "~A,~N"); -c$.ensureLengthByte = Clazz_defineMethod (c$, "ensureLengthByte", -function (array, minimumLength) { -if (array != null && array.length >= minimumLength) return array; -return JU.AU.arrayCopyByte (array, minimumLength); -}, "~A,~N"); -c$.doubleLength = Clazz_defineMethod (c$, "doubleLength", -function (array) { -return JU.AU.arrayCopyObject (array, (array == null ? 16 : 2 * JU.AU.getLength (array))); -}, "~O"); -c$.doubleLengthS = Clazz_defineMethod (c$, "doubleLengthS", -function (array) { -return JU.AU.arrayCopyS (array, (array == null ? 16 : 2 * array.length)); -}, "~A"); -c$.doubleLengthF = Clazz_defineMethod (c$, "doubleLengthF", -function (array) { -return JU.AU.arrayCopyF (array, (array == null ? 16 : 2 * array.length)); -}, "~A"); -c$.doubleLengthI = Clazz_defineMethod (c$, "doubleLengthI", -function (array) { -return JU.AU.arrayCopyI (array, (array == null ? 16 : 2 * array.length)); -}, "~A"); -c$.doubleLengthShort = Clazz_defineMethod (c$, "doubleLengthShort", -function (array) { -return JU.AU.arrayCopyShort (array, (array == null ? 16 : 2 * array.length)); -}, "~A"); -c$.doubleLengthByte = Clazz_defineMethod (c$, "doubleLengthByte", -function (array) { -return JU.AU.arrayCopyByte (array, (array == null ? 16 : 2 * array.length)); -}, "~A"); -c$.doubleLengthBool = Clazz_defineMethod (c$, "doubleLengthBool", -function (array) { -return JU.AU.arrayCopyBool (array, (array == null ? 16 : 2 * array.length)); -}, "~A"); -c$.deleteElements = Clazz_defineMethod (c$, "deleteElements", -function (array, firstElement, nElements) { -if (nElements == 0 || array == null) return array; -var oldLength = JU.AU.getLength (array); -if (firstElement >= oldLength) return array; -var n = oldLength - (firstElement + nElements); -if (n < 0) n = 0; -var t = JU.AU.newInstanceO (array, firstElement + n); -if (firstElement > 0) System.arraycopy (array, 0, t, 0, firstElement); -if (n > 0) System.arraycopy (array, firstElement + nElements, t, firstElement, n); -return t; -}, "~O,~N,~N"); -c$.arrayCopyObject = Clazz_defineMethod (c$, "arrayCopyObject", -function (array, newLength) { -if (array == null) { -return null; -}var oldLength = JU.AU.getLength (array); -if (newLength == oldLength) return array; -var t = JU.AU.newInstanceO (array, newLength); -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -return t; -}, "~O,~N"); -c$.newInstanceO = Clazz_defineMethod (c$, "newInstanceO", - function (array, n) { -{ -if (!array.getClass().getComponentType) -return new Array(n); -}}, "~O,~N"); -c$.getLength = Clazz_defineMethod (c$, "getLength", -function (array) { -{ -return array.length -}}, "~O"); -c$.arrayCopyS = Clazz_defineMethod (c$, "arrayCopyS", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = new Array (newLength); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyII = Clazz_defineMethod (c$, "arrayCopyII", -function (array, newLength) { -var t = JU.AU.newInt2 (newLength); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyPt = Clazz_defineMethod (c$, "arrayCopyPt", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = new Array (newLength); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyF = Clazz_defineMethod (c$, "arrayCopyF", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = Clazz_newFloatArray (newLength, 0); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyI = Clazz_defineMethod (c$, "arrayCopyI", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = Clazz_newIntArray (newLength, 0); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyRangeI = Clazz_defineMethod (c$, "arrayCopyRangeI", -function (array, i0, n) { -if (array == null) return null; -var oldLength = array.length; -if (n == -1) n = oldLength; -if (n == -2) n = Clazz_doubleToInt (oldLength / 2); -n = n - i0; -var t = Clazz_newIntArray (n, 0); -System.arraycopy (array, i0, t, 0, n); -return t; -}, "~A,~N,~N"); -c$.arrayCopyRangeRevI = Clazz_defineMethod (c$, "arrayCopyRangeRevI", -function (array, i0, n) { -if (array == null) return null; -var t = JU.AU.arrayCopyRangeI (array, i0, n); -if (n < 0) n = array.length; -for (var i = Clazz_doubleToInt (n / 2); --i >= 0; ) JU.AU.swapInt (t, i, n - 1 - i); - -return t; -}, "~A,~N,~N"); -c$.arrayCopyShort = Clazz_defineMethod (c$, "arrayCopyShort", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = Clazz_newShortArray (newLength, 0); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyByte = Clazz_defineMethod (c$, "arrayCopyByte", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = Clazz_newByteArray (newLength, 0); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.arrayCopyBool = Clazz_defineMethod (c$, "arrayCopyBool", -function (array, newLength) { -if (newLength < 0) newLength = array.length; -var t = Clazz_newBooleanArray (newLength, false); -if (array != null) { -var oldLength = array.length; -System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); -}return t; -}, "~A,~N"); -c$.swapInt = Clazz_defineMethod (c$, "swapInt", -function (array, indexA, indexB) { -var t = array[indexA]; -array[indexA] = array[indexB]; -array[indexB] = t; -}, "~A,~N,~N"); -c$.dumpArray = Clazz_defineMethod (c$, "dumpArray", -function (msg, A, x1, x2, y1, y2) { -var s = "dumpArray: " + msg + "\n"; -for (var x = x1; x <= x2; x++) s += "\t*" + x + "*"; - -for (var y = y2; y >= y1; y--) { -s += "\n*" + y + "*"; -for (var x = x1; x <= x2; x++) s += "\t" + (x < A.length && y < A[x].length ? A[x][y] : NaN); - -} -return s; -}, "~S,~A,~N,~N,~N,~N"); -c$.dumpIntArray = Clazz_defineMethod (c$, "dumpIntArray", -function (A, n) { -var str = ""; -for (var i = 0; i < n; i++) str += " " + A[i]; - -return str; -}, "~A,~N"); -c$.sortedItem = Clazz_defineMethod (c$, "sortedItem", -function (v, n) { -if (v.size () == 0) return null; -if (v.size () == 1) return v.get (0); -var keys = v.toArray ( new Array (v.size ())); -java.util.Arrays.sort (keys); -return keys[n % keys.length]; -}, "JU.Lst,~N"); -c$.createArrayOfArrayList = Clazz_defineMethod (c$, "createArrayOfArrayList", -function (size) { -return new Array (size); -}, "~N"); -c$.createArrayOfHashtable = Clazz_defineMethod (c$, "createArrayOfHashtable", -function (size) { -return new Array (size); -}, "~N"); -c$.swap = Clazz_defineMethod (c$, "swap", -function (o, i, j) { -var oi = o[i]; -o[i] = o[j]; -o[j] = oi; -}, "~A,~N,~N"); -c$.newFloat2 = Clazz_defineMethod (c$, "newFloat2", -function (n) { -{ -return Clazz_newArray(n, null); -}}, "~N"); -c$.newInt2 = Clazz_defineMethod (c$, "newInt2", -function (n) { -{ -return Clazz_newArray(n, null); -}}, "~N"); -c$.newInt3 = Clazz_defineMethod (c$, "newInt3", -function (nx, ny) { -{ -return Clazz_newArray(nx, null); -}}, "~N,~N"); -c$.newFloat3 = Clazz_defineMethod (c$, "newFloat3", -function (nx, ny) { -{ -return Clazz_newArray(nx, null); -}}, "~N,~N"); -c$.newInt4 = Clazz_defineMethod (c$, "newInt4", -function (n) { -{ -return Clazz_newArray(n, null); -}}, "~N"); -c$.newShort2 = Clazz_defineMethod (c$, "newShort2", -function (n) { -{ -return Clazz_newArray(n, null); -}}, "~N"); -c$.newByte2 = Clazz_defineMethod (c$, "newByte2", -function (n) { -{ -return Clazz_newArray(n, null); -}}, "~N"); -c$.newDouble2 = Clazz_defineMethod (c$, "newDouble2", -function (n) { -{ -return Clazz_newArray(n, null); -}}, "~N"); -c$.removeMapKeys = Clazz_defineMethod (c$, "removeMapKeys", -function (map, root) { -var list = new JU.Lst (); -for (var key, $key = map.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) if (key.startsWith (root)) list.addLast (key); - -for (var i = list.size (); --i >= 0; ) map.remove (list.get (i)); - -return list.size (); -}, "java.util.Map,~S"); -c$.isAS = Clazz_defineMethod (c$, "isAS", -function (x) { -{ -return Clazz_isAS(x); -}}, "~O"); -c$.isASS = Clazz_defineMethod (c$, "isASS", -function (x) { -{ -return Clazz_isASS(x); -}}, "~O"); -c$.isAP = Clazz_defineMethod (c$, "isAP", -function (x) { -{ -return Clazz_isAP(x); -}}, "~O"); -c$.isAF = Clazz_defineMethod (c$, "isAF", -function (x) { -{ -return Clazz_isAF(x); -}}, "~O"); -c$.isAFloat = Clazz_defineMethod (c$, "isAFloat", -function (x) { -{ -return Clazz_isAFloat(x); -}}, "~O"); -c$.isAD = Clazz_defineMethod (c$, "isAD", -function (x) { -{ -return Clazz_isAF(x); -}}, "~O"); -c$.isADD = Clazz_defineMethod (c$, "isADD", -function (x) { -{ -return Clazz_isAFF(x); -}}, "~O"); -c$.isAB = Clazz_defineMethod (c$, "isAB", -function (x) { -{ -return Clazz_isAI(x); -}}, "~O"); -c$.isAI = Clazz_defineMethod (c$, "isAI", -function (x) { -{ -return Clazz_isAI(x); -}}, "~O"); -c$.isAII = Clazz_defineMethod (c$, "isAII", -function (x) { -{ -return Clazz_isAII(x); -}}, "~O"); -c$.isAFF = Clazz_defineMethod (c$, "isAFF", -function (x) { -{ -return Clazz_isAFF(x); -}}, "~O"); -c$.isAFFF = Clazz_defineMethod (c$, "isAFFF", -function (x) { -{ -return Clazz_isAFFF(x); -}}, "~O"); -c$.ensureSignedBytes = Clazz_defineMethod (c$, "ensureSignedBytes", -function (b) { -if (b != null) { -{ -for (var i = b.length; --i >= 0;) { var j = b[i] & 0xFF; if -(j >= 0x80) j -= 0x100; b[i] = j; } -}}return b; -}, "~A"); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["java.util.ArrayList"], "JU.Lst", null, function () { -c$ = Clazz_declareType (JU, "Lst", java.util.ArrayList); -Clazz_defineMethod (c$, "addLast", -function (v) { -{ -return this.add1(v); -}}, "~O"); -Clazz_defineMethod (c$, "removeObj", -function (v) { -{ -return this.removeObject(v); -}}, "~O"); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["java.lang.Boolean"], "JU.DF", ["java.lang.Double", "$.Float", "JU.PT", "$.SB"], function () { -c$ = Clazz_declareType (JU, "DF"); -c$.setUseNumberLocalization = Clazz_defineMethod (c$, "setUseNumberLocalization", -function (TF) { -JU.DF.useNumberLocalization[0] = (TF ? Boolean.TRUE : Boolean.FALSE); -}, "~B"); -c$.formatDecimalDbl = Clazz_defineMethod (c$, "formatDecimalDbl", -function (value, decimalDigits) { -if (decimalDigits == 2147483647 || value == -Infinity || value == Infinity || Double.isNaN (value)) return "" + value; -return JU.DF.formatDecimal (value, decimalDigits); -}, "~N,~N"); -c$.formatDecimal = Clazz_defineMethod (c$, "formatDecimal", -function (value, decimalDigits) { -if (decimalDigits == 2147483647 || value == -Infinity || value == Infinity || Float.isNaN (value)) return "" + value; -var n; -if (decimalDigits < 0) { -decimalDigits = -decimalDigits; -if (decimalDigits > JU.DF.formattingStrings.length) decimalDigits = JU.DF.formattingStrings.length; -if (value == 0) return JU.DF.formattingStrings[decimalDigits] + "E+0"; -n = 0; -var d; -if (Math.abs (value) < 1) { -n = 10; -d = value * 1e-10; -} else { -n = -10; -d = value * 1e10; -}var s = ("" + d).toUpperCase (); -var i = s.indexOf ("E"); -n = JU.PT.parseInt (s.substring (i + 1)) + n; -return (i < 0 ? "" + value : JU.DF.formatDecimal (JU.PT.parseFloat (s.substring (0, i)), decimalDigits - 1) + "E" + (n >= 0 ? "+" : "") + n); -}if (decimalDigits >= JU.DF.formattingStrings.length) decimalDigits = JU.DF.formattingStrings.length - 1; -var s1 = ("" + value).toUpperCase (); -var pt = s1.indexOf ("."); -if (pt < 0) return s1 + JU.DF.formattingStrings[decimalDigits].substring (1); -var isNeg = s1.startsWith ("-"); -if (isNeg) { -s1 = s1.substring (1); -pt--; -}var pt1 = s1.indexOf ("E-"); -if (pt1 > 0) { -n = JU.PT.parseInt (s1.substring (pt1 + 1)); -s1 = "0." + "0000000000000000000000000000000000000000".substring (0, -n - 1) + s1.substring (0, 1) + s1.substring (2, pt1); -pt = 1; -}pt1 = s1.indexOf ("E"); -if (pt1 > 0) { -n = JU.PT.parseInt (s1.substring (pt1 + 1)); -s1 = s1.substring (0, 1) + s1.substring (2, pt1) + "0000000000000000000000000000000000000000"; -s1 = s1.substring (0, n + 1) + "." + s1.substring (n + 1); -pt = s1.indexOf ("."); -}var len = s1.length; -var pt2 = decimalDigits + pt + 1; -if (pt2 < len && s1.charAt (pt2) >= '5') { -return JU.DF.formatDecimal (value + (isNeg ? -1 : 1) * JU.DF.formatAdds[decimalDigits], decimalDigits); -}var sb = JU.SB.newS (s1.substring (0, (decimalDigits == 0 ? pt : ++pt))); -for (var i = 0; i < decimalDigits; i++, pt++) { -if (pt < len) sb.appendC (s1.charAt (pt)); - else sb.appendC ('0'); -} -s1 = (isNeg ? "-" : "") + sb; -return (Boolean.TRUE.equals (JU.DF.useNumberLocalization[0]) ? s1 : s1.$replace (',', '.')); -}, "~N,~N"); -c$.formatDecimalTrimmed = Clazz_defineMethod (c$, "formatDecimalTrimmed", -function (x, precision) { -var str = JU.DF.formatDecimalDbl (x, precision); -var m = str.length - 1; -var zero = '0'; -while (m >= 0 && str.charAt (m) == zero) m--; - -return str.substring (0, m + 1); -}, "~N,~N"); -Clazz_defineStatics (c$, -"formattingStrings", Clazz_newArray (-1, ["0", "0.0", "0.00", "0.000", "0.0000", "0.00000", "0.000000", "0.0000000", "0.00000000", "0.000000000"]), -"zeros", "0000000000000000000000000000000000000000", -"formatAdds", Clazz_newFloatArray (-1, [0.5, 0.05, 0.005, 0.0005, 0.00005, 0.000005, 0.0000005, 0.00000005, 0.000000005, 0.0000000005])); -c$.useNumberLocalization = c$.prototype.useNumberLocalization = Clazz_newArray (-1, [Boolean.TRUE]); -}); -Clazz_declarePackage ("JU"); -c$ = Clazz_decorateAsClass (function () { -this.sb = null; -this.s = null; -Clazz_instantialize (this, arguments); -}, JU, "SB"); -Clazz_makeConstructor (c$, -function () { -{ -this.s = ""; -}}); -c$.newN = Clazz_defineMethod (c$, "newN", -function (n) { -{ -return new JU.SB(); -}}, "~N"); -c$.newS = Clazz_defineMethod (c$, "newS", -function (s) { -{ -var sb = new JU.SB(); -sb.s = s; -return sb; -}}, "~S"); -Clazz_defineMethod (c$, "append", -function (s) { -{ -this.s += s -}return this; -}, "~S"); -Clazz_defineMethod (c$, "appendC", -function (c) { -{ -this.s += c; -}return this; -}, "~S"); -Clazz_defineMethod (c$, "appendI", -function (i) { -{ -this.s += i -}return this; -}, "~N"); -Clazz_defineMethod (c$, "appendB", -function (b) { -{ -this.s += b -}return this; -}, "~B"); -Clazz_defineMethod (c$, "appendF", -function (f) { -{ -var sf = "" + f; -if (sf.indexOf(".") < 0 && sf.indexOf("e") < 0) -sf += ".0" ; -this.s += sf; -}return this; -}, "~N"); -Clazz_defineMethod (c$, "appendD", -function (d) { -{ -var sf = "" + d; -if (sf.indexOf(".") < 0 && sf.indexOf("e") < 0) -sf += ".0" ; -this.s += sf; -}return this; -}, "~N"); -Clazz_defineMethod (c$, "appendSB", -function (buf) { -{ -this.s += buf.s; -}return this; -}, "JU.SB"); -Clazz_defineMethod (c$, "appendO", -function (data) { -if (data != null) { -{ -this.s += data.toString(); -}}return this; -}, "~O"); -Clazz_defineMethod (c$, "appendCB", -function (cb, off, len) { -{ -for (var i = len,j=off; --i >= 0;) -this.s += cb[j++]; -}}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "toString", -function () { -{ -return this.s; -}}); -Clazz_defineMethod (c$, "length", -function () { -{ -return this.s.length; -}}); -Clazz_defineMethod (c$, "indexOf", -function (s) { -{ -return this.s.indexOf(s); -}}, "~S"); -Clazz_defineMethod (c$, "charAt", -function (i) { -{ -return this.s.charAt(i); -}}, "~N"); -Clazz_defineMethod (c$, "charCodeAt", -function (i) { -{ -return this.s.charCodeAt(i); -}}, "~N"); -Clazz_defineMethod (c$, "setLength", -function (n) { -{ -this.s = this.s.substring(0, n); -}}, "~N"); -Clazz_defineMethod (c$, "lastIndexOf", -function (s) { -{ -return this.s.lastIndexOf(s); -}}, "~S"); -Clazz_defineMethod (c$, "indexOf2", -function (s, i) { -{ -return this.s.indexOf(s, i); -}}, "~S,~N"); -Clazz_defineMethod (c$, "substring", -function (i) { -{ -return this.s.substring(i); -}}, "~N"); -Clazz_defineMethod (c$, "substring2", -function (i, j) { -{ -return this.s.substring(i, j); -}}, "~N,~N"); -Clazz_defineMethod (c$, "toBytes", -function (off, len) { -if (len < 0) len = this.length () - off; -var b = Clazz_newByteArray (len, 0); -for (var i = off + len, j = i - off; --i >= off; ) b[--j] = (this.charAt (i)).charCodeAt (0); - -return b; -}, "~N,~N"); -Clazz_defineMethod (c$, "replace", -function (start, end, str) { -{ -this.s = this.s.substring(0, start) + str + this.s.substring(end); -}}, "~N,~N,~S"); -Clazz_defineMethod (c$, "insert", -function (offset, str) { -this.replace (offset, offset, str); -}, "~N,~S"); -Clazz_declarePackage ("JU"); -Clazz_load (null, "JU.M34", ["java.lang.ArrayIndexOutOfBoundsException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.m00 = 0; -this.m01 = 0; -this.m02 = 0; -this.m10 = 0; -this.m11 = 0; -this.m12 = 0; -this.m20 = 0; -this.m21 = 0; -this.m22 = 0; -Clazz_instantialize (this, arguments); -}, JU, "M34"); -Clazz_defineMethod (c$, "setAA33", -function (a) { -var x = a.x; -var y = a.y; -var z = a.z; -var angle = a.angle; -var n = Math.sqrt (x * x + y * y + z * z); -n = 1 / n; -x *= n; -y *= n; -z *= n; -var c = Math.cos (angle); -var s = Math.sin (angle); -var omc = 1.0 - c; -this.m00 = (c + x * x * omc); -this.m11 = (c + y * y * omc); -this.m22 = (c + z * z * omc); -var tmp1 = x * y * omc; -var tmp2 = z * s; -this.m01 = (tmp1 - tmp2); -this.m10 = (tmp1 + tmp2); -tmp1 = x * z * omc; -tmp2 = y * s; -this.m02 = (tmp1 + tmp2); -this.m20 = (tmp1 - tmp2); -tmp1 = y * z * omc; -tmp2 = x * s; -this.m12 = (tmp1 - tmp2); -this.m21 = (tmp1 + tmp2); -}, "JU.A4"); -Clazz_defineMethod (c$, "rotate", -function (t) { -this.rotate2 (t, t); -}, "JU.T3"); -Clazz_defineMethod (c$, "rotate2", -function (t, result) { -result.set (this.m00 * t.x + this.m01 * t.y + this.m02 * t.z, this.m10 * t.x + this.m11 * t.y + this.m12 * t.z, this.m20 * t.x + this.m21 * t.y + this.m22 * t.z); -}, "JU.T3,JU.T3"); -Clazz_defineMethod (c$, "setM33", -function (m1) { -this.m00 = m1.m00; -this.m01 = m1.m01; -this.m02 = m1.m02; -this.m10 = m1.m10; -this.m11 = m1.m11; -this.m12 = m1.m12; -this.m20 = m1.m20; -this.m21 = m1.m21; -this.m22 = m1.m22; -}, "JU.M34"); -Clazz_defineMethod (c$, "clear33", -function () { -this.m00 = this.m01 = this.m02 = this.m10 = this.m11 = this.m12 = this.m20 = this.m21 = this.m22 = 0.0; -}); -Clazz_defineMethod (c$, "set33", -function (row, col, v) { -switch (row) { -case 0: -switch (col) { -case 0: -this.m00 = v; -return; -case 1: -this.m01 = v; -return; -case 2: -this.m02 = v; -return; -} -break; -case 1: -switch (col) { -case 0: -this.m10 = v; -return; -case 1: -this.m11 = v; -return; -case 2: -this.m12 = v; -return; -} -break; -case 2: -switch (col) { -case 0: -this.m20 = v; -return; -case 1: -this.m21 = v; -return; -case 2: -this.m22 = v; -return; -} -break; -} -this.err (); -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "get33", -function (row, col) { -switch (row) { -case 0: -switch (col) { -case 0: -return this.m00; -case 1: -return this.m01; -case 2: -return this.m02; -} -break; -case 1: -switch (col) { -case 0: -return this.m10; -case 1: -return this.m11; -case 2: -return this.m12; -} -break; -case 2: -switch (col) { -case 0: -return this.m20; -case 1: -return this.m21; -case 2: -return this.m22; -} -break; -} -this.err (); -return 0; -}, "~N,~N"); -Clazz_defineMethod (c$, "setRow33", -function (row, v) { -switch (row) { -case 0: -this.m00 = v[0]; -this.m01 = v[1]; -this.m02 = v[2]; -return; -case 1: -this.m10 = v[0]; -this.m11 = v[1]; -this.m12 = v[2]; -return; -case 2: -this.m20 = v[0]; -this.m21 = v[1]; -this.m22 = v[2]; -return; -default: -this.err (); -} -}, "~N,~A"); -Clazz_defineMethod (c$, "getRow33", -function (row, v) { -switch (row) { -case 0: -v[0] = this.m00; -v[1] = this.m01; -v[2] = this.m02; -return; -case 1: -v[0] = this.m10; -v[1] = this.m11; -v[2] = this.m12; -return; -case 2: -v[0] = this.m20; -v[1] = this.m21; -v[2] = this.m22; -return; -} -this.err (); -}, "~N,~A"); -Clazz_defineMethod (c$, "setColumn33", -function (column, v) { -switch (column) { -case 0: -this.m00 = v[0]; -this.m10 = v[1]; -this.m20 = v[2]; -break; -case 1: -this.m01 = v[0]; -this.m11 = v[1]; -this.m21 = v[2]; -break; -case 2: -this.m02 = v[0]; -this.m12 = v[1]; -this.m22 = v[2]; -break; -default: -this.err (); -} -}, "~N,~A"); -Clazz_defineMethod (c$, "getColumn33", -function (column, v) { -switch (column) { -case 0: -v[0] = this.m00; -v[1] = this.m10; -v[2] = this.m20; -break; -case 1: -v[0] = this.m01; -v[1] = this.m11; -v[2] = this.m21; -break; -case 2: -v[0] = this.m02; -v[1] = this.m12; -v[2] = this.m22; -break; -default: -this.err (); -} -}, "~N,~A"); -Clazz_defineMethod (c$, "add33", -function (m1) { -this.m00 += m1.m00; -this.m01 += m1.m01; -this.m02 += m1.m02; -this.m10 += m1.m10; -this.m11 += m1.m11; -this.m12 += m1.m12; -this.m20 += m1.m20; -this.m21 += m1.m21; -this.m22 += m1.m22; -}, "JU.M34"); -Clazz_defineMethod (c$, "sub33", -function (m1) { -this.m00 -= m1.m00; -this.m01 -= m1.m01; -this.m02 -= m1.m02; -this.m10 -= m1.m10; -this.m11 -= m1.m11; -this.m12 -= m1.m12; -this.m20 -= m1.m20; -this.m21 -= m1.m21; -this.m22 -= m1.m22; -}, "JU.M34"); -Clazz_defineMethod (c$, "mul33", -function (x) { -this.m00 *= x; -this.m01 *= x; -this.m02 *= x; -this.m10 *= x; -this.m11 *= x; -this.m12 *= x; -this.m20 *= x; -this.m21 *= x; -this.m22 *= x; -}, "~N"); -Clazz_defineMethod (c$, "transpose33", -function () { -var tmp = this.m01; -this.m01 = this.m10; -this.m10 = tmp; -tmp = this.m02; -this.m02 = this.m20; -this.m20 = tmp; -tmp = this.m12; -this.m12 = this.m21; -this.m21 = tmp; -}); -Clazz_defineMethod (c$, "setXRot", -function (angle) { -var c = Math.cos (angle); -var s = Math.sin (angle); -this.m00 = 1.0; -this.m01 = 0.0; -this.m02 = 0.0; -this.m10 = 0.0; -this.m11 = c; -this.m12 = -s; -this.m20 = 0.0; -this.m21 = s; -this.m22 = c; -}, "~N"); -Clazz_defineMethod (c$, "setYRot", -function (angle) { -var c = Math.cos (angle); -var s = Math.sin (angle); -this.m00 = c; -this.m01 = 0.0; -this.m02 = s; -this.m10 = 0.0; -this.m11 = 1.0; -this.m12 = 0.0; -this.m20 = -s; -this.m21 = 0.0; -this.m22 = c; -}, "~N"); -Clazz_defineMethod (c$, "setZRot", -function (angle) { -var c = Math.cos (angle); -var s = Math.sin (angle); -this.m00 = c; -this.m01 = -s; -this.m02 = 0.0; -this.m10 = s; -this.m11 = c; -this.m12 = 0.0; -this.m20 = 0.0; -this.m21 = 0.0; -this.m22 = 1.0; -}, "~N"); -Clazz_defineMethod (c$, "determinant3", -function () { -return this.m00 * (this.m11 * this.m22 - this.m21 * this.m12) - this.m01 * (this.m10 * this.m22 - this.m20 * this.m12) + this.m02 * (this.m10 * this.m21 - this.m20 * this.m11); -}); -Clazz_defineMethod (c$, "err", -function () { -throw new ArrayIndexOutOfBoundsException ("matrix column/row out of bounds"); -}); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["JU.M34"], "JU.M4", ["JU.T3"], function () { -c$ = Clazz_decorateAsClass (function () { -this.m03 = 0; -this.m13 = 0; -this.m23 = 0; -this.m30 = 0; -this.m31 = 0; -this.m32 = 0; -this.m33 = 0; -Clazz_instantialize (this, arguments); -}, JU, "M4", JU.M34); -c$.newA16 = Clazz_defineMethod (c$, "newA16", -function (v) { -var m = new JU.M4 (); -m.m00 = v[0]; -m.m01 = v[1]; -m.m02 = v[2]; -m.m03 = v[3]; -m.m10 = v[4]; -m.m11 = v[5]; -m.m12 = v[6]; -m.m13 = v[7]; -m.m20 = v[8]; -m.m21 = v[9]; -m.m22 = v[10]; -m.m23 = v[11]; -m.m30 = v[12]; -m.m31 = v[13]; -m.m32 = v[14]; -m.m33 = v[15]; -return m; -}, "~A"); -c$.newM4 = Clazz_defineMethod (c$, "newM4", -function (m1) { -var m = new JU.M4 (); -if (m1 == null) { -m.setIdentity (); -return m; -}m.setToM3 (m1); -m.m03 = m1.m03; -m.m13 = m1.m13; -m.m23 = m1.m23; -m.m30 = m1.m30; -m.m31 = m1.m31; -m.m32 = m1.m32; -m.m33 = m1.m33; -return m; -}, "JU.M4"); -c$.newMV = Clazz_defineMethod (c$, "newMV", -function (m1, t) { -var m = new JU.M4 (); -m.setMV (m1, t); -return m; -}, "JU.M3,JU.T3"); -Clazz_defineMethod (c$, "setZero", -function () { -this.clear33 (); -this.m03 = this.m13 = this.m23 = this.m30 = this.m31 = this.m32 = this.m33 = 0.0; -}); -Clazz_defineMethod (c$, "setIdentity", -function () { -this.setZero (); -this.m00 = this.m11 = this.m22 = this.m33 = 1.0; -}); -Clazz_defineMethod (c$, "setM4", -function (m1) { -this.setM33 (m1); -this.m03 = m1.m03; -this.m13 = m1.m13; -this.m23 = m1.m23; -this.m30 = m1.m30; -this.m31 = m1.m31; -this.m32 = m1.m32; -this.m33 = m1.m33; -return this; -}, "JU.M4"); -Clazz_defineMethod (c$, "setMV", -function (m1, t) { -this.setM33 (m1); -this.setTranslation (t); -this.m33 = 1; -}, "JU.M3,JU.T3"); -Clazz_defineMethod (c$, "setToM3", -function (m1) { -this.setM33 (m1); -this.m03 = this.m13 = this.m23 = this.m30 = this.m31 = this.m32 = 0.0; -this.m33 = 1.0; -}, "JU.M34"); -Clazz_defineMethod (c$, "setToAA", -function (a) { -this.setIdentity (); -this.setAA33 (a); -}, "JU.A4"); -Clazz_defineMethod (c$, "setA", -function (m) { -this.m00 = m[0]; -this.m01 = m[1]; -this.m02 = m[2]; -this.m03 = m[3]; -this.m10 = m[4]; -this.m11 = m[5]; -this.m12 = m[6]; -this.m13 = m[7]; -this.m20 = m[8]; -this.m21 = m[9]; -this.m22 = m[10]; -this.m23 = m[11]; -this.m30 = m[12]; -this.m31 = m[13]; -this.m32 = m[14]; -this.m33 = m[15]; -}, "~A"); -Clazz_defineMethod (c$, "setTranslation", -function (trans) { -this.m03 = trans.x; -this.m13 = trans.y; -this.m23 = trans.z; -}, "JU.T3"); -Clazz_defineMethod (c$, "setElement", -function (row, col, v) { -if (row < 3 && col < 3) { -this.set33 (row, col, v); -return; -}if (row > 3 || col > 3) this.err (); -switch (row) { -case 0: -this.m03 = v; -return; -case 1: -this.m13 = v; -return; -case 2: -this.m23 = v; -return; -} -switch (col) { -case 0: -this.m30 = v; -return; -case 1: -this.m31 = v; -return; -case 2: -this.m32 = v; -return; -case 3: -this.m33 = v; -return; -} -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "getElement", -function (row, col) { -if (row < 3 && col < 3) return this.get33 (row, col); -if (row > 3 || col > 3) { -this.err (); -return 0; -}switch (row) { -case 0: -return this.m03; -case 1: -return this.m13; -case 2: -return this.m23; -default: -switch (col) { -case 0: -return this.m30; -case 1: -return this.m31; -case 2: -return this.m32; -default: -return this.m33; -} -} -}, "~N,~N"); -Clazz_defineMethod (c$, "getTranslation", -function (trans) { -trans.x = this.m03; -trans.y = this.m13; -trans.z = this.m23; -}, "JU.T3"); -Clazz_defineMethod (c$, "getRotationScale", -function (m1) { -m1.m00 = this.m00; -m1.m01 = this.m01; -m1.m02 = this.m02; -m1.m10 = this.m10; -m1.m11 = this.m11; -m1.m12 = this.m12; -m1.m20 = this.m20; -m1.m21 = this.m21; -m1.m22 = this.m22; -}, "JU.M3"); -Clazz_defineMethod (c$, "setRotationScale", -function (m1) { -this.m00 = m1.m00; -this.m01 = m1.m01; -this.m02 = m1.m02; -this.m10 = m1.m10; -this.m11 = m1.m11; -this.m12 = m1.m12; -this.m20 = m1.m20; -this.m21 = m1.m21; -this.m22 = m1.m22; -}, "JU.M3"); -Clazz_defineMethod (c$, "setRowA", -function (row, v) { -if (row < 3) this.setRow33 (row, v); -switch (row) { -case 0: -this.m03 = v[3]; -return; -case 1: -this.m13 = v[3]; -return; -case 2: -this.m23 = v[3]; -return; -case 3: -this.m30 = v[0]; -this.m31 = v[1]; -this.m32 = v[2]; -this.m33 = v[3]; -return; -} -this.err (); -}, "~N,~A"); -Clazz_overrideMethod (c$, "getRow", -function (row, v) { -if (row < 3) this.getRow33 (row, v); -switch (row) { -case 0: -v[3] = this.m03; -return; -case 1: -v[3] = this.m13; -return; -case 2: -v[3] = this.m23; -return; -case 3: -v[0] = this.m30; -v[1] = this.m31; -v[2] = this.m32; -v[3] = this.m33; -return; -} -this.err (); -}, "~N,~A"); -Clazz_defineMethod (c$, "setColumn4", -function (column, x, y, z, w) { -if (column == 0) { -this.m00 = x; -this.m10 = y; -this.m20 = z; -this.m30 = w; -} else if (column == 1) { -this.m01 = x; -this.m11 = y; -this.m21 = z; -this.m31 = w; -} else if (column == 2) { -this.m02 = x; -this.m12 = y; -this.m22 = z; -this.m32 = w; -} else if (column == 3) { -this.m03 = x; -this.m13 = y; -this.m23 = z; -this.m33 = w; -} else { -this.err (); -}}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setColumnA", -function (column, v) { -if (column < 3) this.setColumn33 (column, v); -switch (column) { -case 0: -this.m30 = v[3]; -return; -case 1: -this.m31 = v[3]; -return; -case 2: -this.m32 = v[3]; -return; -case 3: -this.m03 = v[0]; -this.m13 = v[1]; -this.m23 = v[2]; -this.m33 = v[3]; -return; -default: -this.err (); -} -}, "~N,~A"); -Clazz_defineMethod (c$, "getColumn", -function (column, v) { -if (column < 3) this.getColumn33 (column, v); -switch (column) { -case 0: -v[3] = this.m30; -return; -case 1: -v[3] = this.m31; -return; -case 2: -v[3] = this.m32; -return; -case 3: -v[0] = this.m03; -v[1] = this.m13; -v[2] = this.m23; -v[3] = this.m33; -return; -default: -this.err (); -} -}, "~N,~A"); -Clazz_defineMethod (c$, "sub", -function (m1) { -this.sub33 (m1); -this.m03 -= m1.m03; -this.m13 -= m1.m13; -this.m23 -= m1.m23; -this.m30 -= m1.m30; -this.m31 -= m1.m31; -this.m32 -= m1.m32; -this.m33 -= m1.m33; -}, "JU.M4"); -Clazz_defineMethod (c$, "transpose", -function () { -this.transpose33 (); -var tmp = this.m03; -this.m03 = this.m30; -this.m30 = tmp; -tmp = this.m13; -this.m13 = this.m31; -this.m31 = tmp; -tmp = this.m23; -this.m23 = this.m32; -this.m32 = tmp; -}); -Clazz_defineMethod (c$, "invert", -function () { -var s = this.determinant4 (); -if (s == 0.0) return this; -s = 1 / s; -this.set (this.m11 * (this.m22 * this.m33 - this.m23 * this.m32) + this.m12 * (this.m23 * this.m31 - this.m21 * this.m33) + this.m13 * (this.m21 * this.m32 - this.m22 * this.m31), this.m21 * (this.m02 * this.m33 - this.m03 * this.m32) + this.m22 * (this.m03 * this.m31 - this.m01 * this.m33) + this.m23 * (this.m01 * this.m32 - this.m02 * this.m31), this.m31 * (this.m02 * this.m13 - this.m03 * this.m12) + this.m32 * (this.m03 * this.m11 - this.m01 * this.m13) + this.m33 * (this.m01 * this.m12 - this.m02 * this.m11), this.m01 * (this.m13 * this.m22 - this.m12 * this.m23) + this.m02 * (this.m11 * this.m23 - this.m13 * this.m21) + this.m03 * (this.m12 * this.m21 - this.m11 * this.m22), this.m12 * (this.m20 * this.m33 - this.m23 * this.m30) + this.m13 * (this.m22 * this.m30 - this.m20 * this.m32) + this.m10 * (this.m23 * this.m32 - this.m22 * this.m33), this.m22 * (this.m00 * this.m33 - this.m03 * this.m30) + this.m23 * (this.m02 * this.m30 - this.m00 * this.m32) + this.m20 * (this.m03 * this.m32 - this.m02 * this.m33), this.m32 * (this.m00 * this.m13 - this.m03 * this.m10) + this.m33 * (this.m02 * this.m10 - this.m00 * this.m12) + this.m30 * (this.m03 * this.m12 - this.m02 * this.m13), this.m02 * (this.m13 * this.m20 - this.m10 * this.m23) + this.m03 * (this.m10 * this.m22 - this.m12 * this.m20) + this.m00 * (this.m12 * this.m23 - this.m13 * this.m22), this.m13 * (this.m20 * this.m31 - this.m21 * this.m30) + this.m10 * (this.m21 * this.m33 - this.m23 * this.m31) + this.m11 * (this.m23 * this.m30 - this.m20 * this.m33), this.m23 * (this.m00 * this.m31 - this.m01 * this.m30) + this.m20 * (this.m01 * this.m33 - this.m03 * this.m31) + this.m21 * (this.m03 * this.m30 - this.m00 * this.m33), this.m33 * (this.m00 * this.m11 - this.m01 * this.m10) + this.m30 * (this.m01 * this.m13 - this.m03 * this.m11) + this.m31 * (this.m03 * this.m10 - this.m00 * this.m13), this.m03 * (this.m11 * this.m20 - this.m10 * this.m21) + this.m00 * (this.m13 * this.m21 - this.m11 * this.m23) + this.m01 * (this.m10 * this.m23 - this.m13 * this.m20), this.m10 * (this.m22 * this.m31 - this.m21 * this.m32) + this.m11 * (this.m20 * this.m32 - this.m22 * this.m30) + this.m12 * (this.m21 * this.m30 - this.m20 * this.m31), this.m20 * (this.m02 * this.m31 - this.m01 * this.m32) + this.m21 * (this.m00 * this.m32 - this.m02 * this.m30) + this.m22 * (this.m01 * this.m30 - this.m00 * this.m31), this.m30 * (this.m02 * this.m11 - this.m01 * this.m12) + this.m31 * (this.m00 * this.m12 - this.m02 * this.m10) + this.m32 * (this.m01 * this.m10 - this.m00 * this.m11), this.m00 * (this.m11 * this.m22 - this.m12 * this.m21) + this.m01 * (this.m12 * this.m20 - this.m10 * this.m22) + this.m02 * (this.m10 * this.m21 - this.m11 * this.m20)); -this.scale (s); -return this; -}); -Clazz_defineMethod (c$, "set", - function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { -this.m00 = m00; -this.m01 = m01; -this.m02 = m02; -this.m03 = m03; -this.m10 = m10; -this.m11 = m11; -this.m12 = m12; -this.m13 = m13; -this.m20 = m20; -this.m21 = m21; -this.m22 = m22; -this.m23 = m23; -this.m30 = m30; -this.m31 = m31; -this.m32 = m32; -this.m33 = m33; -}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "determinant4", -function () { -return (this.m00 * this.m11 - this.m01 * this.m10) * (this.m22 * this.m33 - this.m23 * this.m32) - (this.m00 * this.m12 - this.m02 * this.m10) * (this.m21 * this.m33 - this.m23 * this.m31) + (this.m00 * this.m13 - this.m03 * this.m10) * (this.m21 * this.m32 - this.m22 * this.m31) + (this.m01 * this.m12 - this.m02 * this.m11) * (this.m20 * this.m33 - this.m23 * this.m30) - (this.m01 * this.m13 - this.m03 * this.m11) * (this.m20 * this.m32 - this.m22 * this.m30) + (this.m02 * this.m13 - this.m03 * this.m12) * (this.m20 * this.m31 - this.m21 * this.m30); -}); -Clazz_defineMethod (c$, "scale", - function (scalar) { -this.mul33 (scalar); -this.m03 *= scalar; -this.m13 *= scalar; -this.m23 *= scalar; -this.m30 *= scalar; -this.m31 *= scalar; -this.m32 *= scalar; -this.m33 *= scalar; -}, "~N"); -Clazz_defineMethod (c$, "mul", -function (m1) { -this.mul2 (this, m1); -}, "JU.M4"); -Clazz_defineMethod (c$, "mul2", -function (m1, m2) { -this.set (m1.m00 * m2.m00 + m1.m01 * m2.m10 + m1.m02 * m2.m20 + m1.m03 * m2.m30, m1.m00 * m2.m01 + m1.m01 * m2.m11 + m1.m02 * m2.m21 + m1.m03 * m2.m31, m1.m00 * m2.m02 + m1.m01 * m2.m12 + m1.m02 * m2.m22 + m1.m03 * m2.m32, m1.m00 * m2.m03 + m1.m01 * m2.m13 + m1.m02 * m2.m23 + m1.m03 * m2.m33, m1.m10 * m2.m00 + m1.m11 * m2.m10 + m1.m12 * m2.m20 + m1.m13 * m2.m30, m1.m10 * m2.m01 + m1.m11 * m2.m11 + m1.m12 * m2.m21 + m1.m13 * m2.m31, m1.m10 * m2.m02 + m1.m11 * m2.m12 + m1.m12 * m2.m22 + m1.m13 * m2.m32, m1.m10 * m2.m03 + m1.m11 * m2.m13 + m1.m12 * m2.m23 + m1.m13 * m2.m33, m1.m20 * m2.m00 + m1.m21 * m2.m10 + m1.m22 * m2.m20 + m1.m23 * m2.m30, m1.m20 * m2.m01 + m1.m21 * m2.m11 + m1.m22 * m2.m21 + m1.m23 * m2.m31, m1.m20 * m2.m02 + m1.m21 * m2.m12 + m1.m22 * m2.m22 + m1.m23 * m2.m32, m1.m20 * m2.m03 + m1.m21 * m2.m13 + m1.m22 * m2.m23 + m1.m23 * m2.m33, m1.m30 * m2.m00 + m1.m31 * m2.m10 + m1.m32 * m2.m20 + m1.m33 * m2.m30, m1.m30 * m2.m01 + m1.m31 * m2.m11 + m1.m32 * m2.m21 + m1.m33 * m2.m31, m1.m30 * m2.m02 + m1.m31 * m2.m12 + m1.m32 * m2.m22 + m1.m33 * m2.m32, m1.m30 * m2.m03 + m1.m31 * m2.m13 + m1.m32 * m2.m23 + m1.m33 * m2.m33); -}, "JU.M4,JU.M4"); -Clazz_defineMethod (c$, "transform", -function (vec) { -this.transform2 (vec, vec); -}, "JU.T4"); -Clazz_defineMethod (c$, "transform2", -function (vec, vecOut) { -vecOut.set4 (this.m00 * vec.x + this.m01 * vec.y + this.m02 * vec.z + this.m03 * vec.w, this.m10 * vec.x + this.m11 * vec.y + this.m12 * vec.z + this.m13 * vec.w, this.m20 * vec.x + this.m21 * vec.y + this.m22 * vec.z + this.m23 * vec.w, this.m30 * vec.x + this.m31 * vec.y + this.m32 * vec.z + this.m33 * vec.w); -}, "JU.T4,JU.T4"); -Clazz_defineMethod (c$, "rotTrans", -function (point) { -this.rotTrans2 (point, point); -}, "JU.T3"); -Clazz_defineMethod (c$, "rotTrans2", -function (point, pointOut) { -pointOut.set (this.m00 * point.x + this.m01 * point.y + this.m02 * point.z + this.m03, this.m10 * point.x + this.m11 * point.y + this.m12 * point.z + this.m13, this.m20 * point.x + this.m21 * point.y + this.m22 * point.z + this.m23); -return pointOut; -}, "JU.T3,JU.T3"); -Clazz_defineMethod (c$, "setAsXYRotation", -function (angle) { -this.setIdentity (); -var c = Math.cos (angle); -var s = Math.sin (angle); -this.m22 = c; -this.m23 = -s; -this.m32 = s; -this.m33 = c; -return this; -}, "~N"); -Clazz_defineMethod (c$, "setAsYZRotation", -function (angle) { -this.setIdentity (); -var c = Math.cos (angle); -var s = Math.sin (angle); -this.m00 = c; -this.m03 = -s; -this.m30 = s; -this.m33 = c; -return this; -}, "~N"); -Clazz_defineMethod (c$, "setAsXZRotation", -function (angle) { -this.setIdentity (); -var c = Math.cos (angle); -var s = Math.sin (angle); -this.m11 = c; -this.m13 = -s; -this.m31 = s; -this.m33 = c; -return this; -}, "~N"); -Clazz_overrideMethod (c$, "equals", -function (o) { -if (!(Clazz_instanceOf (o, JU.M4))) return false; -var m = o; -return (this.m00 == m.m00 && this.m01 == m.m01 && this.m02 == m.m02 && this.m03 == m.m03 && this.m10 == m.m10 && this.m11 == m.m11 && this.m12 == m.m12 && this.m13 == m.m13 && this.m20 == m.m20 && this.m21 == m.m21 && this.m22 == m.m22 && this.m23 == m.m23 && this.m30 == m.m30 && this.m31 == m.m31 && this.m32 == m.m32 && this.m33 == m.m33); -}, "~O"); -Clazz_overrideMethod (c$, "hashCode", -function () { -return JU.T3.floatToIntBits0 (this.m00) ^ JU.T3.floatToIntBits0 (this.m01) ^ JU.T3.floatToIntBits0 (this.m02) ^ JU.T3.floatToIntBits0 (this.m03) ^ JU.T3.floatToIntBits0 (this.m10) ^ JU.T3.floatToIntBits0 (this.m11) ^ JU.T3.floatToIntBits0 (this.m12) ^ JU.T3.floatToIntBits0 (this.m13) ^ JU.T3.floatToIntBits0 (this.m20) ^ JU.T3.floatToIntBits0 (this.m21) ^ JU.T3.floatToIntBits0 (this.m22) ^ JU.T3.floatToIntBits0 (this.m23) ^ JU.T3.floatToIntBits0 (this.m30) ^ JU.T3.floatToIntBits0 (this.m31) ^ JU.T3.floatToIntBits0 (this.m32) ^ JU.T3.floatToIntBits0 (this.m33); -}); -Clazz_overrideMethod (c$, "toString", -function () { -return "[\n [" + this.m00 + "\t" + this.m01 + "\t" + this.m02 + "\t" + this.m03 + "]" + "\n [" + this.m10 + "\t" + this.m11 + "\t" + this.m12 + "\t" + this.m13 + "]" + "\n [" + this.m20 + "\t" + this.m21 + "\t" + this.m22 + "\t" + this.m23 + "]" + "\n [" + this.m30 + "\t" + this.m31 + "\t" + this.m32 + "\t" + this.m33 + "] ]"; -}); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["javajs.api.JSONEncodable"], "JU.T3", ["java.lang.Float"], function () { -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.z = 0; -Clazz_instantialize (this, arguments); -}, JU, "T3", null, [javajs.api.JSONEncodable, java.io.Serializable]); -Clazz_defineMethod (c$, "set", -function (x, y, z) { -this.x = x; -this.y = y; -this.z = z; -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "setA", -function (t) { -this.x = t[0]; -this.y = t[1]; -this.z = t[2]; -}, "~A"); -Clazz_defineMethod (c$, "setT", -function (t1) { -this.x = t1.x; -this.y = t1.y; -this.z = t1.z; -}, "JU.T3"); -Clazz_defineMethod (c$, "add2", -function (t1, t2) { -this.x = t1.x + t2.x; -this.y = t1.y + t2.y; -this.z = t1.z + t2.z; -}, "JU.T3,JU.T3"); -Clazz_defineMethod (c$, "add", -function (t1) { -this.x += t1.x; -this.y += t1.y; -this.z += t1.z; -}, "JU.T3"); -Clazz_defineMethod (c$, "distanceSquared", -function (p1) { -var dx = this.x - p1.x; -var dy = this.y - p1.y; -var dz = this.z - p1.z; -return (dx * dx + dy * dy + dz * dz); -}, "JU.T3"); -Clazz_defineMethod (c$, "distance", -function (p1) { -return Math.sqrt (this.distanceSquared (p1)); -}, "JU.T3"); -Clazz_defineMethod (c$, "sub2", -function (t1, t2) { -this.x = t1.x - t2.x; -this.y = t1.y - t2.y; -this.z = t1.z - t2.z; -}, "JU.T3,JU.T3"); -Clazz_defineMethod (c$, "sub", -function (t1) { -this.x -= t1.x; -this.y -= t1.y; -this.z -= t1.z; -}, "JU.T3"); -Clazz_defineMethod (c$, "scale", -function (s) { -this.x *= s; -this.y *= s; -this.z *= s; -}, "~N"); -Clazz_defineMethod (c$, "add3", -function (a, b, c) { -this.x += a; -this.y += b; -this.z += c; -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "scaleT", -function (p) { -this.x *= p.x; -this.y *= p.y; -this.z *= p.z; -}, "JU.T3"); -Clazz_defineMethod (c$, "scaleAdd2", -function (s, t1, t2) { -this.x = s * t1.x + t2.x; -this.y = s * t1.y + t2.y; -this.z = s * t1.z + t2.z; -}, "~N,JU.T3,JU.T3"); -Clazz_defineMethod (c$, "ave", -function (a, b) { -this.x = (a.x + b.x) / 2; -this.y = (a.y + b.y) / 2; -this.z = (a.z + b.z) / 2; -}, "JU.T3,JU.T3"); -Clazz_defineMethod (c$, "dot", -function (v) { -return this.x * v.x + this.y * v.y + this.z * v.z; -}, "JU.T3"); -Clazz_defineMethod (c$, "lengthSquared", -function () { -return this.x * this.x + this.y * this.y + this.z * this.z; -}); -Clazz_defineMethod (c$, "length", -function () { -return Math.sqrt (this.lengthSquared ()); -}); -Clazz_defineMethod (c$, "normalize", -function () { -var d = this.length (); -this.x /= d; -this.y /= d; -this.z /= d; -}); -Clazz_defineMethod (c$, "cross", -function (v1, v2) { -this.set (v1.y * v2.z - v1.z * v2.y, v1.z * v2.x - v1.x * v2.z, v1.x * v2.y - v1.y * v2.x); -}, "JU.T3,JU.T3"); -Clazz_overrideMethod (c$, "hashCode", -function () { -var bits = 1; -bits = 31 * bits + JU.T3.floatToIntBits0 (this.x); -bits = 31 * bits + JU.T3.floatToIntBits0 (this.y); -bits = 31 * bits + JU.T3.floatToIntBits0 (this.z); -return (bits ^ (bits >> 32)); -}); -c$.floatToIntBits0 = Clazz_defineMethod (c$, "floatToIntBits0", -function (f) { -return (f == 0 ? 0 : Float.floatToIntBits (f)); -}, "~N"); -Clazz_overrideMethod (c$, "equals", -function (t1) { -if (!(Clazz_instanceOf (t1, JU.T3))) return false; -var t2 = t1; -return (this.x == t2.x && this.y == t2.y && this.z == t2.z); -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -return "{" + this.x + ", " + this.y + ", " + this.z + "}"; -}); -Clazz_overrideMethod (c$, "toJSON", -function () { -return "[" + this.x + "," + this.y + "," + this.z + "]"; -}); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.LayoutManager2", "javax.swing.AbstractAction", "$.JComponent"], "javax.swing.JRootPane", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.BorderLayout", "$.Dimension", "$.IllegalComponentStateException", "javax.swing.JLayeredPane", "$.JPanel", "$.SwingUtilities", "$.UIManager", "jssun.awt.AppContext"], function () { -c$ = Clazz_decorateAsClass (function () { -this.windowDecorationStyle = 0; -this.menuBar = null; -this.contentPane = null; -this.layeredPane = null; -this.glassPane = null; -this.defaultButton = null; -this.defaultPressAction = null; -this.defaultReleaseAction = null; -this.useTrueDoubleBuffering = true; -if (!Clazz_isClassDefined ("javax.swing.JRootPane.RootLayout")) { -javax.swing.JRootPane.$JRootPane$RootLayout$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "JRootPane", javax.swing.JComponent); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JRootPane, []); -var appletName = jssun.awt.AppContext.getAppContext ().getThreadGroup ().getName (); -this.setName (appletName + ".JRootPane"); -this.setGlassPane (this.createGlassPane ()); -this.setLayeredPane (this.createLayeredPane ()); -this.setContentPane (this.createContentPane ()); -this.setLayout (this.createRootLayout ()); -this.updateUI (); -}); -Clazz_overrideMethod (c$, "setDoubleBuffered", -function (aFlag) { -}, "~B"); -Clazz_defineMethod (c$, "getWindowDecorationStyle", -function () { -return this.windowDecorationStyle; -}); -Clazz_defineMethod (c$, "setWindowDecorationStyle", -function (windowDecorationStyle) { -if (windowDecorationStyle < 0 || windowDecorationStyle > 8) { -throw new IllegalArgumentException ("Invalid decoration style"); -}var oldWindowDecorationStyle = this.getWindowDecorationStyle (); -this.windowDecorationStyle = windowDecorationStyle; -this.firePropertyChangeInt ("windowDecorationStyle", oldWindowDecorationStyle, windowDecorationStyle); -}, "~N"); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "RootPaneUI"; -}); -Clazz_defineMethod (c$, "createLayeredPane", -function () { -var p = new javax.swing.JLayeredPane (); -p.setName (this.getName () + ".layeredPane"); -return p; -}); -Clazz_defineMethod (c$, "createContentPane", -function () { -var c = new javax.swing.JPanel (); -c.setName (this.getName () + ".contentPane"); -c.setLayout (((Clazz_isClassDefined ("javax.swing.JRootPane$1") ? 0 : javax.swing.JRootPane.$JRootPane$1$ ()), Clazz_innerTypeInstance (javax.swing.JRootPane$1, this, null))); -return c; -}); -Clazz_defineMethod (c$, "createGlassPane", -function () { -var c = new javax.swing.JPanel (); -c.setName (this.getName () + ".glassPane"); -c.setVisible (false); -(c).setOpaque (false); -return c; -}); -Clazz_defineMethod (c$, "createRootLayout", -function () { -return Clazz_innerTypeInstance (javax.swing.JRootPane.RootLayout, this, null); -}); -Clazz_defineMethod (c$, "setJMenuBar", -function (menu) { -if (this.menuBar != null && this.menuBar.getParent () === this.layeredPane) this.layeredPane.remove (this.menuBar); -this.menuBar = menu; -if (this.menuBar != null) this.layeredPane.add (this.menuBar, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER); -}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "setMenuBar", -function (menu) { -if (this.menuBar != null && this.menuBar.getParent () === this.layeredPane) this.layeredPane.remove (this.menuBar); -this.menuBar = menu; -if (this.menuBar != null) this.layeredPane.add (this.menuBar, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER); -}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "getJMenuBar", -function () { -return this.menuBar; -}); -Clazz_defineMethod (c$, "getMenuBar", -function () { -return this.menuBar; -}); -Clazz_defineMethod (c$, "setContentPane", -function (content) { -if (content == null) throw new java.awt.IllegalComponentStateException ("contentPane cannot be set to null."); -if (this.contentPane != null && this.contentPane.getParent () === this.layeredPane) this.layeredPane.remove (this.contentPane); -this.contentPane = content; -this.layeredPane.add (this.contentPane, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER); -}, "java.awt.Container"); -Clazz_defineMethod (c$, "getContentPane", -function () { -return this.contentPane; -}); -Clazz_defineMethod (c$, "setLayeredPane", -function (layered) { -if (layered == null) throw new java.awt.IllegalComponentStateException ("layeredPane cannot be set to null."); -if (this.layeredPane != null && this.layeredPane.getParent () === this) this.remove (this.layeredPane); -this.layeredPane = layered; -this.add (this.layeredPane, -1); -}, "javax.swing.JLayeredPane"); -Clazz_defineMethod (c$, "getLayeredPane", -function () { -return this.layeredPane; -}); -Clazz_defineMethod (c$, "setGlassPane", -function (glass) { -if (glass == null) { -throw new NullPointerException ("glassPane cannot be set to null."); -}var visible = false; -if (this.glassPane != null && this.glassPane.getParent () === this) { -this.remove (this.glassPane); -visible = this.glassPane.isVisible (); -}glass.setVisible (visible); -this.glassPane = glass; -this.add (this.glassPane, 0); -if (visible) { -this.repaint (); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "getGlassPane", -function () { -return this.glassPane; -}); -Clazz_overrideMethod (c$, "isValidateRoot", -function () { -return true; -}); -Clazz_overrideMethod (c$, "isOptimizedDrawingEnabled", -function () { -return !this.glassPane.isVisible (); -}); -Clazz_defineMethod (c$, "addNotify", -function () { -Clazz_superCall (this, javax.swing.JRootPane, "addNotify", []); -this.enableEvents (8); -}); -Clazz_defineMethod (c$, "setDefaultButton", -function (defaultButton) { -var oldDefault = this.defaultButton; -if (oldDefault !== defaultButton) { -this.defaultButton = defaultButton; -if (oldDefault != null) { -oldDefault.repaint (); -}if (defaultButton != null) { -defaultButton.repaint (); -}}this.firePropertyChangeObject ("defaultButton", oldDefault, defaultButton); -}, "javax.swing.JButton"); -Clazz_defineMethod (c$, "getDefaultButton", -function () { -return this.defaultButton; -}); -Clazz_defineMethod (c$, "setUseTrueDoubleBuffering", -function (useTrueDoubleBuffering) { -this.useTrueDoubleBuffering = useTrueDoubleBuffering; -}, "~B"); -Clazz_defineMethod (c$, "getUseTrueDoubleBuffering", -function () { -return this.useTrueDoubleBuffering; -}); -Clazz_defineMethod (c$, "disableTrueDoubleBuffering", -function () { -}); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -this.addImplSAEM (comp, constraints, index); -if (this.glassPane != null && this.glassPane.getParent () === this && this.getComponent (0) !== this.glassPane) { -this.add (this.glassPane, 0); -}return comp; -}, "java.awt.Component,~O,~N"); -c$.$JRootPane$RootLayout$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, javax.swing.JRootPane, "RootLayout", null, java.awt.LayoutManager2); -Clazz_overrideMethod (c$, "preferredLayoutSize", -function (a) { -var b; -var c; -var d = this.b$["javax.swing.JRootPane"].getInsets (); -if (this.b$["javax.swing.JRootPane"].contentPane != null) { -b = this.b$["javax.swing.JRootPane"].contentPane.getPreferredSize (); -} else { -b = a.getSize (); -}if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { -c = this.b$["javax.swing.JRootPane"].menuBar.getPreferredSize (); -} else { -c = new java.awt.Dimension (0, 0); -}return new java.awt.Dimension (Math.max (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "minimumLayoutSize", -function (a) { -var b; -var c; -var d = this.b$["javax.swing.JRootPane"].getInsets (); -if (this.b$["javax.swing.JRootPane"].contentPane != null) { -b = this.b$["javax.swing.JRootPane"].contentPane.getMinimumSize (); -} else { -b = a.getSize (); -}if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { -c = this.b$["javax.swing.JRootPane"].menuBar.getMinimumSize (); -} else { -c = new java.awt.Dimension (0, 0); -}return new java.awt.Dimension (Math.max (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "maximumLayoutSize", -function (a) { -var b; -var c; -var d = this.b$["javax.swing.JRootPane"].getInsets (); -if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { -c = this.b$["javax.swing.JRootPane"].menuBar.getMaximumSize (); -} else { -c = new java.awt.Dimension (0, 0); -}if (this.b$["javax.swing.JRootPane"].contentPane != null) { -b = this.b$["javax.swing.JRootPane"].contentPane.getMaximumSize (); -} else { -b = new java.awt.Dimension (2147483647, 2147483647 - d.top - d.bottom - c.height - 1); -}return new java.awt.Dimension (Math.min (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "layoutContainer", -function (a) { -var b = a.getBounds (); -var c = this.b$["javax.swing.JRootPane"].getInsets (); -var d = 0; -var e = b.width - c.right - c.left; -var f = b.height - c.top - c.bottom; -if (this.b$["javax.swing.JRootPane"].layeredPane != null) { -this.b$["javax.swing.JRootPane"].layeredPane.setBounds (c.left, c.top, e, f); -}if (this.b$["javax.swing.JRootPane"].glassPane != null) { -this.b$["javax.swing.JRootPane"].glassPane.setBounds (c.left, c.top, e, f); -}if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { -var g = this.b$["javax.swing.JRootPane"].menuBar.getPreferredSize (); -this.b$["javax.swing.JRootPane"].menuBar.setBounds (0, 0, e, g.height); -d += g.height; -}if (this.b$["javax.swing.JRootPane"].contentPane != null) { -this.b$["javax.swing.JRootPane"].contentPane.setBounds (0, d, e, f - d); -}}, "java.awt.Container"); -Clazz_defineMethod (c$, "addLayoutComponent", -function (a, b) { -}, "~S,java.awt.Component"); -Clazz_overrideMethod (c$, "removeLayoutComponent", -function (a) { -}, "java.awt.Component"); -Clazz_defineMethod (c$, "addLayoutComponent", -function (a, b) { -}, "java.awt.Component,~O"); -Clazz_overrideMethod (c$, "getLayoutAlignmentX", -function (a) { -return 0.0; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayoutAlignmentY", -function (a) { -return 0.0; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "invalidateLayout", -function (a) { -}, "java.awt.Container"); -c$ = Clazz_p0p (); -}; -c$.$JRootPane$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing, "JRootPane$1", java.awt.BorderLayout); -Clazz_defineMethod (c$, "addLayoutComponent", -function (comp, constraints) { -if (constraints == null) { -constraints = "Center"; -}Clazz_superCall (this, javax.swing.JRootPane$1, "addLayoutComponent", [comp, constraints]); -}, "java.awt.Component,~O"); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.owner = null; -this.root = null; -this.press = false; -Clazz_instantialize (this, arguments); -}, javax.swing.JRootPane, "DefaultAction", javax.swing.AbstractAction); -Clazz_makeConstructor (c$, -function (a, b) { -Clazz_superConstructor (this, javax.swing.JRootPane.DefaultAction, []); -this.root = a; -this.press = b; -}, "javax.swing.JRootPane,~B"); -Clazz_defineMethod (c$, "setOwner", -function (a) { -this.owner = a; -}, "javax.swing.JButton"); -Clazz_overrideMethod (c$, "actionPerformed", -function (a) { -if (this.owner != null && javax.swing.SwingUtilities.getRootPane (this.owner) === this.root) { -var b = this.owner.getModel (); -if (this.press) { -b.setArmed (true); -b.setPressed (true); -} else { -b.setPressed (false); -}}}, "java.awt.event.ActionEvent"); -Clazz_overrideMethod (c$, "isEnabled", -function () { -return this.owner.getModel ().isEnabled (); -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"$uiClassID", "RootPaneUI", -"NONE", 0, -"FRAME", 1, -"PLAIN_DIALOG", 2, -"INFORMATION_DIALOG", 3, -"ERROR_DIALOG", 4, -"COLOR_CHOOSER_DIALOG", 5, -"FILE_CHOOSER_DIALOG", 6, -"QUESTION_DIALOG", 7, -"WARNING_DIALOG", 8); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.AbstractButton", "$.DefaultButtonModel"], "javax.swing.JToggleButton", ["java.awt.EventQueue", "java.awt.event.ActionEvent", "$.InputEvent", "$.ItemEvent", "javax.swing.UIManager"], function () { -c$ = Clazz_declareType (javax.swing, "JToggleButton", javax.swing.AbstractButton); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, false); -}); -Clazz_makeConstructor (c$, -function (icon) { -this.construct (null, icon, false); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (icon, selected) { -this.construct (null, icon, selected); -}, "javax.swing.Icon,~B"); -Clazz_makeConstructor (c$, -function (text) { -this.construct (text, null, false); -}, "~S"); -Clazz_makeConstructor (c$, -function (text, selected) { -this.construct (text, null, selected); -}, "~S,~B"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (text, icon) { -this.construct (text, icon, false); -}, "~S,javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text, icon, selected) { -Clazz_superConstructor (this, javax.swing.JToggleButton, []); -this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ()); -this.model.setSelected (selected); -this.init (text, icon); -}, "~S,javax.swing.Icon,~B"); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "ToggleButtonUI"; -}); -Clazz_overrideMethod (c$, "shouldUpdateSelectedStateFromAction", -function () { -return true; -}); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.JToggleButton, "ToggleButtonModel", javax.swing.DefaultButtonModel); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JToggleButton.ToggleButtonModel, []); -}); -Clazz_overrideMethod (c$, "isSelected", -function () { -return (this.stateMask & 2) != 0; -}); -Clazz_overrideMethod (c$, "setSelected", -function (a) { -var b = this.getGroup (); -if (b != null) { -b.setSelected (this, a); -a = b.isSelected (this); -}if (this.isSelected () == a) { -return; -}if (a) { -this.stateMask |= 2; -} else { -this.stateMask &= -3; -}this.fireStateChanged (); -this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this, this.isSelected () ? 1 : 2)); -}, "~B"); -Clazz_overrideMethod (c$, "setPressed", -function (a) { -if ((this.isPressed () == a) || !this.isEnabled ()) { -return; -}if (a == false && this.isArmed ()) { -this.setSelected (!this.isSelected ()); -}if (a) { -this.stateMask |= 4; -} else { -this.stateMask &= -5; -}this.fireStateChanged (); -if (!this.isPressed () && this.isArmed ()) { -var b = 0; -var c = java.awt.EventQueue.getCurrentEvent (); -if (Clazz_instanceOf (c, java.awt.event.InputEvent)) { -b = (c).getModifiers (); -} else if (Clazz_instanceOf (c, java.awt.event.ActionEvent)) { -b = (c).getModifiers (); -}this.fireActionPerformed ( new java.awt.event.ActionEvent (this, 1001, this.getActionCommand (), java.awt.EventQueue.getMostRecentEventTime (), b)); -}}, "~B"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"$uiClassID", "ToggleButtonUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.ItemSelectable"], "javax.swing.ButtonModel", null, function () { -Clazz_declareInterface (javax.swing, "ButtonModel", java.awt.ItemSelectable); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JToggleButton"], "javax.swing.JRadioButton", ["javax.swing.UIManager"], function () { -c$ = Clazz_declareType (javax.swing, "JRadioButton", javax.swing.JToggleButton); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, false); -}); -Clazz_makeConstructor (c$, -function (icon) { -this.construct (null, icon, false); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (icon, selected) { -this.construct (null, icon, selected); -}, "javax.swing.Icon,~B"); -Clazz_makeConstructor (c$, -function (text) { -this.construct (text, null, false); -}, "~S"); -Clazz_makeConstructor (c$, -function (text, selected) { -this.construct (text, null, selected); -}, "~S,~B"); -Clazz_makeConstructor (c$, -function (text, icon) { -this.construct (text, icon, false); -}, "~S,javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text, icon, selected) { -Clazz_superConstructor (this, javax.swing.JRadioButton, [text, icon, selected]); -this.setBorderPainted (false); -this.setHorizontalAlignment (10); -}, "~S,javax.swing.Icon,~B"); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "RadioButtonUI"; -}); -Clazz_overrideMethod (c$, "setIconFromAction", -function (a) { -}, "javax.swing.Action"); -Clazz_defineStatics (c$, -"$$uiClassID", "RadioButtonUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.applet.Applet", "javax.swing.RootPaneContainer"], "javax.swing.JApplet", ["java.awt.BorderLayout", "$.Color", "javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities"], function () { -c$ = Clazz_decorateAsClass (function () { -this.rootPane = null; -this.rootPaneCheckingEnabled = false; -this.transferHandler = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JApplet", java.applet.Applet, javax.swing.RootPaneContainer); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JApplet, []); -this.setJApplet (); -}); -Clazz_defineMethod (c$, "setJApplet", - function () { -this.setPanel (); -this.setForeground (java.awt.Color.black); -this.setBackground (java.awt.Color.white); -this.setLocale (javax.swing.JComponent.getDefaultLocale ()); -this.setLayout ( new java.awt.BorderLayout ()); -this.setRootPane (this.createRootPane ()); -this.setRootPaneCheckingEnabled (true); -this.setFocusTraversalPolicyProvider (true); -this.enableEvents (8); -}); -Clazz_defineMethod (c$, "createRootPane", -function () { -var rp = new javax.swing.JRootPane (); -rp.setOpaque (true); -return rp; -}); -Clazz_defineMethod (c$, "setTransferHandler", -function (newHandler) { -var oldHandler = this.transferHandler; -this.transferHandler = newHandler; -javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); -this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); -}, "javax.swing.TransferHandler"); -Clazz_defineMethod (c$, "getTransferHandler", -function () { -return this.transferHandler; -}); -Clazz_defineMethod (c$, "paint", -function (g) { -this.getContentPane ().paint (g); -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "setJMenuBar", -function (menuBar) { -this.getRootPane ().setMenuBar (menuBar); -}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "getJMenuBar", -function () { -return this.getRootPane ().getMenuBar (); -}); -Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", -function () { -return this.rootPaneCheckingEnabled; -}); -Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", -function (enabled) { -this.rootPaneCheckingEnabled = enabled; -}, "~B"); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -if (this.isRootPaneCheckingEnabled ()) { -return this.getContentPane ().add (comp, constraints, index); -}return this.addImplSAEM (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "remove", -function (comp) { -if (comp === this.rootPane) { -this.removeChild (comp); -} else { -this.getContentPane ().removeChild (comp); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "setLayout", -function (manager) { -if (this.isRootPaneCheckingEnabled ()) { -this.getContentPane ().setLayout (manager); -} else { -Clazz_superCall (this, javax.swing.JApplet, "setLayout", [manager]); -}}, "java.awt.LayoutManager"); -Clazz_overrideMethod (c$, "getRootPane", -function () { -return this.rootPane; -}); -Clazz_defineMethod (c$, "setRootPane", -function (root) { -if (this.rootPane != null) { -this.remove (this.rootPane); -}this.rootPane = root; -if (this.rootPane != null) { -var checkingEnabled = this.isRootPaneCheckingEnabled (); -try { -this.setRootPaneCheckingEnabled (false); -this.add (this.rootPane, "Center"); -} finally { -this.setRootPaneCheckingEnabled (checkingEnabled); -} -}}, "javax.swing.JRootPane"); -Clazz_overrideMethod (c$, "getContentPane", -function () { -return this.getRootPane ().getContentPane (); -}); -Clazz_overrideMethod (c$, "setContentPane", -function (contentPane) { -this.getRootPane ().setContentPane (contentPane); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayeredPane", -function () { -return this.getRootPane ().getLayeredPane (); -}); -Clazz_overrideMethod (c$, "setLayeredPane", -function (layeredPane) { -this.getRootPane ().setLayeredPane (layeredPane); -}, "javax.swing.JLayeredPane"); -Clazz_overrideMethod (c$, "getGlassPane", -function () { -return this.getRootPane ().getGlassPane (); -}); -Clazz_overrideMethod (c$, "setGlassPane", -function (glassPane) { -this.getRootPane ().setGlassPane (glassPane); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getGraphics", -function () { -javax.swing.JComponent.getGraphicsInvoked (this); -return Clazz_superCall (this, javax.swing.JApplet, "getGraphics", []); -}); -Clazz_defineMethod (c$, "repaint", -function (time, x, y, width, height) { -if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { -System.out.println ("repaintNow " + this); -javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); -} else { -Clazz_superCall (this, javax.swing.JApplet, "repaint", [time, x, y, width, height]); -}}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "repaintNow", -function () { -this.repaint (100, 0, 0, this.getWidth (), this.getHeight ()); -}); -Clazz_defineMethod (c$, "paramString", -function () { -var rootPaneString = (this.rootPane != null ? this.rootPane.toString () : ""); -var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JApplet, "paramString", []) + ",rootPane=" + rootPaneString + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.lang.Thread"], ["java.awt.EventQueueItem", "$.EventQueue", "$.Queue"], ["java.lang.Error", "java.lang.reflect.InvocationTargetException", "java.util.EmptyStackException", "java.awt.ActiveEvent", "$.Component", "$.EventDispatchThread", "$.SentEvent", "$.SequencedEvent", "$.Toolkit", "java.awt.event.ActionEvent", "$.FocusEvent", "$.InputEvent", "$.InputMethodEvent", "$.InvocationEvent", "$.KeyEvent", "$.MouseEvent", "$.PaintEvent", "$.WindowEvent", "jssun.awt.AWTAutoShutdown", "$.AppContext", "$.PeerEvent", "$.SunToolkit", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.queues = null; -this.nextQueue = null; -this.previousQueue = null; -this.dispatchThread = null; -this.threadGroup = null; -this.mostRecentEventTime = 0; -this.currentEvent = null; -this.waitForID = 0; -this.name = null; -Clazz_instantialize (this, arguments); -}, java.awt, "EventQueue"); -Clazz_prepareFields (c$, function () { -this.queues = new Array (4); -this.threadGroup = Thread.currentThread ().getThreadGroup (); -this.mostRecentEventTime = System.currentTimeMillis (); -this.name = "AWT-EventQueue-" + java.awt.EventQueue.nextThreadNum (); -}); -c$.nextThreadNum = Clazz_defineMethod (c$, "nextThreadNum", - function () { -return java.awt.EventQueue.threadInitNumber++; -}); -c$.noEvents = Clazz_defineMethod (c$, "noEvents", -function (eventQueue) { -return eventQueue.noEvents (); -}, "java.awt.EventQueue"); -c$.getNextQueue = Clazz_defineMethod (c$, "getNextQueue", -function (eventQueue) { -return eventQueue.nextQueue; -}, "java.awt.EventQueue"); -c$.removeSourceEvents = Clazz_defineMethod (c$, "removeSourceEvents", -function (eventQueue, source, removeAllEvents) { -eventQueue.removeSourceEvents (source, removeAllEvents); -}, "java.awt.EventQueue,~O,~B"); -Clazz_makeConstructor (c$, -function () { -for (var i = 0; i < 4; i++) { -this.queues[i] = new java.awt.Queue (); -} -}); -Clazz_defineMethod (c$, "postEvent", -function (event) { -jssun.awt.SunToolkit.flushPendingEvents (); -this.postEventPrivate (event); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "postEventPrivate", -function (theEvent) { -theEvent.isPosted = true; -{ -if (this.dispatchThread == null && this.nextQueue == null) { -if (theEvent.getSource () === jssun.awt.AWTAutoShutdown.getInstance ()) { -return; -} else { -this.initDispatchThread (); -}}if (this.nextQueue != null) { -this.nextQueue.postEventPrivate (theEvent); -return; -}this.postEventNow (theEvent, java.awt.EventQueue.getPriority (theEvent)); -}}, "java.awt.AWTEvent"); -c$.getPriority = Clazz_defineMethod (c$, "getPriority", - function (theEvent) { -if (Clazz_instanceOf (theEvent, jssun.awt.PeerEvent)) { -var flags = (theEvent).getFlags (); -if ((flags & 2) != 0) return 3; -if ((flags & 1) != 0) return 2; -if ((flags & 4) != 0) return 0; -}switch (theEvent.getID ()) { -case 1201: -case 800: -case 801: -return 0; -default: -return 1; -} -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "postEventNow", - function (theEvent, priority) { -if (this.coalesceEvent (theEvent, priority)) { -return; -}var newItem = new java.awt.EventQueueItem (theEvent); -this.cacheEQItem (newItem); -if (this.queues[priority].head == null) { -var shouldNotify = this.noEvents (); -this.queues[priority].head = this.queues[priority].tail = newItem; -if (shouldNotify) { -if (theEvent.getSource () !== jssun.awt.AWTAutoShutdown.getInstance ()) { -jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadBusy (this.dispatchThread); -}}} else { -this.queues[priority].tail.next = newItem; -this.queues[priority].tail = newItem; -}}, "java.awt.AWTEvent,~N"); -Clazz_defineMethod (c$, "coalescePaintEvent", - function (e) { -var sourcePeer = (e.getSource ()).peer; -if (sourcePeer != null) { -sourcePeer.coalescePaintEvent (e); -}var cache = (e.getSource ()).eventCache; -if (cache == null) { -return false; -}var index = java.awt.EventQueue.eventToCacheIndex (e); -if (index != -1 && cache[index] != null) { -var merged = this.mergePaintEvents (e, cache[index].event); -if (merged != null) { -cache[index].event = merged; -return true; -}}return false; -}, "java.awt.event.PaintEvent"); -Clazz_defineMethod (c$, "mergePaintEvents", - function (a, b) { -var aRect = a.getUpdateRect (); -var bRect = b.getUpdateRect (); -if (bRect.contains (aRect)) { -return b; -}if (aRect.contains (bRect)) { -return a; -}return null; -}, "java.awt.event.PaintEvent,java.awt.event.PaintEvent"); -Clazz_defineMethod (c$, "coalesceMouseEvent", - function (e) { -var cache = (e.getSource ()).eventCache; -if (cache == null) { -return false; -}var index = java.awt.EventQueue.eventToCacheIndex (e); -if (index != -1 && cache[index] != null) { -cache[index].event = e; -return true; -}return false; -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "coalescePeerEvent", - function (e) { -var cache = (e.getSource ()).eventCache; -if (cache == null) { -return false; -}var index = java.awt.EventQueue.eventToCacheIndex (e); -if (index != -1 && cache[index] != null) { -e = e.coalesceEvents (cache[index].event); -if (e != null) { -cache[index].event = e; -return true; -} else { -cache[index] = null; -}}return false; -}, "jssun.awt.PeerEvent"); -Clazz_defineMethod (c$, "coalesceOtherEvent", - function (e, priority) { -var id = e.getID (); -var source = e.getSource (); -for (var entry = this.queues[priority].head; entry != null; entry = entry.next) { -if (entry.event.getSource () === source && entry.id == id) { -var coalescedEvent = source.coalesceEvents (entry.event, e); -if (coalescedEvent != null) { -entry.event = coalescedEvent; -return true; -}}} -return false; -}, "java.awt.AWTEvent,~N"); -Clazz_defineMethod (c$, "coalesceEvent", - function (e, priority) { -if (!(Clazz_instanceOf (e.getSource (), java.awt.Component))) { -return false; -}if (Clazz_instanceOf (e, jssun.awt.PeerEvent)) { -return this.coalescePeerEvent (e); -}if ((e.getSource ()).isCoalescingEnabled () && this.coalesceOtherEvent (e, priority)) { -return true; -}if (Clazz_instanceOf (e, java.awt.event.PaintEvent)) { -return this.coalescePaintEvent (e); -}if (Clazz_instanceOf (e, java.awt.event.MouseEvent)) { -return this.coalesceMouseEvent (e); -}return false; -}, "java.awt.AWTEvent,~N"); -Clazz_defineMethod (c$, "cacheEQItem", - function (entry) { -var index = java.awt.EventQueue.eventToCacheIndex (entry.event); -if (index != -1 && Clazz_instanceOf (entry.event.getSource (), java.awt.Component)) { -var source = entry.event.getSource (); -if (source.eventCache == null) { -source.eventCache = new Array (5); -}source.eventCache[index] = entry; -}}, "java.awt.EventQueueItem"); -Clazz_defineMethod (c$, "uncacheEQItem", - function (entry) { -var index = java.awt.EventQueue.eventToCacheIndex (entry.event); -if (index != -1 && Clazz_instanceOf (entry.event.getSource (), java.awt.Component)) { -var source = entry.event.getSource (); -if (source.eventCache == null) { -return; -}source.eventCache[index] = null; -}}, "java.awt.EventQueueItem"); -c$.eventToCacheIndex = Clazz_defineMethod (c$, "eventToCacheIndex", - function (e) { -switch (e.getID ()) { -case 800: -return 0; -case 801: -return 1; -case 503: -return 2; -case 506: -return 3; -default: -return -1; -} -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "noEvents", - function () { -for (var i = 0; i < 4; i++) { -if (this.queues[i].head != null) { -return false; -}} -return true; -}); -Clazz_defineMethod (c$, "getNextEvent", -function () { -jssun.awt.SunToolkit.flushPendingEvents (); -{ -for (var i = 3; i >= 0; i--) { -if (this.queues[i].head != null) { -var entry = this.queues[i].head; -this.queues[i].head = entry.next; -if (entry.next == null) { -this.queues[i].tail = null; -}this.uncacheEQItem (entry); -return entry.event; -}} -jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadFree (this.dispatchThread); -}return null; -}); -Clazz_defineMethod (c$, "getNextEventForID", -function (id) { -jssun.awt.SunToolkit.flushPendingEvents (); -{ -for (var i = 0; i < 4; i++) { -for (var entry = this.queues[i].head, prev = null; entry != null; prev = entry, entry = entry.next) { -if (entry.id == id) { -if (prev == null) { -this.queues[i].head = entry.next; -} else { -prev.next = entry.next; -}if (this.queues[i].tail === entry) { -this.queues[i].tail = prev; -}this.uncacheEQItem (entry); -return entry.event; -}} -} -this.waitForID = id; -this.waitForID = 0; -}return null; -}, "~N"); -Clazz_defineMethod (c$, "peekEvent", -function () { -for (var i = 3; i >= 0; i--) { -if (this.queues[i].head != null) { -return this.queues[i].head.event; -}} -return null; -}); -Clazz_defineMethod (c$, "peekEvent", -function (id) { -for (var i = 3; i >= 0; i--) { -var q = this.queues[i].head; -for (; q != null; q = q.next) { -if (q.id == id) { -return q.event; -}} -} -return null; -}, "~N"); -Clazz_defineMethod (c$, "dispatchEvent", -function (event) { -var src = event.getSource (); -this.dispatchEventImpl (event, src, false); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "dispatchEventAndWait", -function (event, src) { -this.dispatchEventImpl (event, src, true); -}, "java.awt.AWTEvent,~O"); -Clazz_defineMethod (c$, "dispatchEventImpl", - function (event, src, andWait) { -event.isPosted = true; -if (Clazz_instanceOf (event, java.awt.ActiveEvent)) { -this.setCurrentEventAndMostRecentTimeImpl (event); -swingjs.JSToolkit.dispatchEvent (event, null, andWait); -} else if (Clazz_instanceOf (src, java.awt.Component)) { -swingjs.JSToolkit.dispatchEvent (event, src, andWait); -event.dispatched (); -} else if (Clazz_instanceOf (src, jssun.awt.AWTAutoShutdown)) { -if (this.noEvents ()) { -this.dispatchThread.stopDispatching (); -}} else { -System.err.println ("unable to dispatch event: " + event); -}}, "java.awt.AWTEvent,~O,~B"); -c$.getMostRecentEventTime = Clazz_defineMethod (c$, "getMostRecentEventTime", -function () { -return 0; -}); -Clazz_defineMethod (c$, "getMostRecentEventTimeEx", -function () { -return this.mostRecentEventTime; -}); -c$.getCurrentEvent = Clazz_defineMethod (c$, "getCurrentEvent", -function () { -return java.awt.Toolkit.getEventQueue ().getCurrentEventImpl (); -}); -Clazz_defineMethod (c$, "getCurrentEventImpl", - function () { -return (swingjs.JSToolkit.isDispatchThread () ? (this.currentEvent) : null); -}); -Clazz_defineMethod (c$, "push", -function (newEventQueue) { -if (this.nextQueue != null) { -this.nextQueue.push (newEventQueue); -return; -}{ -while (this.peekEvent () != null) { -try { -newEventQueue.postEventPrivate (this.getNextEvent ()); -} catch (ie) { -if (Clazz_exceptionOf (ie, InterruptedException)) { -} else { -throw ie; -} -} -} -newEventQueue.previousQueue = this; -}if (this.dispatchThread != null) { -this.dispatchThread.stopDispatchingLater (); -}this.nextQueue = newEventQueue; -var appContext = jssun.awt.AppContext.getAppContext (); -if (appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY) === this) { -appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, newEventQueue); -}}, "java.awt.EventQueue"); -Clazz_defineMethod (c$, "pop", -function () { -var prev = this.previousQueue; -{ -{ -if (this.nextQueue != null) { -this.nextQueue.pop (); -return; -}if (this.previousQueue == null) { -throw new java.util.EmptyStackException (); -}this.previousQueue.nextQueue = null; -while (this.peekEvent () != null) { -try { -this.previousQueue.postEventPrivate (this.getNextEvent ()); -} catch (ie) { -if (Clazz_exceptionOf (ie, InterruptedException)) { -} else { -throw ie; -} -} -} -var appContext = jssun.awt.AppContext.getAppContext (); -if (appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY) === this) { -appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, this.previousQueue); -}this.previousQueue = null; -}}var dt = this.dispatchThread; -if (dt != null) { -dt.stopDispatching (); -}}); -c$.isDispatchThread = Clazz_defineMethod (c$, "isDispatchThread", -function () { -return swingjs.JSToolkit.isDispatchThread (); -}); -Clazz_defineMethod (c$, "initDispatchThread", -function () { -{ -if (this.dispatchThread == null) { -var t = new java.awt.EventDispatchThread (this.threadGroup, this.name, this); -jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadBusy (t); -this.dispatchThread = t; -this.dispatchThread.start (); -}}}); -Clazz_defineMethod (c$, "detachDispatchThread", -function () { -this.dispatchThread = null; -}); -Clazz_defineMethod (c$, "getDispatchThread", -function () { -return this.dispatchThread; -}); -Clazz_defineMethod (c$, "removeSourceEvents", -function (source, removeAllEvents) { -jssun.awt.SunToolkit.flushPendingEvents (); -{ -for (var i = 0; i < 4; i++) { -var entry = this.queues[i].head; -var prev = null; -while (entry != null) { -if ((entry.event.getSource () === source) && (removeAllEvents || !(Clazz_instanceOf (entry.event, java.awt.SequencedEvent) || Clazz_instanceOf (entry.event, java.awt.SentEvent) || Clazz_instanceOf (entry.event, java.awt.event.FocusEvent) || Clazz_instanceOf (entry.event, java.awt.event.WindowEvent) || Clazz_instanceOf (entry.event, java.awt.event.KeyEvent) || Clazz_instanceOf (entry.event, java.awt.event.InputMethodEvent)))) { -if (Clazz_instanceOf (entry.event, java.awt.SequencedEvent)) { -(entry.event).dispose (); -}if (Clazz_instanceOf (entry.event, java.awt.SentEvent)) { -(entry.event).dispose (); -}if (prev == null) { -this.queues[i].head = entry.next; -} else { -prev.next = entry.next; -}this.uncacheEQItem (entry); -} else { -prev = entry; -}entry = entry.next; -} -this.queues[i].tail = prev; -} -}}, "~O,~B"); -c$.setCurrentEventAndMostRecentTime = Clazz_defineMethod (c$, "setCurrentEventAndMostRecentTime", -function (e) { -java.awt.Toolkit.getEventQueue ().setCurrentEventAndMostRecentTimeImpl (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "setCurrentEventAndMostRecentTimeImpl", - function (e) { -if (swingjs.JSToolkit.isDispatchThread ()) { -return; -}this.currentEvent = e; -var mostRecentEventTime2 = -9223372036854775808; -if (Clazz_instanceOf (e, java.awt.event.InputEvent)) { -var ie = e; -mostRecentEventTime2 = ie.getWhen (); -} else if (Clazz_instanceOf (e, java.awt.event.InputMethodEvent)) { -var ime = e; -mostRecentEventTime2 = ime.getWhen (); -} else if (Clazz_instanceOf (e, java.awt.event.ActionEvent)) { -var ae = e; -mostRecentEventTime2 = ae.getWhen (); -} else if (Clazz_instanceOf (e, java.awt.event.InvocationEvent)) { -var ie = e; -mostRecentEventTime2 = ie.getWhen (); -}this.mostRecentEventTime = Math.max (this.mostRecentEventTime, mostRecentEventTime2); -}, "java.awt.AWTEvent"); -c$.invokeLater = Clazz_defineMethod (c$, "invokeLater", -function (runnable) { -java.awt.Toolkit.getEventQueue ().postEvent ( new java.awt.event.InvocationEvent (java.awt.Toolkit.getDefaultToolkit (), runnable)); -}, "Runnable"); -c$.invokeAndWait = Clazz_defineMethod (c$, "invokeAndWait", -function (runnable) { -java.awt.EventQueue.invokeAndWaitStatic (java.awt.Toolkit.getDefaultToolkit (), runnable); -}, "Runnable"); -c$.invokeAndWaitStatic = Clazz_defineMethod (c$, "invokeAndWaitStatic", - function (source, runnable) { -if (java.awt.EventQueue.isDispatchThread ()) { -throw new Error ("Cannot call invokeAndWait from the event dispatcher thread"); -}var event = new java.awt.event.InvocationEvent (source, runnable, null, true); -swingjs.JSToolkit.dispatchEvent (event, null, true); -var eventThrowable = event.getThrowable (); -if (eventThrowable != null) { -throw new java.lang.reflect.InvocationTargetException (eventThrowable); -}}, "~O,Runnable"); -Clazz_defineMethod (c$, "wakeup", -function (isShutdown) { -{ -if (this.nextQueue != null) { -this.nextQueue.wakeup (isShutdown); -} else if (this.dispatchThread != null) { -try { -this.dispatchThread.start (); -} catch (e) { -if (Clazz_exceptionOf (e, IllegalThreadStateException)) { -this.dispatchThread.run (); -} else { -throw e; -} -} -} else if (!isShutdown) { -this.initDispatchThread (); -}}}, "~B"); -Clazz_defineStatics (c$, -"threadInitNumber", 0, -"LOW_PRIORITY", 0, -"NORM_PRIORITY", 1, -"HIGH_PRIORITY", 2, -"ULTIMATE_PRIORITY", 3, -"NUM_PRIORITIES", 4, -"PAINT", 0, -"UPDATE", 1, -"MOVE", 2, -"DRAG", 3, -"PEER", 4, -"CACHE_LENGTH", 5); -c$ = Clazz_decorateAsClass (function () { -this.head = null; -this.tail = null; -Clazz_instantialize (this, arguments); -}, java.awt, "Queue"); -c$ = Clazz_decorateAsClass (function () { -this.event = null; -this.id = 0; -this.next = null; -Clazz_instantialize (this, arguments); -}, java.awt, "EventQueueItem"); -Clazz_makeConstructor (c$, -function (evt) { -this.event = evt; -this.id = evt.getID (); -}, "java.awt.AWTEvent"); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.event.ActionListener", "$.AdjustmentListener", "$.ComponentListener", "$.ContainerListener", "$.FocusListener", "$.HierarchyBoundsListener", "$.HierarchyListener", "$.InputMethodListener", "$.ItemListener", "$.KeyListener", "$.MouseListener", "$.MouseMotionListener", "$.MouseWheelListener", "$.TextListener", "$.WindowFocusListener", "$.WindowListener", "$.WindowStateListener"], "java.awt.AWTEventMulticaster", ["java.lang.NullPointerException", "java.lang.reflect.Array"], function () { -c$ = Clazz_decorateAsClass (function () { -this.a = null; -this.b = null; -Clazz_instantialize (this, arguments); -}, java.awt, "AWTEventMulticaster", null, [java.awt.event.ComponentListener, java.awt.event.ContainerListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.WindowListener, java.awt.event.WindowFocusListener, java.awt.event.WindowStateListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.AdjustmentListener, java.awt.event.TextListener, java.awt.event.InputMethodListener, java.awt.event.HierarchyListener, java.awt.event.HierarchyBoundsListener, java.awt.event.MouseWheelListener]); -Clazz_makeConstructor (c$, -function (a, b) { -this.a = a; -this.b = b; -}, "java.util.EventListener,java.util.EventListener"); -Clazz_defineMethod (c$, "remove", -function (oldl) { -if (oldl === this.a) return this.b; -if (oldl === this.b) return this.a; -var a2 = java.awt.AWTEventMulticaster.removeInternal (this.a, oldl); -var b2 = java.awt.AWTEventMulticaster.removeInternal (this.b, oldl); -if (a2 === this.a && b2 === this.b) { -return this; -}return java.awt.AWTEventMulticaster.addInternal (a2, b2); -}, "java.util.EventListener"); -Clazz_defineMethod (c$, "componentResized", -function (e) { -(this.a).componentResized (e); -(this.b).componentResized (e); -}, "java.awt.event.ComponentEvent"); -Clazz_defineMethod (c$, "componentMoved", -function (e) { -(this.a).componentMoved (e); -(this.b).componentMoved (e); -}, "java.awt.event.ComponentEvent"); -Clazz_defineMethod (c$, "componentShown", -function (e) { -(this.a).componentShown (e); -(this.b).componentShown (e); -}, "java.awt.event.ComponentEvent"); -Clazz_defineMethod (c$, "componentHidden", -function (e) { -(this.a).componentHidden (e); -(this.b).componentHidden (e); -}, "java.awt.event.ComponentEvent"); -Clazz_defineMethod (c$, "componentAdded", -function (e) { -(this.a).componentAdded (e); -(this.b).componentAdded (e); -}, "java.awt.event.ContainerEvent"); -Clazz_defineMethod (c$, "componentRemoved", -function (e) { -(this.a).componentRemoved (e); -(this.b).componentRemoved (e); -}, "java.awt.event.ContainerEvent"); -Clazz_defineMethod (c$, "focusGained", -function (e) { -(this.a).focusGained (e); -(this.b).focusGained (e); -}, "java.awt.event.FocusEvent"); -Clazz_defineMethod (c$, "focusLost", -function (e) { -(this.a).focusLost (e); -(this.b).focusLost (e); -}, "java.awt.event.FocusEvent"); -Clazz_defineMethod (c$, "keyTyped", -function (e) { -(this.a).keyTyped (e); -(this.b).keyTyped (e); -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "keyPressed", -function (e) { -(this.a).keyPressed (e); -(this.b).keyPressed (e); -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "keyReleased", -function (e) { -(this.a).keyReleased (e); -(this.b).keyReleased (e); -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "mouseClicked", -function (e) { -(this.a).mouseClicked (e); -(this.b).mouseClicked (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mousePressed", -function (e) { -(this.a).mousePressed (e); -(this.b).mousePressed (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseReleased", -function (e) { -(this.a).mouseReleased (e); -(this.b).mouseReleased (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseEntered", -function (e) { -(this.a).mouseEntered (e); -(this.b).mouseEntered (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseExited", -function (e) { -(this.a).mouseExited (e); -(this.b).mouseExited (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseDragged", -function (e) { -(this.a).mouseDragged (e); -(this.b).mouseDragged (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseMoved", -function (e) { -(this.a).mouseMoved (e); -(this.b).mouseMoved (e); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "windowOpened", -function (e) { -(this.a).windowOpened (e); -(this.b).windowOpened (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowClosing", -function (e) { -(this.a).windowClosing (e); -(this.b).windowClosing (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowClosed", -function (e) { -(this.a).windowClosed (e); -(this.b).windowClosed (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowIconified", -function (e) { -(this.a).windowIconified (e); -(this.b).windowIconified (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowDeiconified", -function (e) { -(this.a).windowDeiconified (e); -(this.b).windowDeiconified (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowActivated", -function (e) { -(this.a).windowActivated (e); -(this.b).windowActivated (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowDeactivated", -function (e) { -(this.a).windowDeactivated (e); -(this.b).windowDeactivated (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowStateChanged", -function (e) { -(this.a).windowStateChanged (e); -(this.b).windowStateChanged (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowGainedFocus", -function (e) { -(this.a).windowGainedFocus (e); -(this.b).windowGainedFocus (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowLostFocus", -function (e) { -(this.a).windowLostFocus (e); -(this.b).windowLostFocus (e); -}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "actionPerformed", -function (e) { -(this.a).actionPerformed (e); -(this.b).actionPerformed (e); -}, "java.awt.event.ActionEvent"); -Clazz_defineMethod (c$, "itemStateChanged", -function (e) { -(this.a).itemStateChanged (e); -(this.b).itemStateChanged (e); -}, "java.awt.event.ItemEvent"); -Clazz_defineMethod (c$, "adjustmentValueChanged", -function (e) { -(this.a).adjustmentValueChanged (e); -(this.b).adjustmentValueChanged (e); -}, "java.awt.event.AdjustmentEvent"); -Clazz_defineMethod (c$, "textValueChanged", -function (e) { -(this.a).textValueChanged (e); -(this.b).textValueChanged (e); -}, "java.awt.event.TextEvent"); -Clazz_defineMethod (c$, "inputMethodTextChanged", -function (e) { -(this.a).inputMethodTextChanged (e); -(this.b).inputMethodTextChanged (e); -}, "java.awt.event.InputMethodEvent"); -Clazz_defineMethod (c$, "caretPositionChanged", -function (e) { -(this.a).caretPositionChanged (e); -(this.b).caretPositionChanged (e); -}, "java.awt.event.InputMethodEvent"); -Clazz_defineMethod (c$, "hierarchyChanged", -function (e) { -(this.a).hierarchyChanged (e); -(this.b).hierarchyChanged (e); -}, "java.awt.event.HierarchyEvent"); -Clazz_defineMethod (c$, "ancestorMoved", -function (e) { -(this.a).ancestorMoved (e); -(this.b).ancestorMoved (e); -}, "java.awt.event.HierarchyEvent"); -Clazz_defineMethod (c$, "ancestorResized", -function (e) { -(this.a).ancestorResized (e); -(this.b).ancestorResized (e); -}, "java.awt.event.HierarchyEvent"); -Clazz_defineMethod (c$, "mouseWheelMoved", -function (e) { -(this.a).mouseWheelMoved (e); -(this.b).mouseWheelMoved (e); -}, "java.awt.event.MouseWheelEvent"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.ComponentListener,java.awt.event.ComponentListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.ContainerListener,java.awt.event.ContainerListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.FocusListener,java.awt.event.FocusListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.KeyListener,java.awt.event.KeyListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.MouseListener,java.awt.event.MouseListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.MouseMotionListener,java.awt.event.MouseMotionListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.WindowListener,java.awt.event.WindowListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.WindowStateListener,java.awt.event.WindowStateListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.WindowFocusListener,java.awt.event.WindowFocusListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.ActionListener,java.awt.event.ActionListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.ItemListener,java.awt.event.ItemListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.AdjustmentListener,java.awt.event.AdjustmentListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.TextListener,java.awt.event.TextListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.InputMethodListener,java.awt.event.InputMethodListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.HierarchyListener,java.awt.event.HierarchyListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.HierarchyBoundsListener,java.awt.event.HierarchyBoundsListener"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return java.awt.AWTEventMulticaster.addInternal (a, b); -}, "java.awt.event.MouseWheelListener,java.awt.event.MouseWheelListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.ComponentListener,java.awt.event.ComponentListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.ContainerListener,java.awt.event.ContainerListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.FocusListener,java.awt.event.FocusListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.KeyListener,java.awt.event.KeyListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.MouseListener,java.awt.event.MouseListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.MouseMotionListener,java.awt.event.MouseMotionListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.WindowListener,java.awt.event.WindowListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.WindowStateListener,java.awt.event.WindowStateListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.WindowFocusListener,java.awt.event.WindowFocusListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.ActionListener,java.awt.event.ActionListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.ItemListener,java.awt.event.ItemListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.AdjustmentListener,java.awt.event.AdjustmentListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.TextListener,java.awt.event.TextListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.InputMethodListener,java.awt.event.InputMethodListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.HierarchyListener,java.awt.event.HierarchyListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.HierarchyBoundsListener,java.awt.event.HierarchyBoundsListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return java.awt.AWTEventMulticaster.removeInternal (l, oldl); -}, "java.awt.event.MouseWheelListener,java.awt.event.MouseWheelListener"); -c$.addInternal = Clazz_defineMethod (c$, "addInternal", -function (a, b) { -if (a == null) return b; -if (b == null) return a; -return new java.awt.AWTEventMulticaster (a, b); -}, "java.util.EventListener,java.util.EventListener"); -c$.removeInternal = Clazz_defineMethod (c$, "removeInternal", -function (l, oldl) { -if (l === oldl || l == null) { -return null; -} else if (Clazz_instanceOf (l, java.awt.AWTEventMulticaster)) { -return (l).remove (oldl); -} else { -return l; -}}, "java.util.EventListener,java.util.EventListener"); -c$.getListenerCount = Clazz_defineMethod (c$, "getListenerCount", - function (l, listenerType) { -if (Clazz_instanceOf (l, java.awt.AWTEventMulticaster)) { -var mc = l; -return java.awt.AWTEventMulticaster.getListenerCount (mc.a, listenerType) + java.awt.AWTEventMulticaster.getListenerCount (mc.b, listenerType); -} else { -return listenerType.isInstance (l) ? 1 : 0; -}}, "java.util.EventListener,Class"); -c$.populateListenerArray = Clazz_defineMethod (c$, "populateListenerArray", - function (a, l, index) { -if (Clazz_instanceOf (l, java.awt.AWTEventMulticaster)) { -var mc = l; -var lhs = java.awt.AWTEventMulticaster.populateListenerArray (a, mc.a, index); -return java.awt.AWTEventMulticaster.populateListenerArray (a, mc.b, lhs); -} else if (a.getClass ().getComponentType ().isInstance (l)) { -a[index] = l; -return index + 1; -} else { -return index; -}}, "~A,java.util.EventListener,~N"); -c$.getListeners = Clazz_defineMethod (c$, "getListeners", -function (l, listenerType) { -if (listenerType == null) { -throw new NullPointerException ("Listener type should not be null"); -}var n = java.awt.AWTEventMulticaster.getListenerCount (l, listenerType); -var result = java.lang.reflect.Array.newInstance (listenerType, n); -java.awt.AWTEventMulticaster.populateListenerArray (result, l, 0); -return result; -}, "java.util.EventListener,Class"); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.util.EventObject"], "java.awt.AWTEvent", ["java.awt.Component", "java.awt.peer.LightweightPeer"], function () { -c$ = Clazz_decorateAsClass (function () { -this.bdata = null; -this.id = 0; -this.num = 0; -this.consumed = false; -this.focusManagerIsDispatching = false; -this.isPosted = false; -Clazz_instantialize (this, arguments); -}, java.awt, "AWTEvent", java.util.EventObject); -Clazz_makeConstructor (c$, -function (event) { -this.construct (event.target, event.id); -}, "java.awt.Event"); -Clazz_makeConstructor (c$, -function (source, id) { -Clazz_superConstructor (this, java.awt.AWTEvent, [source]); -this.id = id; -this.num = ++java.awt.AWTEvent.idnum; -switch (id) { -case 1001: -case 701: -case 601: -case 900: -this.consumed = true; -break; -default: -} -}, "~O,~N"); -Clazz_defineMethod (c$, "setSource", -function (newSource) { -if (this.source === newSource) { -return; -}var comp = null; -if (Clazz_instanceOf (newSource, java.awt.Component)) { -comp = newSource; -while (comp != null && comp.peer != null && (Clazz_instanceOf (comp.peer, java.awt.peer.LightweightPeer))) { -comp = comp.parent; -} -}this.source = newSource; -}, "~O"); -Clazz_defineMethod (c$, "getID", -function () { -return this.id; -}); -Clazz_overrideMethod (c$, "toString", -function () { -var srcName = null; -if (Clazz_instanceOf (this.source, java.awt.Component)) { -srcName = (this.source).getName (); -}return this.getClass ().getName () + "[" + this.paramString () + "] on " + (srcName != null ? srcName : this.source); -}); -Clazz_defineMethod (c$, "paramString", -function () { -return ""; -}); -Clazz_defineMethod (c$, "consume", -function () { -switch (this.id) { -case 401: -case 402: -case 501: -case 502: -case 503: -case 506: -case 504: -case 505: -case 507: -case 1100: -case 1101: -this.consumed = true; -break; -default: -} -}); -Clazz_defineMethod (c$, "isConsumed", -function () { -return this.consumed; -}); -Clazz_defineMethod (c$, "copyPrivateDataInto", -function (that) { -that.bdata = this.bdata; -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "dispatched", -function () { -}); -Clazz_defineStatics (c$, -"idnum", 0, -"COMPONENT_EVENT_MASK", 0x01, -"CONTAINER_EVENT_MASK", 0x02, -"FOCUS_EVENT_MASK", 0x04, -"KEY_EVENT_MASK", 0x08, -"MOUSE_EVENT_MASK", 0x10, -"MOUSE_MOTION_EVENT_MASK", 0x20, -"WINDOW_EVENT_MASK", 0x40, -"ACTION_EVENT_MASK", 0x80, -"ADJUSTMENT_EVENT_MASK", 0x100, -"ITEM_EVENT_MASK", 0x200, -"TEXT_EVENT_MASK", 0x400, -"INPUT_METHOD_EVENT_MASK", 0x800, -"INPUT_METHODS_ENABLED_MASK", 0x1000, -"PAINT_EVENT_MASK", 0x2000, -"INVOCATION_EVENT_MASK", 0x4000, -"HIERARCHY_EVENT_MASK", 0x8000, -"HIERARCHY_BOUNDS_EVENT_MASK", 0x10000, -"MOUSE_WHEEL_EVENT_MASK", 0x20000, -"WINDOW_STATE_EVENT_MASK", 0x40000, -"WINDOW_FOCUS_EVENT_MASK", 0x80000, -"RESERVED_ID_MAX", 1999); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.util.EventListener"], "java.awt.event.AWTEventListener", null, function () { -Clazz_declareInterface (java.awt.event, "AWTEventListener", java.util.EventListener); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "ActiveEvent"); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent"], "java.awt.event.InvocationEvent", ["java.lang.Exception"], function () { -c$ = Clazz_decorateAsClass (function () { -this.runnable = null; -this.notifier = null; -this.catchExceptions = false; -this.exception = null; -this.throwable = null; -this.when = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "InvocationEvent", java.awt.AWTEvent, java.awt.ActiveEvent); -Clazz_makeConstructor (c$, -function (source, runnable) { -this.construct (source, runnable, null, false); -}, "~O,Runnable"); -Clazz_makeConstructor (c$, -function (source, runnable, notifier, catchThrowables) { -this.construct (source, 1200, runnable, notifier, catchThrowables); -}, "~O,Runnable,~O,~B"); -Clazz_makeConstructor (c$, -function (source, id, runnable, notifier, catchThrowables) { -Clazz_superConstructor (this, java.awt.event.InvocationEvent, [source, id]); -this.runnable = runnable; -this.notifier = notifier; -this.catchExceptions = catchThrowables; -this.when = System.currentTimeMillis (); -}, "~O,~N,Runnable,~O,~B"); -Clazz_overrideMethod (c$, "dispatch", -function () { -if (this.catchExceptions) { -try { -this.runnable.run (); -} catch (t) { -if (Clazz_instanceOf (t, Exception)) { -this.exception = t; -}this.throwable = t; -} -} else { -this.runnable.run (); -}if (this.notifier != null) { -{ -this.notifier.notifyAll (); -}}}); -Clazz_defineMethod (c$, "getException", -function () { -return (this.catchExceptions) ? this.exception : null; -}); -Clazz_defineMethod (c$, "getThrowable", -function () { -return (this.catchExceptions) ? this.throwable : null; -}); -Clazz_defineMethod (c$, "getWhen", -function () { -return this.when; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 1200: -typeStr = "INVOCATION_DEFAULT"; -break; -default: -typeStr = "unknown type"; -} -return typeStr + ",runnable=" + this.runnable + ",notifier=" + this.notifier + ",catchExceptions=" + this.catchExceptions + ",when=" + this.when; -}); -Clazz_defineStatics (c$, -"SWINGJS_INVOCATION_LOW", 1201, -"INVOCATION_FIRST", 1200, -"INVOCATION_DEFAULT", 1200, -"INVOCATION_LAST", 1201); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.AWTEvent"], "java.awt.event.ComponentEvent", ["java.awt.Component"], function () { -c$ = Clazz_declareType (java.awt.event, "ComponentEvent", java.awt.AWTEvent); -Clazz_defineMethod (c$, "getComponent", -function () { -return (Clazz_instanceOf (this.source, java.awt.Component)) ? this.source : null; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -var b = (this.source != null ? (this.source).getBounds () : null); -switch (this.id) { -case 102: -typeStr = "COMPONENT_SHOWN"; -break; -case 103: -typeStr = "COMPONENT_HIDDEN"; -break; -case 100: -typeStr = "COMPONENT_MOVED (" + b.x + "," + b.y + " " + b.width + "x" + b.height + ")"; -break; -case 101: -typeStr = "COMPONENT_RESIZED (" + b.x + "," + b.y + " " + b.width + "x" + b.height + ")"; -break; -default: -typeStr = "unknown type"; -} -return typeStr; -}); -Clazz_defineStatics (c$, -"COMPONENT_FIRST", 100, -"COMPONENT_LAST", 103, -"COMPONENT_MOVED", 100, -"COMPONENT_RESIZED", 101, -"COMPONENT_SHOWN", 102, -"COMPONENT_HIDDEN", 103); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.InputEvent"], "java.awt.event.MouseEvent", ["java.lang.IllegalArgumentException", "$.StringBuilder", "java.awt.Point", "$.Toolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.x = 0; -this.y = 0; -this.xAbs = 0; -this.yAbs = 0; -this.clickCount = 0; -this.button = 0; -this.popupTrigger = false; -Clazz_instantialize (this, arguments); -}, java.awt.event, "MouseEvent", java.awt.event.InputEvent); -Clazz_defineMethod (c$, "getLocationOnScreen", -function () { -return new java.awt.Point (this.xAbs, this.yAbs); -}); -Clazz_defineMethod (c$, "getXOnScreen", -function () { -return this.xAbs; -}); -Clazz_defineMethod (c$, "getYOnScreen", -function () { -return this.yAbs; -}); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, clickCount, popupTrigger, button) { -this.construct (source, id, when, modifiers, x, y, 0, 0, clickCount, popupTrigger, button); -var eventLocationOnScreen = new java.awt.Point (0, 0); -try { -eventLocationOnScreen = source.getLocationOnScreen (); -this.xAbs = eventLocationOnScreen.x + x; -this.yAbs = eventLocationOnScreen.y + y; -} catch (e) { -if (Clazz_exceptionOf (e, java.awt.IllegalComponentStateException)) { -this.xAbs = 0; -this.yAbs = 0; -} else { -throw e; -} -} -}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B,~N"); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, clickCount, popupTrigger) { -this.construct (source, id, when, modifiers, x, y, clickCount, popupTrigger, 0); -}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B"); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, button) { -Clazz_superConstructor (this, java.awt.event.MouseEvent, [source, id, when, modifiers]); -this.x = x; -this.y = y; -this.xAbs = xAbs; -this.yAbs = yAbs; -this.clickCount = clickCount; -this.popupTrigger = popupTrigger; -if (button < 0 || button > 3) { -throw new IllegalArgumentException ("Invalid button value"); -}this.button = button; -if ((this.getModifiers () != 0) && (this.getModifiersEx () == 0)) { -this.setNewModifiers (); -} else if ((this.getModifiers () == 0) && (this.getModifiersEx () != 0 || button != 0)) { -this.setOldModifiers (); -}}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~N,~N,~B,~N"); -Clazz_defineMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_defineMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "getPoint", -function () { -var x; -var y; -{ -x = this.x; -y = this.y; -}return new java.awt.Point (x, y); -}); -Clazz_defineMethod (c$, "translatePoint", -function (x, y) { -this.x += x; -this.y += y; -}, "~N,~N"); -Clazz_defineMethod (c$, "getClickCount", -function () { -return this.clickCount; -}); -Clazz_defineMethod (c$, "getButton", -function () { -return this.button; -}); -Clazz_defineMethod (c$, "isPopupTrigger", -function () { -return this.popupTrigger; -}); -c$.getMouseModifiersText = Clazz_defineMethod (c$, "getMouseModifiersText", -function (modifiers) { -var buf = new StringBuilder (); -if ((modifiers & 8) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.alt", "Alt")); -buf.append ("+"); -}if ((modifiers & 4) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.meta", "Meta")); -buf.append ("+"); -}if ((modifiers & 2) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.control", "Ctrl")); -buf.append ("+"); -}if ((modifiers & 1) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.shift", "Shift")); -buf.append ("+"); -}if ((modifiers & 32) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph")); -buf.append ("+"); -}if ((modifiers & 16) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button1", "Button1")); -buf.append ("+"); -}if ((modifiers & 8) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button2", "Button2")); -buf.append ("+"); -}if ((modifiers & 4) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button3", "Button3")); -buf.append ("+"); -}if (buf.length () > 0) { -buf.setLength (buf.length () - 1); -}return buf.toString (); -}, "~N"); -Clazz_overrideMethod (c$, "paramString", -function () { -var str = new StringBuilder (80); -str.append (java.awt.event.MouseEvent.getIdString (this.id)); -str.append (",(" + this.x).append ("," + this.y).append ("," + this.when).append (")"); -str.append (",absolute(").append ("" + this.xAbs).append (",").append ("" + this.yAbs).append (")"); -str.append (",button=").append ("" + this.getButton ()); -if (this.getModifiers () != 0) { -str.append (",modifiers=").append (java.awt.event.MouseEvent.getMouseModifiersText (this.modifiers)); -}if (this.getModifiersEx () != 0) { -str.append (",extModifiers=").append (java.awt.event.InputEvent.getModifiersExText (this.modifiers)); -}str.append (",clickCount=").append ("" + this.clickCount); -return str.toString (); -}); -c$.getIdString = Clazz_defineMethod (c$, "getIdString", -function (id) { -switch (id) { -case 501: -return "MOUSE_PRESSED"; -case 502: -return "MOUSE_RELEASED"; -case 500: -return "MOUSE_CLICKED"; -case 504: -return "MOUSE_ENTERED"; -case 505: -return "MOUSE_EXITED"; -case 503: -return "MOUSE_MOVED"; -case 506: -return "MOUSE_DRAGGED"; -case 507: -return "MOUSE_WHEEL"; -default: -return "unknown type"; -} -}, "~N"); -Clazz_defineMethod (c$, "setNewModifiers", - function () { -if ((this.modifiers & 16) != 0) { -this.modifiers |= 1024; -}if ((this.modifiers & 8) != 0) { -this.modifiers |= 2048; -}if ((this.modifiers & 4) != 0) { -this.modifiers |= 4096; -}if (this.id == 501 || this.id == 502 || this.id == 500) { -if ((this.modifiers & 16) != 0) { -this.button = 1; -this.modifiers &= -13; -if (this.id != 501) { -this.modifiers &= -1025; -}} else if ((this.modifiers & 8) != 0) { -this.button = 2; -this.modifiers &= -21; -if (this.id != 501) { -this.modifiers &= -2049; -}} else if ((this.modifiers & 4) != 0) { -this.button = 3; -this.modifiers &= -25; -if (this.id != 501) { -this.modifiers &= -4097; -}}}if ((this.modifiers & 8) != 0) { -this.modifiers |= 512; -}if ((this.modifiers & 4) != 0) { -this.modifiers |= 256; -}if ((this.modifiers & 1) != 0) { -this.modifiers |= 64; -}if ((this.modifiers & 2) != 0) { -this.modifiers |= 128; -}if ((this.modifiers & 32) != 0) { -this.modifiers |= 8192; -}}); -Clazz_defineMethod (c$, "setOldModifiers", - function () { -if (this.id == 501 || this.id == 502 || this.id == 500) { -switch (this.button) { -case 1: -this.modifiers |= 16; -break; -case 2: -this.modifiers |= 8; -break; -case 3: -this.modifiers |= 4; -break; -} -} else { -if ((this.modifiers & 1024) != 0) { -this.modifiers |= 16; -}if ((this.modifiers & 2048) != 0) { -this.modifiers |= 8; -}if ((this.modifiers & 4096) != 0) { -this.modifiers |= 4; -}}if ((this.modifiers & 512) != 0) { -this.modifiers |= 8; -}if ((this.modifiers & 256) != 0) { -this.modifiers |= 4; -}if ((this.modifiers & 64) != 0) { -this.modifiers |= 1; -}if ((this.modifiers & 128) != 0) { -this.modifiers |= 2; -}if ((this.modifiers & 8192) != 0) { -this.modifiers |= 32; -}}); -Clazz_defineStatics (c$, -"MOUSE_FIRST", 500, -"MOUSE_LAST", 507, -"MOUSE_CLICKED", 500, -"MOUSE_PRESSED", 501, -"MOUSE_RELEASED", 502, -"MOUSE_MOVED", 503, -"MOUSE_ENTERED", 504, -"MOUSE_EXITED", 505, -"MOUSE_DRAGGED", 506, -"MOUSE_WHEEL", 507, -"NOBUTTON", 0, -"BUTTON1", 1, -"BUTTON2", 2, -"BUTTON3", 3); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.InputEvent", ["java.lang.StringBuilder", "java.awt.Toolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.when = 0; -this.modifiers = 0; -this.canAccessSystemClipboard = false; -Clazz_instantialize (this, arguments); -}, java.awt.event, "InputEvent", java.awt.event.ComponentEvent); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers) { -Clazz_superConstructor (this, java.awt.event.InputEvent, [source, id]); -this.when = when; -this.modifiers = modifiers; -this.canAccessSystemClipboard = false; -}, "java.awt.Component,~N,~N,~N"); -Clazz_defineMethod (c$, "isShiftDown", -function () { -return (this.modifiers & 1) != 0; -}); -Clazz_defineMethod (c$, "isControlDown", -function () { -return (this.modifiers & 2) != 0; -}); -Clazz_defineMethod (c$, "isMetaDown", -function () { -return (this.modifiers & 4) != 0; -}); -Clazz_defineMethod (c$, "isAltDown", -function () { -return (this.modifiers & 8) != 0; -}); -Clazz_defineMethod (c$, "isAltGraphDown", -function () { -return (this.modifiers & 32) != 0; -}); -Clazz_defineMethod (c$, "getWhen", -function () { -return this.when; -}); -Clazz_defineMethod (c$, "getModifiers", -function () { -return this.modifiers & (-16321); -}); -Clazz_defineMethod (c$, "getModifiersEx", -function () { -return this.modifiers & -64; -}); -Clazz_overrideMethod (c$, "consume", -function () { -this.consumed = true; -}); -Clazz_overrideMethod (c$, "isConsumed", -function () { -return this.consumed; -}); -c$.getModifiersExText = Clazz_defineMethod (c$, "getModifiersExText", -function (modifiers) { -var buf = new StringBuilder (); -if ((modifiers & 256) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.meta", "Meta")); -buf.append ("+"); -}if ((modifiers & 128) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.control", "Ctrl")); -buf.append ("+"); -}if ((modifiers & 512) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.alt", "Alt")); -buf.append ("+"); -}if ((modifiers & 64) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.shift", "Shift")); -buf.append ("+"); -}if ((modifiers & 8192) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph")); -buf.append ("+"); -}if ((modifiers & 1024) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button1", "Button1")); -buf.append ("+"); -}if ((modifiers & 2048) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button2", "Button2")); -buf.append ("+"); -}if ((modifiers & 4096) != 0) { -buf.append (java.awt.Toolkit.getProperty ("AWT.button3", "Button3")); -buf.append ("+"); -}if (buf.length () > 0) { -buf.setLength (buf.length () - 1); -}return buf.toString (); -}, "~N"); -Clazz_defineStatics (c$, -"SHIFT_MASK", 1, -"CTRL_MASK", 2, -"META_MASK", 4, -"ALT_MASK", 8, -"ALT_GRAPH_MASK", 32, -"BUTTON1_MASK", 16, -"BUTTON2_MASK", 8, -"BUTTON3_MASK", 4, -"SHIFT_DOWN_MASK", 64, -"CTRL_DOWN_MASK", 128, -"META_DOWN_MASK", 256, -"ALT_DOWN_MASK", 512, -"BUTTON1_DOWN_MASK", 1024, -"BUTTON2_DOWN_MASK", 2048, -"BUTTON3_DOWN_MASK", 4096, -"ALT_GRAPH_DOWN_MASK", 8192, -"FIRST_HIGH_BIT", 16384, -"JDK_1_3_MODIFIERS", 63, -"HIGH_MODIFIERS", -16384); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.AWTEventMulticaster", "java.awt.event.AWTEventListener", "java.util.HashMap"], "java.awt.Toolkit", ["java.util.ArrayList", "java.awt.Cursor", "$.Insets", "$.RenderingHints", "java.awt.event.AWTEventListenerProxy", "java.beans.PropertyChangeSupport", "jssun.awt.NullComponentPeer"], function () { -c$ = Clazz_decorateAsClass (function () { -this.desktopProperties = null; -this.desktopPropsSupport = null; -this.calls = null; -this.eventListener = null; -this.listener2SelectiveListener = null; -if (!Clazz_isClassDefined ("java.awt.Toolkit.SelectiveAWTEventListener")) { -java.awt.Toolkit.$Toolkit$SelectiveAWTEventListener$ (); -} -Clazz_instantialize (this, arguments); -}, java.awt, "Toolkit"); -Clazz_prepareFields (c$, function () { -this.desktopProperties = new java.util.HashMap (); -this.desktopPropsSupport = java.awt.Toolkit.createPropertyChangeSupport (this); -this.calls = Clazz_newIntArray (32, 0); -this.listener2SelectiveListener = new java.util.HashMap (); -}); -Clazz_defineMethod (c$, "createComponent", -function (target) { -if (java.awt.Toolkit.lightweightMarker == null) { -java.awt.Toolkit.lightweightMarker = new jssun.awt.NullComponentPeer (); -}return java.awt.Toolkit.lightweightMarker; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "loadSystemColors", -function (systemColors) { -}, "~A"); -Clazz_defineMethod (c$, "setDynamicLayout", -function (dynamic) { -}, "~B"); -Clazz_defineMethod (c$, "isDynamicLayoutSet", -function () { -if (this !== java.awt.Toolkit.getDefaultToolkit ()) { -return java.awt.Toolkit.getDefaultToolkit ().isDynamicLayoutSet (); -} else { -return false; -}}); -Clazz_defineMethod (c$, "isDynamicLayoutActive", -function () { -if (this !== java.awt.Toolkit.getDefaultToolkit ()) { -return java.awt.Toolkit.getDefaultToolkit ().isDynamicLayoutActive (); -} else { -return false; -}}); -Clazz_defineMethod (c$, "getScreenInsets", -function (gc) { -if (this !== java.awt.Toolkit.getDefaultToolkit ()) { -return java.awt.Toolkit.getDefaultToolkit ().getScreenInsets (gc); -} else { -return new java.awt.Insets (0, 0, 0, 0); -}}, "java.awt.GraphicsConfiguration"); -c$.getDefaultToolkit = Clazz_defineMethod (c$, "getDefaultToolkit", -function () { -return (java.awt.Toolkit.toolkit == null ? java.awt.Toolkit.toolkit = new swingjs.JSToolkit () : java.awt.Toolkit.toolkit); -}); -Clazz_defineMethod (c$, "createImage", -function (imagedata) { -return this.createImage (imagedata, 0, imagedata.length); -}, "~A"); -Clazz_defineMethod (c$, "getMenuShortcutKeyMask", -function () { -return 2; -}); -c$.getNativeContainer = Clazz_defineMethod (c$, "getNativeContainer", -function (c) { -return null; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "createCustomCursor", -function (cursor, hotSpot, name) { -return new java.awt.Cursor (0); -}, "java.awt.Image,java.awt.Point,~S"); -Clazz_defineMethod (c$, "isFrameStateSupported", -function (state) { -return (state == 0); -}, "~N"); -c$.getProperty = Clazz_defineMethod (c$, "getProperty", -function (key, defaultValue) { -if (java.awt.Toolkit.resources != null) { -try { -return java.awt.Toolkit.resources.getString (key); -} catch (e) { -if (Clazz_exceptionOf (e, java.util.MissingResourceException)) { -} else { -throw e; -} -} -}return defaultValue; -}, "~S,~S"); -Clazz_defineMethod (c$, "getSystemEventQueue", -function () { -return this.getSystemEventQueueImpl (); -}); -c$.getEventQueue = Clazz_defineMethod (c$, "getEventQueue", -function () { -return java.awt.Toolkit.getDefaultToolkit ().getSystemEventQueueImpl (); -}); -Clazz_defineMethod (c$, "getDesktopProperty", -function (propertyName) { -if (this.desktopProperties.isEmpty ()) { -this.initializeDesktopProperties (); -}var value; -if (propertyName.equals ("awt.dynamicLayoutSupported")) { -value = this.lazilyLoadDesktopProperty (propertyName); -return value; -}value = this.desktopProperties.get (propertyName); -if (value == null) { -value = this.lazilyLoadDesktopProperty (propertyName); -if (value != null) { -this.setDesktopProperty (propertyName, value); -}}if (Clazz_instanceOf (value, java.awt.RenderingHints)) { -value = (value).clone (); -}return value; -}, "~S"); -Clazz_defineMethod (c$, "setDesktopProperty", -function (name, newValue) { -var oldValue; -{ -oldValue = this.desktopProperties.get (name); -this.desktopProperties.put (name, newValue); -}this.desktopPropsSupport.firePropertyChange (name, oldValue, newValue); -}, "~S,~O"); -Clazz_defineMethod (c$, "lazilyLoadDesktopProperty", -function (name) { -return null; -}, "~S"); -Clazz_defineMethod (c$, "initializeDesktopProperties", -function () { -}); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (name, pcl) { -this.desktopPropsSupport.addPropertyChangeListener (name, pcl); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (name, pcl) { -this.desktopPropsSupport.removePropertyChangeListener (name, pcl); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -return this.desktopPropsSupport.getPropertyChangeListeners (); -}); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function (propertyName) { -return this.desktopPropsSupport.getPropertyChangeListeners (propertyName); -}, "~S"); -Clazz_defineMethod (c$, "isAlwaysOnTopSupported", -function () { -return true; -}); -c$.deProxyAWTEventListener = Clazz_defineMethod (c$, "deProxyAWTEventListener", - function (l) { -var localL = l; -if (localL == null) { -return null; -}if (Clazz_instanceOf (l, java.awt.event.AWTEventListenerProxy)) { -localL = (l).getListener (); -}return localL; -}, "java.awt.event.AWTEventListener"); -Clazz_defineMethod (c$, "addAWTEventListener", -function (listener, eventMask) { -var localL = java.awt.Toolkit.deProxyAWTEventListener (listener); -if (localL == null) { -return; -}{ -var selectiveListener = this.listener2SelectiveListener.get (localL); -if (selectiveListener == null) { -selectiveListener = Clazz_innerTypeInstance (java.awt.Toolkit.SelectiveAWTEventListener, this, null, localL, eventMask); -this.listener2SelectiveListener.put (localL, selectiveListener); -this.eventListener = java.awt.Toolkit.ToolkitEventMulticaster.add (this.eventListener, selectiveListener); -}selectiveListener.orEventMasks (eventMask); -java.awt.Toolkit.enabledOnToolkitMask |= eventMask; -var mask = eventMask; -for (var i = 0; i < 32; i++) { -if (mask == 0) { -break; -}if ((mask & 1) != 0) { -this.calls[i]++; -}mask >>>= 1; -} -}}, "java.awt.event.AWTEventListener,~N"); -Clazz_defineMethod (c$, "removeAWTEventListener", -function (listener) { -var localL = java.awt.Toolkit.deProxyAWTEventListener (listener); -if (listener == null) { -return; -}{ -var selectiveListener = this.listener2SelectiveListener.get (localL); -if (selectiveListener != null) { -this.listener2SelectiveListener.remove (localL); -var listenerCalls = selectiveListener.getCalls (); -for (var i = 0; i < 32; i++) { -this.calls[i] -= listenerCalls[i]; -if (this.calls[i] == 0) { -java.awt.Toolkit.enabledOnToolkitMask &= ~(1 << i); -}} -}this.eventListener = java.awt.Toolkit.ToolkitEventMulticaster.remove (this.eventListener, (selectiveListener == null) ? localL : selectiveListener); -}}, "java.awt.event.AWTEventListener"); -c$.enabledOnToolkit = Clazz_defineMethod (c$, "enabledOnToolkit", -function (eventMask) { -return (java.awt.Toolkit.enabledOnToolkitMask & eventMask) != 0; -}, "~N"); -Clazz_defineMethod (c$, "countAWTEventListeners", -function (eventMask) { -var ci = 0; -for (; eventMask != 0; eventMask >>>= 1, ci++) { -} -ci--; -return this.calls[ci]; -}, "~N"); -Clazz_defineMethod (c$, "getAWTEventListeners", -function () { -{ -var la = java.awt.Toolkit.ToolkitEventMulticaster.getListeners (this.eventListener, java.awt.event.AWTEventListener); -var ret = new Array (la.length); -for (var i = 0; i < la.length; i++) { -var sael = la[i]; -var tempL = sael.getListener (); -ret[i] = new java.awt.event.AWTEventListenerProxy (sael.getEventMask (), tempL); -} -return ret; -}}); -Clazz_defineMethod (c$, "getAWTEventListeners", -function (eventMask) { -{ -var la = java.awt.Toolkit.ToolkitEventMulticaster.getListeners (this.eventListener, java.awt.event.AWTEventListener); -var list = new java.util.ArrayList (la.length); -for (var i = 0; i < la.length; i++) { -var sael = la[i]; -if ((sael.getEventMask () & eventMask) == eventMask) { -list.add ( new java.awt.event.AWTEventListenerProxy (sael.getEventMask (), sael.getListener ())); -}} -return list.toArray ( new Array (0)); -}}, "~N"); -Clazz_defineMethod (c$, "notifyAWTEventListeners", -function (theEvent) { -var eventListener = this.eventListener; -if (eventListener != null) { -eventListener.eventDispatched (theEvent); -}}, "java.awt.AWTEvent"); -c$.createPropertyChangeSupport = Clazz_defineMethod (c$, "createPropertyChangeSupport", - function (toolkit) { -return new java.beans.PropertyChangeSupport (toolkit); -}, "java.awt.Toolkit"); -c$.$Toolkit$SelectiveAWTEventListener$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -this.listener = null; -this.eventMask = 0; -this.calls = null; -Clazz_instantialize (this, arguments); -}, java.awt.Toolkit, "SelectiveAWTEventListener", null, java.awt.event.AWTEventListener); -Clazz_prepareFields (c$, function () { -this.calls = Clazz_newIntArray (32, 0); -}); -Clazz_defineMethod (c$, "getListener", -function () { -return this.listener; -}); -Clazz_defineMethod (c$, "getEventMask", -function () { -return this.eventMask; -}); -Clazz_defineMethod (c$, "getCalls", -function () { -return this.calls; -}); -Clazz_defineMethod (c$, "orEventMasks", -function (a) { -this.eventMask |= a; -for (var b = 0; b < 32; b++) { -if (a == 0) { -break; -}if ((a & 1) != 0) { -this.calls[b]++; -}a >>>= 1; -} -}, "~N"); -Clazz_makeConstructor (c$, -function (a, b) { -this.listener = a; -this.eventMask = b; -}, "java.awt.event.AWTEventListener,~N"); -Clazz_defineMethod (c$, "eventDispatched", -function (a) { -var b = 0; -if (((b = this.eventMask & 1) != 0 && a.id >= 100 && a.id <= 103) || ((b = this.eventMask & 2) != 0 && a.id >= 300 && a.id <= 301) || ((b = this.eventMask & 4) != 0 && a.id >= 1004 && a.id <= 1005) || ((b = this.eventMask & 8) != 0 && a.id >= 400 && a.id <= 402) || ((b = this.eventMask & 131072) != 0 && a.id == 507) || ((b = this.eventMask & 32) != 0 && (a.id == 503 || a.id == 506)) || ((b = this.eventMask & 16) != 0 && a.id != 503 && a.id != 506 && a.id != 507 && a.id >= 500 && a.id <= 507) || ((b = this.eventMask & 64) != 0 && (a.id >= 200 && a.id <= 209)) || ((b = this.eventMask & 128) != 0 && a.id >= 1001 && a.id <= 1001) || ((b = this.eventMask & 256) != 0 && a.id >= 601 && a.id <= 601) || ((b = this.eventMask & 512) != 0 && a.id >= 701 && a.id <= 701) || ((b = this.eventMask & 1024) != 0 && a.id >= 900 && a.id <= 900) || ((b = this.eventMask & 2048) != 0 && a.id >= 1100 && a.id <= 1101) || ((b = this.eventMask & 8192) != 0 && a.id >= 800 && a.id <= 801) || ((b = this.eventMask & 16384) != 0 && a.id >= 1200 && a.id <= 1201) || ((b = this.eventMask & 32768) != 0 && a.id == 1400) || ((b = this.eventMask & 65536) != 0 && (a.id == 1401 || a.id == 1402)) || ((b = this.eventMask & 262144) != 0 && a.id == 209) || ((b = this.eventMask & 524288) != 0 && (a.id == 207 || a.id == 208))) { -var c = 0; -for (var d = b; d != 0; d >>>= 1, c++) { -} -c--; -for (var e = 0; e < this.calls[c]; e++) { -this.listener.eventDispatched (a); -} -}}, "java.awt.AWTEvent"); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.Toolkit, "ToolkitEventMulticaster", java.awt.AWTEventMulticaster, java.awt.event.AWTEventListener); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -if (a == null) return b; -if (b == null) return a; -return new java.awt.Toolkit.ToolkitEventMulticaster (a, b); -}, "java.awt.event.AWTEventListener,java.awt.event.AWTEventListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (a, b) { -return java.awt.AWTEventMulticaster.removeInternal (a, b); -}, "java.awt.event.AWTEventListener,java.awt.event.AWTEventListener"); -Clazz_defineMethod (c$, "remove", -function (a) { -if (a === this.a) return this.b; -if (a === this.b) return this.a; -var b = java.awt.AWTEventMulticaster.removeInternal (this.a, a); -var c = java.awt.AWTEventMulticaster.removeInternal (this.b, a); -if (b === this.a && c === this.b) { -return this; -}return java.awt.Toolkit.ToolkitEventMulticaster.add (b, c); -}, "java.util.EventListener"); -Clazz_defineMethod (c$, "eventDispatched", -function (a) { -(this.a).eventDispatched (a); -(this.b).eventDispatched (a); -}, "java.awt.AWTEvent"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"lightweightMarker", null, -"toolkit", null, -"resources", null, -"LONG_BITS", 32, -"enabledOnToolkitMask", 0); -}); -Clazz_declarePackage ("java.lang"); -Clazz_load (["java.lang.Enum"], "java.lang.Thread", ["java.lang.Exception", "$.IllegalArgumentException", "$.IllegalThreadStateException", "$.NoSuchMethodError", "$.NullPointerException", "$.ThreadDeath", "java.util.HashMap", "java.lang.ThreadGroup", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.name = null; -this.priority = 5; -this.daemon = false; -this.target = null; -this.group = null; -this.tid = 0; -this.threadStatus = 0; -this.parkBlocker = null; -this.stopBeforeStart = false; -this.throwableFromStop = null; -this.me = null; -this.uncaughtExceptionHandler = null; -this.$interrupted = false; -this.stopped = false; -Clazz_instantialize (this, arguments); -}, java.lang, "Thread", null, Runnable); -c$.nextThreadNum = Clazz_defineMethod (c$, "nextThreadNum", - function () { -return java.lang.Thread.threadInitNumber++; -}); -c$.nextThreadID = Clazz_defineMethod (c$, "nextThreadID", - function () { -return ++java.lang.Thread.threadSeqNumber; -}); -c$.currentThread = Clazz_defineMethod (c$, "currentThread", -function () { -if (java.lang.Thread.thisThread == null) { -java.lang.Thread.thisThread = new java.lang.Thread ("master"); -java.lang.Thread.thisThread.setPriority (5); -}return java.lang.Thread.thisThread; -}); -c$.yield = Clazz_defineMethod (c$, "yield", -function () { -}); -c$.sleep = Clazz_defineMethod (c$, "sleep", -function (millis) { -}, "~N"); -c$.sleep = Clazz_defineMethod (c$, "sleep", -function (millis, nanos) { -if (millis < 0) { -throw new IllegalArgumentException ("timeout value is negative"); -}if (nanos < 0 || nanos > 999999) { -throw new IllegalArgumentException ("nanosecond timeout value out of range"); -}if (nanos >= 500000 || (nanos != 0 && millis == 0)) { -millis++; -}java.lang.Thread.sleep (millis); -}, "~N,~N"); -Clazz_defineMethod (c$, "init", - function (g, target, name, stackSize) { -this.init (g, target, name, stackSize, null); -}, "java.lang.ThreadGroup,Runnable,~S,~N"); -Clazz_defineMethod (c$, "init", - function (g, target, name, stackSize, acc) { -var parent = (java.lang.Thread.thisThread == null ? null : java.lang.Thread.thisThread); -if (g == null) { -if (g == null && parent != null) { -g = parent.getThreadGroup (); -}}if (g == null) { -g = this.newThreadGroup (null, name); -parent = this; -}g.checkAccess (); -g.addUnstarted (); -this.group = g; -this.priority = parent.getPriority (); -this.name = name; -this.target = target; -this.setPriority (this.priority); -this.tid = java.lang.Thread.nextThreadID (); -this.me = this; -}, "java.lang.ThreadGroup,Runnable,~S,~N,~O"); -Clazz_defineMethod (c$, "newThreadGroup", -function (group, name) { -return new java.lang.ThreadGroup (group, name); -}, "java.lang.ThreadGroup,~S"); -Clazz_makeConstructor (c$, -function () { -this.init (null, null, "Thread-" + java.lang.Thread.nextThreadNum (), 0); -}); -Clazz_makeConstructor (c$, -function (target) { -this.init (null, target, "Thread-" + java.lang.Thread.nextThreadNum (), 0); -}, "Runnable"); -Clazz_makeConstructor (c$, -function (group, target) { -this.init (group, target, "Thread-" + java.lang.Thread.nextThreadNum (), 0); -}, "java.lang.ThreadGroup,Runnable"); -Clazz_makeConstructor (c$, -function (name) { -this.init (null, null, name, 0); -}, "~S"); -Clazz_makeConstructor (c$, -function (group, name) { -this.init (group, null, name, 0); -}, "java.lang.ThreadGroup,~S"); -Clazz_makeConstructor (c$, -function (target, name) { -this.init (null, target, name, 0); -}, "Runnable,~S"); -Clazz_makeConstructor (c$, -function (group, target, name) { -this.init (group, target, name, 0); -}, "java.lang.ThreadGroup,Runnable,~S"); -Clazz_makeConstructor (c$, -function (group, target, name, stackSize) { -this.init (group, target, name, stackSize); -}, "java.lang.ThreadGroup,Runnable,~S,~N"); -Clazz_defineMethod (c$, "start", -function () { -if (this.threadStatus != 0 || this !== this.me) throw new IllegalThreadStateException (); -this.group.add (this); -this.start0 (); -if (this.stopBeforeStart) { -this.stop0 (this.throwableFromStop); -}}); -Clazz_defineMethod (c$, "start0", - function () { -}); -Clazz_defineMethod (c$, "run", -function () { -if (this.target != null) { -this.target.run (); -}}); -Clazz_defineMethod (c$, "stop", -function () { -if ((this.threadStatus != 0) && !this.isAlive ()) { -return; -}this.stop1 ( new ThreadDeath ()); -}); -Clazz_defineMethod (c$, "stop", -function (obj) { -this.stop1 (obj); -}, "Throwable"); -Clazz_defineMethod (c$, "stop1", - function (th) { -if (this.threadStatus != 0) { -this.resume (); -this.stop0 (th); -} else { -if (th == null) { -throw new NullPointerException (); -}this.stopBeforeStart = true; -this.throwableFromStop = th; -}}, "Throwable"); -Clazz_defineMethod (c$, "interrupt", -function () { -this.interrupt0 (); -}); -c$.interrupted = Clazz_defineMethod (c$, "interrupted", -function () { -return java.lang.Thread.currentThread ().isInterruptedB (true); -}); -Clazz_defineMethod (c$, "isInterrupted", -function () { -return this.isInterruptedB (false); -}); -Clazz_defineMethod (c$, "isInterruptedB", - function (clearInterrupted) { -var wasInt = this.$interrupted; -if (clearInterrupted) this.$interrupted = false; -return wasInt; -}, "~B"); -Clazz_defineMethod (c$, "destroy", -function () { -throw new NoSuchMethodError (); -}); -Clazz_defineMethod (c$, "isAlive", -function () { -return true; -}); -Clazz_defineMethod (c$, "suspend", -function () { -this.checkAccess (); -this.suspend0 (); -}); -Clazz_defineMethod (c$, "resume", -function () { -this.checkAccess (); -this.resume0 (); -}); -Clazz_defineMethod (c$, "setPriority", -function (newPriority) { -var g; -this.checkAccess (); -if (newPriority > 10 || newPriority < 1) { -throw new IllegalArgumentException (); -}if ((g = this.getThreadGroup ()) != null) { -if (newPriority > g.getMaxPriority ()) { -newPriority = g.getMaxPriority (); -}this.setPriority0 (this.priority = newPriority); -}}, "~N"); -Clazz_defineMethod (c$, "getPriority", -function () { -return this.priority; -}); -Clazz_defineMethod (c$, "setName", -function (name) { -this.checkAccess (); -this.name = name; -}, "~S"); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getThreadGroup", -function () { -return this.group; -}); -c$.activeCount = Clazz_defineMethod (c$, "activeCount", -function () { -return java.lang.Thread.currentThread ().getThreadGroup ().activeCount (); -}); -c$.enumerate = Clazz_defineMethod (c$, "enumerate", -function (tarray) { -return java.lang.Thread.currentThread ().getThreadGroup ().enumerate (tarray); -}, "~A"); -Clazz_defineMethod (c$, "countStackFrames", -function () { -return 0; -}); -Clazz_defineMethod (c$, "join", -function (millis) { -var base = System.currentTimeMillis (); -var now = 0; -if (millis < 0) { -throw new IllegalArgumentException ("timeout value is negative"); -}swingjs.JSToolkit.warn ("Cannot wait in Thread"); -if (millis == 0) { -while (this.isAlive ()) { -this.wait (0); -} -} else { -while (this.isAlive ()) { -var delay = millis - now; -if (delay <= 0) { -break; -}this.wait (delay); -now = System.currentTimeMillis () - base; -} -}}, "~N"); -Clazz_defineMethod (c$, "join", -function (millis, nanos) { -if (millis < 0) { -throw new IllegalArgumentException ("timeout value is negative"); -}if (nanos < 0 || nanos > 999999) { -throw new IllegalArgumentException ("nanosecond timeout value out of range"); -}if (nanos >= 500000 || (nanos != 0 && millis == 0)) { -millis++; -}this.join (millis); -}, "~N,~N"); -Clazz_defineMethod (c$, "join", -function () { -this.join (0); -}); -c$.dumpStack = Clazz_defineMethod (c$, "dumpStack", -function () { - new Exception ("Stack trace").printStackTrace (); -}); -Clazz_defineMethod (c$, "setDaemon", -function (on) { -this.checkAccess (); -if (this.isAlive ()) { -throw new IllegalThreadStateException (); -}this.daemon = on; -}, "~B"); -Clazz_defineMethod (c$, "isDaemon", -function () { -return this.daemon; -}); -Clazz_defineMethod (c$, "checkAccess", -function () { -}); -Clazz_overrideMethod (c$, "toString", -function () { -var group = this.getThreadGroup (); -if (group != null) { -return "Thread[" + this.getName () + "," + this.getPriority () + "," + group.getName () + "]"; -} else { -return "Thread[" + this.getName () + "," + this.getPriority () + "," + "" + "]"; -}}); -Clazz_defineMethod (c$, "getContextClassLoader", -function () { -return null; -}); -Clazz_defineMethod (c$, "setContextClassLoader", -function (cl) { -}, "ClassLoader"); -c$.holdsLock = Clazz_defineMethod (c$, "holdsLock", -function (obj) { -return false; -}, "~O"); -Clazz_defineMethod (c$, "getStackTrace", -function () { -return ( new Exception ()).getStackTrace (); -}); -c$.getAllStackTraces = Clazz_defineMethod (c$, "getAllStackTraces", -function () { -var threads = java.lang.Thread.getThreads (); -var traces = java.lang.Thread.dumpThreads (threads); -var m = new java.util.HashMap (threads.length); -for (var i = 0; i < threads.length; i++) { -var stackTrace = traces[i]; -if (stackTrace != null) { -m.put (threads[i], stackTrace); -}} -return m; -}); -c$.dumpThreads = Clazz_defineMethod (c$, "dumpThreads", - function (threads) { -return null; -}, "~A"); -c$.getThreads = Clazz_defineMethod (c$, "getThreads", - function () { -return null; -}); -Clazz_defineMethod (c$, "getId", -function () { -return this.tid; -}); -Clazz_defineMethod (c$, "getState", -function () { -switch (this.threadStatus) { -case 0: -return java.lang.Thread.State.NEW; -case 1: -return java.lang.Thread.State.RUNNABLE; -case 2: -default: -return java.lang.Thread.State.TERMINATED; -case 3: -return java.lang.Thread.State.TIMED_WAITING; -case 4: -return java.lang.Thread.State.WAITING; -} -}); -c$.setDefaultUncaughtExceptionHandler = Clazz_defineMethod (c$, "setDefaultUncaughtExceptionHandler", -function (eh) { -java.lang.Thread.defaultUncaughtExceptionHandler = eh; -}, "java.lang.Thread.UncaughtExceptionHandler"); -c$.getDefaultUncaughtExceptionHandler = Clazz_defineMethod (c$, "getDefaultUncaughtExceptionHandler", -function () { -return java.lang.Thread.defaultUncaughtExceptionHandler; -}); -Clazz_defineMethod (c$, "getUncaughtExceptionHandler", -function () { -return this.uncaughtExceptionHandler != null ? this.uncaughtExceptionHandler : this.group; -}); -Clazz_defineMethod (c$, "setUncaughtExceptionHandler", -function (eh) { -this.checkAccess (); -this.uncaughtExceptionHandler = eh; -}, "java.lang.Thread.UncaughtExceptionHandler"); -Clazz_defineMethod (c$, "setPriority0", - function (newPriority) { -}, "~N"); -Clazz_defineMethod (c$, "stop0", - function (o) { -this.stopped = true; -}, "~O"); -Clazz_defineMethod (c$, "suspend0", - function () { -}); -Clazz_defineMethod (c$, "resume0", - function () { -}); -Clazz_defineMethod (c$, "interrupt0", - function () { -this.$interrupted = true; -}); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.lang.Thread, "State", Enum); -Clazz_defineEnumConstant (c$, "NEW", 0, []); -Clazz_defineEnumConstant (c$, "RUNNABLE", 1, []); -Clazz_defineEnumConstant (c$, "BLOCKED", 2, []); -Clazz_defineEnumConstant (c$, "WAITING", 3, []); -Clazz_defineEnumConstant (c$, "TIMED_WAITING", 4, []); -Clazz_defineEnumConstant (c$, "TERMINATED", 5, []); -c$ = Clazz_p0p (); -Clazz_declareInterface (java.lang.Thread, "UncaughtExceptionHandler"); -Clazz_defineStatics (c$, -"threadInitNumber", 0, -"threadSeqNumber", 0, -"thisThread", null, -"MIN_PRIORITY", 1, -"NORM_PRIORITY", 5, -"MAX_PRIORITY", 10, -"defaultUncaughtExceptionHandler", null); -}); -Clazz_declarePackage ("java.lang"); -Clazz_load (["java.lang.Thread"], "java.lang.ThreadGroup", ["java.lang.IllegalThreadStateException", "$.ThreadDeath", "java.util.Arrays"], function () { -c$ = Clazz_decorateAsClass (function () { -this.parent = null; -this.name = null; -this.maxPriority = 10; -this.destroyed = false; -this.daemon = false; -this.vmAllowSuspension = false; -this.nUnstartedThreads = 0; -this.nthreads = 0; -this.threads = null; -this.ngroups = 0; -this.groups = null; -this.html5Applet = null; -Clazz_instantialize (this, arguments); -}, java.lang, "ThreadGroup", null, java.lang.Thread.UncaughtExceptionHandler); -Clazz_makeConstructor (c$, -function (name) { -this.construct (java.lang.Thread.currentThread ().getThreadGroup (), name); -}, "~S"); -Clazz_makeConstructor (c$, -function (parent, name) { -this.name = name; -this.parent = parent; -if (parent != null) { -this.maxPriority = parent.maxPriority; -this.daemon = parent.daemon; -this.vmAllowSuspension = parent.vmAllowSuspension; -parent.add (this); -}}, "java.lang.ThreadGroup,~S"); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getParent", -function () { -if (this.parent != null) this.parent.checkAccess (); -return this.parent; -}); -Clazz_defineMethod (c$, "getMaxPriority", -function () { -return this.maxPriority; -}); -Clazz_defineMethod (c$, "isDaemon", -function () { -return this.daemon; -}); -Clazz_defineMethod (c$, "isDestroyed", -function () { -return this.destroyed; -}); -Clazz_defineMethod (c$, "setDaemon", -function (daemon) { -this.checkAccess (); -this.daemon = daemon; -}, "~B"); -Clazz_defineMethod (c$, "setMaxPriority", -function (pri) { -var ngroupsSnapshot; -var groupsSnapshot; -{ -this.checkAccess (); -if (pri < 1 || pri > 10) { -return; -}this.maxPriority = (this.parent != null) ? Math.min (pri, this.parent.maxPriority) : pri; -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}for (var i = 0; i < ngroupsSnapshot; i++) { -groupsSnapshot[i].setMaxPriority (pri); -} -}, "~N"); -Clazz_defineMethod (c$, "parentOf", -function (g) { -for (; g != null; g = g.parent) { -if (g === this) { -return true; -}} -return false; -}, "java.lang.ThreadGroup"); -Clazz_defineMethod (c$, "checkAccess", -function () { -}); -Clazz_defineMethod (c$, "activeCount", -function () { -var result; -var ngroupsSnapshot; -var groupsSnapshot; -{ -if (this.destroyed) { -return 0; -}result = this.nthreads; -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}for (var i = 0; i < ngroupsSnapshot; i++) { -result += groupsSnapshot[i].activeCount (); -} -return result; -}); -Clazz_defineMethod (c$, "enumerate", -function (list) { -this.checkAccess (); -return this.enumerate (list, 0, true); -}, "~A"); -Clazz_defineMethod (c$, "enumerate", -function (list, recurse) { -this.checkAccess (); -return this.enumerate (list, 0, recurse); -}, "~A,~B"); -Clazz_defineMethod (c$, "enumerate", - function (list, n, recurse) { -var ngroupsSnapshot = 0; -var groupsSnapshot = null; -{ -if (this.destroyed) { -return 0; -}var nt = this.nthreads; -if (nt > list.length - n) { -nt = list.length - n; -}for (var i = 0; i < nt; i++) { -if (this.threads[i].isAlive ()) { -list[n++] = this.threads[i]; -}} -if (recurse) { -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}}if (recurse) { -for (var i = 0; i < ngroupsSnapshot; i++) { -n = groupsSnapshot[i].enumerate (list, n, true); -} -}return n; -}, "~A,~N,~B"); -Clazz_defineMethod (c$, "activeGroupCount", -function () { -var ngroupsSnapshot; -var groupsSnapshot; -{ -if (this.destroyed) { -return 0; -}ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}var n = ngroupsSnapshot; -for (var i = 0; i < ngroupsSnapshot; i++) { -n += groupsSnapshot[i].activeGroupCount (); -} -return n; -}); -Clazz_defineMethod (c$, "enumerate", -function (list) { -this.checkAccess (); -return this.enumerate (list, 0, true); -}, "~A"); -Clazz_defineMethod (c$, "enumerate", -function (list, recurse) { -this.checkAccess (); -return this.enumerate (list, 0, recurse); -}, "~A,~B"); -Clazz_defineMethod (c$, "enumerate", - function (list, n, recurse) { -var ngroupsSnapshot = 0; -var groupsSnapshot = null; -{ -if (this.destroyed) { -return 0; -}var ng = this.ngroups; -if (ng > list.length - n) { -ng = list.length - n; -}if (ng > 0) { -System.arraycopy (this.groups, 0, list, n, ng); -n += ng; -}if (recurse) { -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}}if (recurse) { -for (var i = 0; i < ngroupsSnapshot; i++) { -n = groupsSnapshot[i].enumerate (list, n, true); -} -}return n; -}, "~A,~N,~B"); -Clazz_defineMethod (c$, "stop", -function () { -if (this.stopOrSuspend (false)) java.lang.Thread.currentThread ().stop (); -}); -Clazz_defineMethod (c$, "interrupt", -function () { -var ngroupsSnapshot; -var groupsSnapshot; -{ -this.checkAccess (); -for (var i = 0; i < this.nthreads; i++) { -this.threads[i].interrupt (); -} -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}for (var i = 0; i < ngroupsSnapshot; i++) { -groupsSnapshot[i].interrupt (); -} -}); -Clazz_defineMethod (c$, "suspend", -function () { -if (this.stopOrSuspend (true)) java.lang.Thread.currentThread ().suspend (); -}); -Clazz_defineMethod (c$, "stopOrSuspend", - function (suspend) { -var suicide = false; -var us = java.lang.Thread.currentThread (); -var ngroupsSnapshot; -var groupsSnapshot = null; -{ -this.checkAccess (); -for (var i = 0; i < this.nthreads; i++) { -if (this.threads[i] === us) suicide = true; - else if (suspend) this.threads[i].suspend (); - else this.threads[i].stop (); -} -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -}}for (var i = 0; i < ngroupsSnapshot; i++) suicide = groupsSnapshot[i].stopOrSuspend (suspend) || suicide; - -return suicide; -}, "~B"); -Clazz_defineMethod (c$, "resume", -function () { -var ngroupsSnapshot; -var groupsSnapshot; -{ -this.checkAccess (); -for (var i = 0; i < this.nthreads; i++) { -this.threads[i].resume (); -} -ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}}for (var i = 0; i < ngroupsSnapshot; i++) { -groupsSnapshot[i].resume (); -} -}); -Clazz_defineMethod (c$, "destroy", -function () { -var ngroupsSnapshot; -var groupsSnapshot; -{ -this.checkAccess (); -if (this.destroyed || (this.nthreads > 0)) { -throw new IllegalThreadStateException (); -}ngroupsSnapshot = this.ngroups; -if (this.groups != null) { -groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); -} else { -groupsSnapshot = null; -}if (this.parent != null) { -this.destroyed = true; -this.ngroups = 0; -this.groups = null; -this.nthreads = 0; -this.threads = null; -}}for (var i = 0; i < ngroupsSnapshot; i += 1) { -groupsSnapshot[i].destroy (); -} -if (this.parent != null) { -this.parent.remove (this); -}}); -Clazz_defineMethod (c$, "add", - function (g) { -{ -if (this.destroyed) { -throw new IllegalThreadStateException (); -}if (this.groups == null) { -this.groups = new Array (4); -} else if (this.ngroups == this.groups.length) { -this.groups = java.util.Arrays.copyOf (this.groups, this.ngroups * 2); -}this.groups[this.ngroups] = g; -this.ngroups++; -}}, "java.lang.ThreadGroup"); -Clazz_defineMethod (c$, "remove", - function (g) { -{ -if (this.destroyed) { -return; -}for (var i = 0; i < this.ngroups; i++) { -if (this.groups[i] === g) { -this.ngroups -= 1; -System.arraycopy (this.groups, i + 1, this.groups, i, this.ngroups - i); -this.groups[this.ngroups] = null; -break; -}} -if (this.nthreads == 0) { -this.notifyAll (); -}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) { -this.destroy (); -}}}, "java.lang.ThreadGroup"); -Clazz_defineMethod (c$, "addUnstarted", -function () { -{ -if (this.destroyed) { -throw new IllegalThreadStateException (); -}this.nUnstartedThreads++; -}}); -Clazz_defineMethod (c$, "add", -function (t) { -{ -if (this.destroyed) { -throw new IllegalThreadStateException (); -}if (this.threads == null) { -this.threads = new Array (4); -} else if (this.nthreads == this.threads.length) { -this.threads = java.util.Arrays.copyOf (this.threads, this.nthreads * 2); -}this.threads[this.nthreads] = t; -this.nthreads++; -this.nUnstartedThreads--; -}}, "java.lang.Thread"); -Clazz_defineMethod (c$, "remove", -function (t) { -{ -if (this.destroyed) { -return; -}for (var i = 0; i < this.nthreads; i++) { -if (this.threads[i] === t) { -System.arraycopy (this.threads, i + 1, this.threads, i, --this.nthreads - i); -this.threads[this.nthreads] = null; -break; -}} -if (this.nthreads == 0) { -this.notifyAll (); -}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) { -this.destroy (); -}}}, "java.lang.Thread"); -Clazz_defineMethod (c$, "uncaughtException", -function (t, e) { -if (this.parent != null) { -this.parent.uncaughtException (t, e); -} else { -var ueh = java.lang.Thread.getDefaultUncaughtExceptionHandler (); -if (ueh != null) { -ueh.uncaughtException (t, e); -} else if (!(Clazz_instanceOf (e, ThreadDeath))) { -System.err.print ("Exception in thread \"" + t.getName () + "\" "); -e.printStackTrace (System.err); -}}}, "java.lang.Thread,Throwable"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[name=" + this.getName () + ",maxpri=" + this.maxPriority + ",html5Applet=" + this.html5Applet + "]"; -}); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.LayoutManager"], "java.awt.FlowLayout", ["java.awt.Dimension"], function () { -c$ = Clazz_decorateAsClass (function () { -this.align = 0; -this.newAlign = 0; -this.hgap = 0; -this.vgap = 0; -this.alignOnBaseline = false; -Clazz_instantialize (this, arguments); -}, java.awt, "FlowLayout", null, [java.awt.LayoutManager, java.io.Serializable]); -Clazz_makeConstructor (c$, -function () { -this.construct (1, 5, 5); -}); -Clazz_makeConstructor (c$, -function (align) { -this.construct (align, 5, 5); -}, "~N"); -Clazz_makeConstructor (c$, -function (align, hgap, vgap) { -this.hgap = hgap; -this.vgap = vgap; -this.setAlignment (align); -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "getAlignment", -function () { -return this.newAlign; -}); -Clazz_defineMethod (c$, "setAlignment", -function (align) { -this.newAlign = align; -switch (align) { -case 3: -this.align = 0; -break; -case 4: -this.align = 2; -break; -default: -this.align = align; -break; -} -}, "~N"); -Clazz_defineMethod (c$, "getHgap", -function () { -return this.hgap; -}); -Clazz_defineMethod (c$, "setHgap", -function (hgap) { -this.hgap = hgap; -}, "~N"); -Clazz_defineMethod (c$, "getVgap", -function () { -return this.vgap; -}); -Clazz_defineMethod (c$, "setVgap", -function (vgap) { -this.vgap = vgap; -}, "~N"); -Clazz_defineMethod (c$, "setAlignOnBaseline", -function (alignOnBaseline) { -this.alignOnBaseline = alignOnBaseline; -}, "~B"); -Clazz_defineMethod (c$, "getAlignOnBaseline", -function () { -return this.alignOnBaseline; -}); -Clazz_overrideMethod (c$, "addLayoutComponent", -function (name, comp) { -}, "~S,java.awt.Component"); -Clazz_overrideMethod (c$, "removeLayoutComponent", -function (comp) { -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "preferredLayoutSize", -function (target) { -{ -var dim = new java.awt.Dimension (0, 0); -var nmembers = target.getComponentCount (); -var firstVisibleComponent = true; -var useBaseline = this.getAlignOnBaseline (); -var maxAscent = 0; -var maxDescent = 0; -for (var i = 0; i < nmembers; i++) { -var m = target.getComponent (i); -if (m.isVisible ()) { -var d = m.getPreferredSize (); -dim.height = Math.max (dim.height, d.height); -if (firstVisibleComponent) { -firstVisibleComponent = false; -} else { -dim.width += this.hgap; -}dim.width += d.width; -if (useBaseline) { -var baseline = m.getBaseline (d.width, d.height); -if (baseline >= 0) { -maxAscent = Math.max (maxAscent, baseline); -maxDescent = Math.max (maxDescent, d.height - baseline); -}}}} -if (useBaseline) { -dim.height = Math.max (maxAscent + maxDescent, dim.height); -}var insets = target.getInsets (); -dim.width += insets.left + insets.right + this.hgap * 2; -dim.height += insets.top + insets.bottom + this.vgap * 2; -return dim; -}}, "java.awt.Container"); -Clazz_overrideMethod (c$, "minimumLayoutSize", -function (target) { -{ -var useBaseline = this.getAlignOnBaseline (); -var dim = new java.awt.Dimension (0, 0); -var nmembers = target.getComponentCount (); -var maxAscent = 0; -var maxDescent = 0; -var firstVisibleComponent = true; -for (var i = 0; i < nmembers; i++) { -var m = target.getComponent (i); -if (m.visible) { -var d = m.getMinimumSize (); -dim.height = Math.max (dim.height, d.height); -if (firstVisibleComponent) { -firstVisibleComponent = false; -} else { -dim.width += this.hgap; -}dim.width += d.width; -if (useBaseline) { -var baseline = m.getBaseline (d.width, d.height); -if (baseline >= 0) { -maxAscent = Math.max (maxAscent, baseline); -maxDescent = Math.max (maxDescent, dim.height - baseline); -}}}} -if (useBaseline) { -dim.height = Math.max (maxAscent + maxDescent, dim.height); -}var insets = target.getInsets (); -dim.width += insets.left + insets.right + this.hgap * 2; -dim.height += insets.top + insets.bottom + this.vgap * 2; -return dim; -}}, "java.awt.Container"); -Clazz_defineMethod (c$, "moveComponents", - function (target, x, y, width, height, rowStart, rowEnd, ltr, useBaseline, ascent, descent) { -switch (this.newAlign) { -case 0: -x += ltr ? 0 : width; -break; -case 1: -x += Clazz_doubleToInt (width / 2); -break; -case 2: -x += ltr ? width : 0; -break; -case 3: -break; -case 4: -x += width; -break; -} -var maxAscent = 0; -var nonbaselineHeight = 0; -var baselineOffset = 0; -if (useBaseline) { -var maxDescent = 0; -for (var i = rowStart; i < rowEnd; i++) { -var m = target.getComponent (i); -if (m.visible) { -if (ascent[i] >= 0) { -maxAscent = Math.max (maxAscent, ascent[i]); -maxDescent = Math.max (maxDescent, descent[i]); -} else { -nonbaselineHeight = Math.max (m.getHeight (), nonbaselineHeight); -}}} -height = Math.max (maxAscent + maxDescent, nonbaselineHeight); -baselineOffset = Clazz_doubleToInt ((height - maxAscent - maxDescent) / 2); -}for (var i = rowStart; i < rowEnd; i++) { -var m = target.getComponent (i); -if (m.isVisible ()) { -var cy; -if (useBaseline && ascent[i] >= 0) { -cy = y + baselineOffset + maxAscent - ascent[i]; -} else { -cy = y + Clazz_doubleToInt ((height - m.height) / 2); -}if (ltr) { -m.setLocation (x, cy); -} else { -m.setLocation (target.width - x - m.width, cy); -}x += m.width + this.hgap; -}} -return height; -}, "java.awt.Container,~N,~N,~N,~N,~N,~N,~B,~B,~A,~A"); -Clazz_overrideMethod (c$, "layoutContainer", -function (target) { -System.out.println ("FlowLayout laying out " + target); -{ -var insets = target.getInsets (); -var maxwidth = target.width - (insets.left + insets.right + this.hgap * 2); -var nmembers = target.getComponentCount (); -var x = 0; -var y = insets.top + this.vgap; -var rowh = 0; -var start = 0; -var ltr = target.getComponentOrientation ().isLeftToRight (); -var useBaseline = this.getAlignOnBaseline (); -var ascent = null; -var descent = null; -if (useBaseline) { -ascent = Clazz_newIntArray (nmembers, 0); -descent = Clazz_newIntArray (nmembers, 0); -}for (var i = 0; i < nmembers; i++) { -var m = target.getComponent (i); -if (m.isVisible ()) { -var d = m.getPreferredSize (); -m.setSize (d.width, d.height); -if (useBaseline) { -var baseline = m.getBaseline (d.width, d.height); -if (baseline >= 0) { -ascent[i] = baseline; -descent[i] = d.height - baseline; -} else { -ascent[i] = -1; -}}if ((x == 0) || ((x + d.width) <= maxwidth)) { -if (x > 0) { -x += this.hgap; -}x += d.width; -rowh = Math.max (rowh, d.height); -} else { -rowh = this.moveComponents (target, insets.left + this.hgap, y, maxwidth - x, rowh, start, i, ltr, useBaseline, ascent, descent); -x = d.width; -y += this.vgap + rowh; -rowh = d.height; -start = i; -}}} -this.moveComponents (target, insets.left + this.hgap, y, maxwidth - x, rowh, start, nmembers, ltr, useBaseline, ascent, descent); -}}, "java.awt.Container"); -Clazz_overrideMethod (c$, "toString", -function () { -var str = ""; -switch (this.align) { -case 0: -str = ",align=left"; -break; -case 1: -str = ",align=center"; -break; -case 2: -str = ",align=right"; -break; -case 3: -str = ",align=leading"; -break; -case 4: -str = ",align=trailing"; -break; -} -return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + str + "]"; -}); -Clazz_defineStatics (c$, -"LEFT", 0, -"CENTER", 1, -"RIGHT", 2, -"LEADING", 3, -"TRAILING", 4); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.LayoutManager2"], "java.awt.BorderLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension"], function () { -c$ = Clazz_decorateAsClass (function () { -this.hgap = 0; -this.vgap = 0; -this.north = null; -this.west = null; -this.east = null; -this.south = null; -this.center = null; -this.firstLine = null; -this.lastLine = null; -this.firstItem = null; -this.lastItem = null; -Clazz_instantialize (this, arguments); -}, java.awt, "BorderLayout", null, [java.awt.LayoutManager2, java.io.Serializable]); -Clazz_makeConstructor (c$, -function () { -this.construct (0, 0); -}); -Clazz_makeConstructor (c$, -function (hgap, vgap) { -this.hgap = hgap; -this.vgap = vgap; -}, "~N,~N"); -Clazz_defineMethod (c$, "getHgap", -function () { -return this.hgap; -}); -Clazz_defineMethod (c$, "setHgap", -function (hgap) { -this.hgap = hgap; -}, "~N"); -Clazz_defineMethod (c$, "getVgap", -function () { -return this.vgap; -}); -Clazz_defineMethod (c$, "setVgap", -function (vgap) { -this.vgap = vgap; -}, "~N"); -Clazz_defineMethod (c$, "addLayoutComponent", -function (comp, constraints) { -{ -if ((constraints == null) || (Clazz_instanceOf (constraints, String))) { -this.addLayoutComponent (constraints, comp); -} else { -throw new IllegalArgumentException ("cannot add to layout: constraint must be a string (or null)"); -}}}, "java.awt.Component,~O"); -Clazz_defineMethod (c$, "addLayoutComponent", -function (name, comp) { -{ -if (name == null) { -name = "Center"; -}System.out.println ("BorderLayout adding " + name + " " + comp); -if ("Center".equals (name)) { -this.center = comp; -} else if ("North".equals (name)) { -this.north = comp; -} else if ("South".equals (name)) { -this.south = comp; -} else if ("East".equals (name)) { -this.east = comp; -} else if ("West".equals (name)) { -this.west = comp; -} else if ("First".equals (name)) { -this.firstLine = comp; -} else if ("Last".equals (name)) { -this.lastLine = comp; -} else if ("Before".equals (name)) { -this.firstItem = comp; -} else if ("After".equals (name)) { -this.lastItem = comp; -} else { -throw new IllegalArgumentException ("cannot add to layout: unknown constraint: " + name); -}}}, "~S,java.awt.Component"); -Clazz_overrideMethod (c$, "removeLayoutComponent", -function (comp) { -{ -if (comp === this.center) { -this.center = null; -} else if (comp === this.north) { -this.north = null; -} else if (comp === this.south) { -this.south = null; -} else if (comp === this.east) { -this.east = null; -} else if (comp === this.west) { -this.west = null; -}if (comp === this.firstLine) { -this.firstLine = null; -} else if (comp === this.lastLine) { -this.lastLine = null; -} else if (comp === this.firstItem) { -this.firstItem = null; -} else if (comp === this.lastItem) { -this.lastItem = null; -}}}, "java.awt.Component"); -Clazz_defineMethod (c$, "getLayoutComponent", -function (constraints) { -if ("Center".equals (constraints)) { -return this.center; -} else if ("North".equals (constraints)) { -return this.north; -} else if ("South".equals (constraints)) { -return this.south; -} else if ("West".equals (constraints)) { -return this.west; -} else if ("East".equals (constraints)) { -return this.east; -} else if ("First".equals (constraints)) { -return this.firstLine; -} else if ("Last".equals (constraints)) { -return this.lastLine; -} else if ("Before".equals (constraints)) { -return this.firstItem; -} else if ("After".equals (constraints)) { -return this.lastItem; -} else { -throw new IllegalArgumentException ("cannot get component: unknown constraint: " + constraints); -}}, "~O"); -Clazz_defineMethod (c$, "getLayoutComponent", -function (target, constraints) { -var ltr = target.getComponentOrientation ().isLeftToRight (); -var result = null; -if ("North".equals (constraints)) { -result = (this.firstLine != null) ? this.firstLine : this.north; -} else if ("South".equals (constraints)) { -result = (this.lastLine != null) ? this.lastLine : this.south; -} else if ("West".equals (constraints)) { -result = ltr ? this.firstItem : this.lastItem; -if (result == null) { -result = this.west; -}} else if ("East".equals (constraints)) { -result = ltr ? this.lastItem : this.firstItem; -if (result == null) { -result = this.east; -}} else if ("Center".equals (constraints)) { -result = this.center; -} else { -throw new IllegalArgumentException ("cannot get component: invalid constraint: " + constraints); -}return result; -}, "java.awt.Container,~O"); -Clazz_defineMethod (c$, "getConstraints", -function (comp) { -if (comp == null) { -return null; -}if (comp === this.center) { -return "Center"; -} else if (comp === this.north) { -return "North"; -} else if (comp === this.south) { -return "South"; -} else if (comp === this.west) { -return "West"; -} else if (comp === this.east) { -return "East"; -} else if (comp === this.firstLine) { -return "First"; -} else if (comp === this.lastLine) { -return "Last"; -} else if (comp === this.firstItem) { -return "Before"; -} else if (comp === this.lastItem) { -return "After"; -}return null; -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "minimumLayoutSize", -function (target) { -{ -var dim = new java.awt.Dimension (0, 0); -var ltr = target.getComponentOrientation ().isLeftToRight (); -var c = null; -if ((c = this.getChild ("East", ltr)) != null) { -var d = c.getMinimumSize (); -dim.width += d.width + this.hgap; -dim.height = Math.max (d.height, dim.height); -}if ((c = this.getChild ("West", ltr)) != null) { -var d = c.getMinimumSize (); -dim.width += d.width + this.hgap; -dim.height = Math.max (d.height, dim.height); -}if ((c = this.getChild ("Center", ltr)) != null) { -var d = c.getMinimumSize (); -dim.width += d.width; -dim.height = Math.max (d.height, dim.height); -}if ((c = this.getChild ("North", ltr)) != null) { -var d = c.getMinimumSize (); -dim.width = Math.max (d.width, dim.width); -dim.height += d.height + this.vgap; -}if ((c = this.getChild ("South", ltr)) != null) { -var d = c.getMinimumSize (); -dim.width = Math.max (d.width, dim.width); -dim.height += d.height + this.vgap; -}var insets = target.getInsets (); -dim.width += insets.left + insets.right; -dim.height += insets.top + insets.bottom; -return dim; -}}, "java.awt.Container"); -Clazz_overrideMethod (c$, "preferredLayoutSize", -function (target) { -{ -var dim = new java.awt.Dimension (0, 0); -var ltr = target.getComponentOrientation ().isLeftToRight (); -var c = null; -if ((c = this.getChild ("East", ltr)) != null) { -var d = c.getPreferredSize (); -dim.width += d.width + this.hgap; -dim.height = Math.max (d.height, dim.height); -}if ((c = this.getChild ("West", ltr)) != null) { -var d = c.getPreferredSize (); -dim.width += d.width + this.hgap; -dim.height = Math.max (d.height, dim.height); -}if ((c = this.getChild ("Center", ltr)) != null) { -var d = c.getPreferredSize (); -dim.width += d.width; -dim.height = Math.max (d.height, dim.height); -}if ((c = this.getChild ("North", ltr)) != null) { -var d = c.getPreferredSize (); -dim.width = Math.max (d.width, dim.width); -dim.height += d.height + this.vgap; -}if ((c = this.getChild ("South", ltr)) != null) { -var d = c.getPreferredSize (); -dim.width = Math.max (d.width, dim.width); -dim.height += d.height + this.vgap; -}var insets = target.getInsets (); -dim.width += insets.left + insets.right; -dim.height += insets.top + insets.bottom; -return dim; -}}, "java.awt.Container"); -Clazz_overrideMethod (c$, "maximumLayoutSize", -function (target) { -return new java.awt.Dimension (2147483647, 2147483647); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayoutAlignmentX", -function (parent) { -return 0.5; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayoutAlignmentY", -function (parent) { -return 0.5; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "invalidateLayout", -function (target) { -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "layoutContainer", -function (target) { -System.out.println ("BorderLayout laying out " + target); -{ -var insets = target.getInsets (); -var top = insets.top; -var bottom = target.height - insets.bottom; -var left = insets.left; -var right = target.width - insets.right; -var ltr = target.getComponentOrientation ().isLeftToRight (); -var c = null; -if ((c = this.getChild ("North", ltr)) != null) { -c.setSize (right - left, c.height); -var d = c.getPreferredSize (); -c.setBounds (left, top, right - left, d.height); -top += d.height + this.vgap; -}if ((c = this.getChild ("South", ltr)) != null) { -c.setSize (right - left, c.height); -var d = c.getPreferredSize (); -c.setBounds (left, bottom - d.height, right - left, d.height); -bottom -= d.height + this.vgap; -}if ((c = this.getChild ("East", ltr)) != null) { -c.setSize (c.width, bottom - top); -var d = c.getPreferredSize (); -c.setBounds (right - d.width, top, d.width, bottom - top); -right -= d.width + this.hgap; -}if ((c = this.getChild ("West", ltr)) != null) { -c.setSize (c.width, bottom - top); -var d = c.getPreferredSize (); -c.setBounds (left, top, d.width, bottom - top); -left += d.width + this.hgap; -}if ((c = this.getChild ("Center", ltr)) != null) { -c.setBounds (left, top, right - left, bottom - top); -}}}, "java.awt.Container"); -Clazz_defineMethod (c$, "getChild", - function (key, ltr) { -var result = null; -if (key === "North") { -result = (this.firstLine != null) ? this.firstLine : this.north; -} else if (key === "South") { -result = (this.lastLine != null) ? this.lastLine : this.south; -} else if (key === "West") { -result = ltr ? this.firstItem : this.lastItem; -if (result == null) { -result = this.west; -}} else if (key === "East") { -result = ltr ? this.lastItem : this.firstItem; -if (result == null) { -result = this.east; -}} else if (key === "Center") { -result = this.center; -}if (result != null && !result.visible) { -result = null; -}return result; -}, "~S,~B"); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + "]"; -}); -Clazz_defineStatics (c$, -"NORTH", "North", -"SOUTH", "South", -"EAST", "East", -"WEST", "West", -"CENTER", "Center", -"BEFORE_FIRST_LINE", "First", -"AFTER_LAST_LINE", "Last", -"BEFORE_LINE_BEGINS", "Before", -"AFTER_LINE_ENDS", "After"); -c$.PAGE_START = c$.prototype.PAGE_START = "First"; -c$.PAGE_END = c$.prototype.PAGE_END = "Last"; -c$.LINE_START = c$.prototype.LINE_START = "Before"; -c$.LINE_END = c$.prototype.LINE_END = "After"; -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.LayoutManager"], "java.awt.LayoutManager2", null, function () { -Clazz_declareInterface (java.awt, "LayoutManager2", java.awt.LayoutManager); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "LayoutManager"); -Clazz_declarePackage ("java.awt"); -Clazz_load (["jssun.awt.SunGraphicsCallback"], "java.awt.GraphicsCallback", null, function () { -c$ = Clazz_declareType (java.awt, "GraphicsCallback", jssun.awt.SunGraphicsCallback); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.GraphicsCallback, "PaintCallback", java.awt.GraphicsCallback); -Clazz_makeConstructor (c$, - function () { -Clazz_superConstructor (this, java.awt.GraphicsCallback.PaintCallback, []); -}); -Clazz_overrideMethod (c$, "run", -function (a, b) { -a.paint (b); -}, "java.awt.Component,java.awt.Graphics"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function () { -return java.awt.GraphicsCallback.PaintCallback.instance; -}); -c$.instance = c$.prototype.instance = new java.awt.GraphicsCallback.PaintCallback (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.GraphicsCallback, "PaintAllCallback", java.awt.GraphicsCallback); -Clazz_makeConstructor (c$, - function () { -Clazz_superConstructor (this, java.awt.GraphicsCallback.PaintAllCallback, []); -}); -Clazz_overrideMethod (c$, "run", -function (a, b) { -a.paintAll (b); -}, "java.awt.Component,java.awt.Graphics"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function () { -return java.awt.GraphicsCallback.PaintAllCallback.instance; -}); -c$.instance = c$.prototype.instance = new java.awt.GraphicsCallback.PaintAllCallback (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.GraphicsCallback, "PaintHeavyweightComponentsCallback", java.awt.GraphicsCallback); -Clazz_makeConstructor (c$, - function () { -Clazz_superConstructor (this, java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback, []); -}); -Clazz_overrideMethod (c$, "run", -function (a, b) { -if (a.isLightweight ()) { -a.paintHeavyweightComponents (b); -} else { -a.paintAll (b); -}}, "java.awt.Component,java.awt.Graphics"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function () { -return java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback.instance; -}); -c$.instance = c$.prototype.instance = new java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback (); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.Component", "java.awt.event.AWTEventListener"], ["java.awt.LightweightDispatcher", "$.Container"], ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "$.IllegalStateException", "java.util.ArrayList", "java.awt.AWTEventMulticaster", "$.Dimension", "$.GraphicsCallback", "$.Insets", "$.LayoutManager2", "$.Toolkit", "java.awt.event.ContainerEvent", "$.ContainerListener", "$.MouseEvent", "$.MouseWheelEvent", "java.awt.peer.ContainerPeer", "$.LightweightPeer"], function () { -c$ = Clazz_decorateAsClass (function () { -this.component = null; -this.layoutMgr = null; -this.dispatcher = null; -this.focusCycleRoot = false; -this.focusTraversalPolicyProvider = false; -this.containerListener = null; -this.listeningChildren = 0; -this.listeningBoundsChildren = 0; -this.descendantsCount = 0; -this.preserveBackgroundColor = null; -this.numOfHWComponents = 0; -this.numOfLWComponents = 0; -this.modalComp = null; -this.modalAppContext = null; -Clazz_instantialize (this, arguments); -}, java.awt, "Container", java.awt.Component); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.Container, []); -this.component = new java.util.ArrayList (); -}); -Clazz_defineMethod (c$, "initializeFocusTraversalKeys", -function () { -}); -Clazz_defineMethod (c$, "getComponentCount", -function () { -return this.countComponents (); -}); -Clazz_defineMethod (c$, "countComponents", -function () { -return this.component.size (); -}); -Clazz_defineMethod (c$, "getComponent", -function (n) { -if ((n < 0) || (n >= this.component.size ())) { -throw new ArrayIndexOutOfBoundsException ("No such child: " + n); -}return this.component.get (n); -}, "~N"); -Clazz_defineMethod (c$, "getComponents", -function () { -return this.getComponents_NoClientCode (); -}); -Clazz_defineMethod (c$, "getComponents_NoClientCode", -function () { -return this.component.toArray (java.awt.Container.EMPTY_ARRAY); -}); -Clazz_defineMethod (c$, "getInsets", -function () { -var peer = this.peer; -if (Clazz_instanceOf (peer, java.awt.peer.ContainerPeer)) { -var cpeer = peer; -return cpeer.getInsets ().clone (); -}return new java.awt.Insets (0, 0, 0, 0); -}); -Clazz_defineMethod (c$, "add", -function (comp) { -return this.addImpl (comp, null, -1); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "add", -function (name, comp) { -return this.addImpl (comp, name, -1); -}, "~S,java.awt.Component"); -Clazz_defineMethod (c$, "add", -function (comp, index) { -return this.addImpl (comp, null, index); -}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "checkAddToSelf", - function (comp) { -if (Clazz_instanceOf (comp, java.awt.Container)) { -for (var cn = this; cn != null; cn = cn.parent) { -if (cn === comp) { -throw new IllegalArgumentException ("adding container's parent to itself"); -}} -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "checkNotAWindow", - function (comp) { -if (Clazz_instanceOf (comp, java.awt.Window)) { -throw new IllegalArgumentException ("adding a window to a container"); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "removeDelicately", - function (comp, newParent, newIndex) { -var index = this.getComponentZOrder (comp); -var needRemoveNotify = java.awt.Container.isRemoveNotifyNeeded (comp, this, newParent); -if (needRemoveNotify) { -comp.removeNotify (); -}if (newParent !== this) { -if (this.layoutMgr != null) { -this.layoutMgr.removeLayoutComponent (comp); -}this.adjustListeningChildren (32768, -comp.numListening (32768)); -this.adjustListeningChildren (65536, -comp.numListening (65536)); -this.adjustDescendants (-(comp.countHierarchyMembers ())); -comp.parent = null; -this.component.remove (index); -this.invalidateIfValid (); -} else { -this.component.remove (index); -this.component.add (newIndex, comp); -}if (comp.parent == null) { -if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { -var e = new java.awt.event.ContainerEvent (this, 301, comp); -this.dispatchEvent (e); -}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); -if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { -this.updateCursorImmediately (); -}}return needRemoveNotify; -}, "java.awt.Component,java.awt.Container,~N"); -Clazz_defineMethod (c$, "canContainFocusOwner", -function (focusOwnerCandidate) { -if (!(this.isEnabled () && this.isDisplayable () && this.isVisible () && this.isFocusable ())) { -return false; -}{ -if (this.parent != null) { -return this.parent.canContainFocusOwner (focusOwnerCandidate); -}}return true; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "hasHeavyweightDescendants", -function () { -return this.numOfHWComponents > 0; -}); -Clazz_defineMethod (c$, "hasLightweightDescendants", -function () { -return this.numOfLWComponents > 0; -}); -Clazz_defineMethod (c$, "getHeavyweightContainer", -function () { -if (this.peer != null && !(Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer))) { -return this; -} else { -return this.getNativeContainer (); -}}); -c$.isRemoveNotifyNeeded = Clazz_defineMethod (c$, "isRemoveNotifyNeeded", - function (comp, oldContainer, newContainer) { -return false; -}, "java.awt.Component,java.awt.Container,java.awt.Container"); -Clazz_defineMethod (c$, "setComponentZOrder", -function (comp, index) { -{ -var curParent = comp.parent; -var oldZindex = this.getComponentZOrder (comp); -if (curParent === this && index == oldZindex) { -return; -}var peerRecreated = (curParent != null) ? curParent.removeDelicately (comp, this, index) : false; -this.addDelicately (comp, curParent, index); -if (!peerRecreated && oldZindex != -1) { -comp.mixOnZOrderChanging (oldZindex, index); -}}}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "reparentTraverse", - function (parentPeer, child) { -this.checkTreeLock (); -for (var i = 0; i < child.getComponentCount (); i++) { -var comp = child.getComponent (i); -if (comp.isLightweight ()) { -if (Clazz_instanceOf (comp, java.awt.Container)) { -this.reparentTraverse (parentPeer, comp); -}} else { -comp.getPeer ().reparent (parentPeer); -}} -}, "java.awt.peer.ContainerPeer,java.awt.Container"); -Clazz_defineMethod (c$, "reparentChild", - function (comp) { -if (comp == null) { -return; -}if (comp.isLightweight ()) { -if (Clazz_instanceOf (comp, java.awt.Container)) { -this.reparentTraverse (this.getPeer (), comp); -}} else { -comp.getPeer ().reparent (this.getPeer ()); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "addDelicately", - function (comp, curParent, index) { -this.checkTreeLock (); -if (curParent !== this) { -if (index == -1) { -this.component.add (comp); -} else { -this.component.add (index, comp); -}comp.parent = this; -this.adjustListeningChildren (32768, comp.numListening (32768)); -this.adjustListeningChildren (65536, comp.numListening (65536)); -this.adjustDescendants (comp.countHierarchyMembers ()); -} else { -if (index < this.component.size ()) { -this.component.set (index, comp); -}}this.invalidateIfValid (); -if (this.peer != null) { -if (comp.peer == null) { -comp.addNotify (); -} else { -var newNativeContainer = this.getHeavyweightContainer (); -var oldNativeContainer = curParent.getHeavyweightContainer (); -if (oldNativeContainer !== newNativeContainer) { -newNativeContainer.reparentChild (comp); -}if (!comp.isLightweight () && this.isLightweight ()) { -comp.relocateComponent (); -}}}if (curParent !== this) { -if (this.layoutMgr != null) { -if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { -(this.layoutMgr).addLayoutComponent (comp, null); -} else { -this.layoutMgr.addLayoutComponent (null, comp); -}}if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { -var e = new java.awt.event.ContainerEvent (this, 300, comp); -this.dispatchEvent (e); -}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); -} else { -comp.createHierarchyEvents (1400, comp, this, 1400, java.awt.Toolkit.enabledOnToolkit (32768)); -}if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { -this.updateCursorImmediately (); -}}, "java.awt.Component,java.awt.Container,~N"); -Clazz_defineMethod (c$, "checkTreeLock", - function () { -}); -Clazz_defineMethod (c$, "getComponentZOrder", -function (comp) { -if (comp == null) { -return -1; -}{ -if (comp.parent !== this) { -return -1; -}return this.component.indexOf (comp); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "add", -function (comp, constraints) { -this.addImpl (comp, constraints, -1); -}, "java.awt.Component,~O"); -Clazz_defineMethod (c$, "add", -function (comp, constraints, index) { -return this.addImpl (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "addImpl", -function (comp, constraints, index) { -return this.addImplSAEM (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "addImplSAEM", -function (comp, constraints, index) { -{ -if (index > this.component.size () || (index < 0 && index != -1)) { -throw new IllegalArgumentException ("illegal component position"); -}this.checkAddToSelf (comp); -this.checkNotAWindow (comp); -if (comp.parent != null) { -comp.parent.remove (comp); -if (index > this.component.size ()) { -throw new IllegalArgumentException ("illegal component position"); -}}if (index == -1) { -this.component.add (comp); -} else { -this.component.add (index, comp); -}comp.parent = this; -this.adjustListeningChildren (32768, comp.numListening (32768)); -this.adjustListeningChildren (65536, comp.numListening (65536)); -this.adjustDescendants (comp.countHierarchyMembers ()); -this.invalidateIfValid (); -if (this.peer != null) { -comp.addNotify (); -}if (this.layoutMgr != null) { -if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { -(this.layoutMgr).addLayoutComponent (comp, constraints); -} else if (Clazz_instanceOf (constraints, String)) { -this.layoutMgr.addLayoutComponent (constraints, comp); -}}if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { -var e = new java.awt.event.ContainerEvent (this, 300, comp); -this.dispatchEvent (e); -}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); -if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { -this.updateCursorImmediately (); -}}return comp; -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "checkGD", -function (stringID) { -}, "~S"); -Clazz_defineMethod (c$, "remove", -function (index) { -this.removeInt (index); -}, "~N"); -Clazz_defineMethod (c$, "removeInt", -function (index) { -{ -if (index < 0 || index >= this.component.size ()) { -throw new ArrayIndexOutOfBoundsException (index); -}var comp = this.component.get (index); -if (this.peer != null) { -comp.removeNotify (); -}if (this.layoutMgr != null) { -this.layoutMgr.removeLayoutComponent (comp); -}this.adjustListeningChildren (32768, -comp.numListening (32768)); -this.adjustListeningChildren (65536, -comp.numListening (65536)); -this.adjustDescendants (-(comp.countHierarchyMembers ())); -comp.parent = null; -this.component.remove (index); -this.invalidateIfValid (); -if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { -var e = new java.awt.event.ContainerEvent (this, 301, comp); -this.dispatchEvent (e); -}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); -if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { -this.updateCursorImmediately (); -}}}, "~N"); -Clazz_defineMethod (c$, "remove", -function (comp) { -this.removeChild (comp); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "removeChild", -function (comp) { -{ -if (comp.parent === this) { -var index = this.component.indexOf (comp); -if (index >= 0) { -this.remove (index); -}}}}, "java.awt.Component"); -Clazz_defineMethod (c$, "removeAll", -function () { -{ -this.adjustListeningChildren (32768, -this.listeningChildren); -this.adjustListeningChildren (65536, -this.listeningBoundsChildren); -this.adjustDescendants (-this.descendantsCount); -while (!this.component.isEmpty ()) { -var comp = this.component.remove (this.component.size () - 1); -if (this.peer != null) { -comp.removeNotify (); -}if (this.layoutMgr != null) { -this.layoutMgr.removeLayoutComponent (comp); -}comp.parent = null; -if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { -var e = new java.awt.event.ContainerEvent (this, 301, comp); -this.dispatchEvent (e); -}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); -} -if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { -this.updateCursorImmediately (); -}this.invalidateIfValid (); -}}); -Clazz_defineMethod (c$, "numListening", -function (mask) { -var superListening = this.numListeningMask (mask); -if (mask == 32768) { -return this.listeningChildren + superListening; -} else if (mask == 65536) { -return this.listeningBoundsChildren + superListening; -} else { -return superListening; -}}, "~N"); -Clazz_defineMethod (c$, "adjustListeningChildren", -function (mask, num) { -if (num == 0) return; -if ((mask & 32768) != 0) { -this.listeningChildren += num; -}if ((mask & 65536) != 0) { -this.listeningBoundsChildren += num; -}this.adjustListeningChildrenOnParent (mask, num); -}, "~N,~N"); -Clazz_defineMethod (c$, "adjustDescendants", -function (num) { -if (num == 0) return; -this.descendantsCount += num; -this.adjustDecendantsOnParent (num); -}, "~N"); -Clazz_defineMethod (c$, "adjustDecendantsOnParent", -function (num) { -if (this.parent != null) { -this.parent.adjustDescendants (num); -}}, "~N"); -Clazz_defineMethod (c$, "countHierarchyMembers", -function () { -return this.descendantsCount + 1; -}); -Clazz_defineMethod (c$, "getListenersCount", - function (id, enabledOnToolkit) { -if (enabledOnToolkit) { -return this.descendantsCount; -}switch (id) { -case 1400: -return this.listeningChildren; -case 1401: -case 1402: -return this.listeningBoundsChildren; -default: -return 0; -} -}, "~N,~B"); -Clazz_defineMethod (c$, "createHierarchyEvents", -function (id, changed, changedParent, changeFlags, enabledOnToolkit) { -var listeners = this.getListenersCount (id, enabledOnToolkit); -for (var count = listeners, i = 0; count > 0; i++) { -count -= this.component.get (i).createHierarchyEvents (id, changed, changedParent, changeFlags, enabledOnToolkit); -} -return listeners + this.createHierEventsComp (id, changed, changedParent, changeFlags, enabledOnToolkit); -}, "~N,java.awt.Component,java.awt.Container,~N,~B"); -Clazz_defineMethod (c$, "createChildHierarchyEvents", -function (id, changeFlags, enabledOnToolkit) { -if (this.component.isEmpty ()) { -return; -}var listeners = this.getListenersCount (id, enabledOnToolkit); -for (var count = listeners, i = 0; count > 0; i++) { -count -= this.component.get (i).createHierarchyEvents (id, this, this.parent, changeFlags, enabledOnToolkit); -} -}, "~N,~N,~B"); -Clazz_defineMethod (c$, "getLayout", -function () { -return this.layoutMgr; -}); -Clazz_defineMethod (c$, "setLayout", -function (mgr) { -this.layoutMgr = mgr; -this.invalidateIfValid (); -}, "java.awt.LayoutManager"); -Clazz_overrideMethod (c$, "doLayout", -function () { -this.layout (); -}); -Clazz_overrideMethod (c$, "layout", -function () { -var layoutMgr = this.layoutMgr; -if (layoutMgr != null) { -layoutMgr.layoutContainer (this); -}}); -Clazz_overrideMethod (c$, "invalidate", -function () { -var layoutMgr = this.layoutMgr; -if (Clazz_instanceOf (layoutMgr, java.awt.LayoutManager2)) { -var lm = layoutMgr; -lm.invalidateLayout (this); -}this.invalidateComp (); -}); -Clazz_overrideMethod (c$, "validate", -function () { -if (!this.isValid ()) { -var updateCur = false; -{ -if (!this.isValid () && this.peer != null) { -var p = null; -if (Clazz_instanceOf (this.peer, java.awt.peer.ContainerPeer)) { -p = this.peer; -}if (p != null) { -p.beginValidate (); -}this.validateTree (); -if (p != null) { -p.endValidate (); -updateCur = this.isVisible (); -}}}if (updateCur) { -this.updateCursorImmediately (); -}}}); -Clazz_defineMethod (c$, "validateTree", -function () { -if (!this.isValid ()) { -if (Clazz_instanceOf (this.peer, java.awt.peer.ContainerPeer)) { -(this.peer).beginLayout (); -}this.doLayout (); -for (var i = 0; i < this.component.size (); i++) { -var comp = this.component.get (i); -if ((Clazz_instanceOf (comp, java.awt.Container)) && !(Clazz_instanceOf (comp, java.awt.Window)) && !comp.isValid ()) { -(comp).validateTree (); -} else { -comp.validate (); -}} -if (Clazz_instanceOf (this.peer, java.awt.peer.ContainerPeer)) { -(this.peer).endLayout (); -}}this.validateComponent (); -}); -Clazz_defineMethod (c$, "invalidateTree", -function () { -{ -for (var i = 0; i < this.component.size (); i++) { -var comp = this.component.get (i); -if (Clazz_instanceOf (comp, java.awt.Container)) { -(comp).invalidateTree (); -} else { -comp.invalidateIfValid (); -}} -this.invalidateIfValid (); -}}); -Clazz_overrideMethod (c$, "setFont", -function (f) { -var oldfont = this.getFont (); -this.setFontComp (f); -var newfont = this.getFont (); -if (newfont !== oldfont && (oldfont == null || !oldfont.equals (newfont))) { -this.invalidateTree (); -}}, "java.awt.Font"); -Clazz_overrideMethod (c$, "getPreferredSize", -function () { -return this.preferredSize (); -}); -Clazz_overrideMethod (c$, "preferredSize", -function () { -var dim = this.prefSize; -if (dim == null || !(this.isPreferredSizeSet () || this.isValid ())) { -{ -this.prefSize = (this.layoutMgr != null) ? this.layoutMgr.preferredLayoutSize (this) : this.prefSizeComp (); -dim = this.prefSize; -}}return (dim == null ? null : new java.awt.Dimension (dim)); -}); -Clazz_overrideMethod (c$, "getMinimumSize", -function () { -var dim = this.minSize; -if (dim == null || !(this.isMinimumSizeSet () || this.isValid ())) { -{ -this.minSize = (this.layoutMgr != null) ? this.layoutMgr.minimumLayoutSize (this) : this.minimumSize (); -dim = this.minSize; -}}if (dim != null) { -return new java.awt.Dimension (dim); -} else { -return dim; -}}); -Clazz_overrideMethod (c$, "getMaximumSize", -function () { -var dim = this.maxSize; -if (dim == null || !(this.isMaximumSizeSet () || this.isValid ())) { -{ -if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { -var lm = this.layoutMgr; -this.maxSize = lm.maximumLayoutSize (this); -} else { -this.maxSize = this.getMaxSizeComp (); -}dim = this.maxSize; -}}if (dim != null) { -return new java.awt.Dimension (dim); -} else { -return dim; -}}); -Clazz_overrideMethod (c$, "getAlignmentX", -function () { -var xAlign; -if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { -{ -var lm = this.layoutMgr; -xAlign = lm.getLayoutAlignmentX (this); -}} else { -xAlign = this.getAlignmentXComp (); -}return xAlign; -}); -Clazz_overrideMethod (c$, "getAlignmentY", -function () { -var yAlign; -if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { -{ -var lm = this.layoutMgr; -yAlign = lm.getLayoutAlignmentY (this); -}} else { -yAlign = this.getAlignmentYComp (); -}return yAlign; -}); -Clazz_overrideMethod (c$, "paint", -function (g) { -java.awt.GraphicsCallback.PaintCallback.getInstance ().runComponents (this.component.toArray (java.awt.Container.EMPTY_ARRAY), g, 2); -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "update", -function (g) { -if (this.isShowing ()) { -g.clearRect (0, 0, this.width, this.height); -this.paint (g); -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintComponents", -function (g) { -if (this.isShowing ()) { -java.awt.GraphicsCallback.PaintAllCallback.getInstance ().runComponents (this.component.toArray (java.awt.Container.EMPTY_ARRAY), g, 4); -}}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "lightweightPaint", -function (g) { -this.lwPaintComp (g); -this.paintHeavyweightComponents (g); -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "paintHeavyweightComponents", -function (g) { -if (this.isShowing ()) { -java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback.getInstance ().runComponents (this.component.toArray (java.awt.Container.EMPTY_ARRAY), g, 3); -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "addContainerListener", -function (l) { -if (l == null) { -return; -}this.containerListener = java.awt.AWTEventMulticaster.add (this.containerListener, l); -this.newEventsOnly = true; -}, "java.awt.event.ContainerListener"); -Clazz_defineMethod (c$, "removeContainerListener", -function (l) { -if (l == null) { -return; -}this.containerListener = java.awt.AWTEventMulticaster.remove (this.containerListener, l); -}, "java.awt.event.ContainerListener"); -Clazz_defineMethod (c$, "getContainerListeners", -function () { -return (this.getListeners (java.awt.event.ContainerListener)); -}); -Clazz_overrideMethod (c$, "getListeners", -function (listenerType) { -var l = null; -if (listenerType === java.awt.event.ContainerListener) { -l = this.containerListener; -} else { -return this.getListenersComp (listenerType); -}return java.awt.AWTEventMulticaster.getListeners (l, listenerType); -}, "Class"); -Clazz_overrideMethod (c$, "eventEnabled", -function (e) { -var id = e.getID (); -if (id == 300 || id == 301) { -if ((this.eventMask & 2) != 0 || this.containerListener != null) { -return true; -}return false; -}return this.eventTypeEnabled (e.id); -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "processEvent", -function (e) { -this.processEventCont (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "processEventCont", -function (e) { -if (Clazz_instanceOf (e, java.awt.event.ContainerEvent)) { -this.processContainerEvent (e); -return; -}this.processEventComp (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "processContainerEvent", -function (e) { -var listener = this.containerListener; -if (listener != null) { -switch (e.getID ()) { -case 300: -listener.componentAdded (e); -break; -case 301: -listener.componentRemoved (e); -break; -} -}}, "java.awt.event.ContainerEvent"); -Clazz_overrideMethod (c$, "dispatchEventImpl", -function (e) { -if ((this.dispatcher != null) && this.dispatcher.dispatchEvent (e)) { -e.consume (); -if (this.peer != null) { -this.peer.handleEvent (e); -}return; -}this.dispatchEventImplComp (e); -{ -switch (e.getID ()) { -case 101: -break; -case 100: -break; -default: -break; -} -}}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "dispatchEventToSelf", -function (e) { -this.dispatchEventImplComp (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "getMouseEventTarget", - function (x, y, includeSelf, filter, searchHeavyweights) { -{ -if (arguments.length == 3) { -filter = java.awt.Container.MouseEventTargetFilter.FILTER; -searchHeavyWeights = false; -} -}var comp = null; -if (comp == null || comp === this) { -comp = this.getMouseEventTargetImpl (x, y, includeSelf, filter, false, searchHeavyweights); -}return comp; -}, "~N,~N,~B,java.awt.Container.EventTargetFilter,~B"); -Clazz_defineMethod (c$, "getMouseEventTargetImpl", - function (x, y, includeSelf, filter, searchHeavyweightChildren, searchHeavyweightDescendants) { -{ -for (var i = 0; i < this.component.size (); i++) { -var comp = this.component.get (i); -if (comp != null && comp.visible && ((!searchHeavyweightChildren && Clazz_instanceOf (comp.peer, java.awt.peer.LightweightPeer)) || (searchHeavyweightChildren && !(Clazz_instanceOf (comp.peer, java.awt.peer.LightweightPeer)))) && comp.contains (x - comp.x, y - comp.y)) { -if (Clazz_instanceOf (comp, java.awt.Container)) { -var child = comp; -var deeper = child.getMouseEventTarget (x - child.x, y - child.y, includeSelf, filter, searchHeavyweightDescendants); -if (deeper != null) { -return deeper; -}} else { -if (filter.accept (comp)) { -return comp; -}}}} -var isPeerOK; -var isMouseOverMe; -isPeerOK = includeSelf; -isMouseOverMe = this.contains (x, y); -if (isMouseOverMe && isPeerOK && filter.accept (this)) { -return this; -}return null; -}}, "~N,~N,~B,java.awt.Container.EventTargetFilter,~B,~B"); -Clazz_defineMethod (c$, "proxyEnableEvents", -function (events) { -if (this.parent != null) { -this.parent.proxyEnableEvents (events); -}if (this.dispatcher != null) { -this.dispatcher.enableEvents (events); -}}, "~N"); -Clazz_defineMethod (c$, "deliverEvent", -function (e) { -var comp = this.getComponentAt (e.x, e.y); -if ((comp != null) && (comp !== this)) { -e.translate (-comp.x, -comp.y); -comp.deliverEvent (e); -} else { -this.postEvent (e); -}}, "java.awt.Event"); -Clazz_defineMethod (c$, "getComponentAt", -function (x, y) { -return this.locate (x, y); -}, "~N,~N"); -Clazz_overrideMethod (c$, "locate", -function (x, y) { -return this; -}, "~N,~N"); -Clazz_defineMethod (c$, "getComponentAt", -function (p) { -return this.getComponentAt (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "getMousePosition", -function (allowChildren) { -return null; -}, "~B"); -Clazz_overrideMethod (c$, "isSameOrAncestorOf", -function (comp, allowChildren) { -return this === comp || (allowChildren && this.isParentOf (comp)); -}, "java.awt.Component,~B"); -Clazz_defineMethod (c$, "findComponentAt", -function (x, y) { -{ -return this.findComponentAt (x, y, true); -}}, "~N,~N"); -Clazz_defineMethod (c$, "findComponentAt", -function (x, y, ignoreEnabled) { -return null; -}, "~N,~N,~B"); -Clazz_defineMethod (c$, "findComponentAt", -function (p) { -return this.findComponentAt (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "addNotify", -function () { -{ -this.addNotifyComp (); -if (!(Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer))) { -this.setDispatcher (); -}for (var i = 0; i < this.component.size (); i++) { -this.component.get (i).addNotify (); -} -}}); -Clazz_defineMethod (c$, "setDispatcher", -function () { -this.dispatcher = new java.awt.LightweightDispatcher (this); -}); -Clazz_defineMethod (c$, "removeNotify", -function () { -for (var i = this.component.size () - 1; i >= 0; i--) { -var comp = this.component.get (i); -if (comp != null) { -comp.setAutoFocusTransferOnDisposal (false); -comp.removeNotify (); -comp.setAutoFocusTransferOnDisposal (true); -}} -if (this.dispatcher != null) { -this.dispatcher.dispose (); -this.dispatcher = null; -}this.removeNotifyComp (); -}); -Clazz_defineMethod (c$, "isAncestorOf", -function (c) { -var p; -if (c == null || ((p = c.getParent ()) == null)) { -return false; -}while (p != null) { -if (p === this) { -return true; -}p = p.getParent (); -} -return false; -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "paramString", -function () { -var str = this.paramStringComp (); -var layoutMgr = this.layoutMgr; -if (layoutMgr != null) { -str += ",layout=" + layoutMgr.getClass ().getName (); -}return str; -}); -Clazz_defineMethod (c$, "setFocusTraversalKeys", -function (id, keystrokes) { -}, "~N,java.util.Set"); -Clazz_defineMethod (c$, "getFocusTraversalKeys", -function (id) { -return null; -}, "~N"); -Clazz_defineMethod (c$, "areFocusTraversalKeysSet", -function (id) { -return false; -}, "~N"); -Clazz_defineMethod (c$, "isFocusCycleRoot", -function (container) { -if (this.isFocusCycleRoot () && container === this) { -return true; -} else { -return this.isFocusCycleRootComp (container); -}}, "java.awt.Container"); -Clazz_overrideMethod (c$, "containsFocus", -function () { -return false; -}); -Clazz_defineMethod (c$, "isParentOf", - function (comp) { -{ -while (comp != null && comp !== this && !(Clazz_instanceOf (comp, java.awt.Window))) { -comp = comp.getParent (); -} -return (comp === this); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "clearMostRecentFocusOwnerOnHide", -function () { -}); -Clazz_overrideMethod (c$, "clearCurrentFocusCycleRootOnHide", -function () { -}); -Clazz_defineMethod (c$, "getTraversalRoot", -function () { -return null; -}); -Clazz_defineMethod (c$, "isFocusCycleRoot", -function () { -return this.focusCycleRoot; -}); -Clazz_defineMethod (c$, "setFocusTraversalPolicyProvider", -function (provider) { -var oldProvider; -{ -oldProvider = this.focusTraversalPolicyProvider; -this.focusTraversalPolicyProvider = provider; -}this.firePropertyChangeBool ("focusTraversalPolicyProvider", oldProvider, provider); -}, "~B"); -Clazz_defineMethod (c$, "isFocusTraversalPolicyProvider", -function () { -return this.focusTraversalPolicyProvider; -}); -Clazz_defineMethod (c$, "transferFocusDownCycle", -function () { -}); -Clazz_defineMethod (c$, "preProcessKeyEvent", -function (e) { -var parent = this.parent; -if (parent != null) { -parent.preProcessKeyEvent (e); -}}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "postProcessKeyEvent", -function (e) { -var parent = this.parent; -if (parent != null) { -parent.postProcessKeyEvent (e); -}}, "java.awt.event.KeyEvent"); -Clazz_overrideMethod (c$, "postsOldMouseEvents", -function () { -return true; -}); -Clazz_defineMethod (c$, "applyComponentOrientation", -function (o) { -this.applyCompOrientComp (o); -{ -for (var i = 0; i < this.component.size (); i++) { -var comp = this.component.get (i); -comp.applyComponentOrientation (o); -} -}}, "java.awt.ComponentOrientation"); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (listener) { -this.addPropChangeListenerComp (listener); -}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (propertyName, listener) { -this.addPropChangeListComp (propertyName, listener); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "increaseComponentCount", -function (c) { -if (!c.isDisplayable ()) { -throw new IllegalStateException ("Peer does not exist while invoking the increaseComponentCount() method"); -}var addHW = 0; -var addLW = 0; -if (Clazz_instanceOf (c, java.awt.Container)) { -addLW = (c).numOfLWComponents; -addHW = (c).numOfHWComponents; -}if (c.isLightweight ()) { -addLW++; -} else { -addHW++; -}for (var cont = this; cont != null; cont = cont.getContainer ()) { -cont.numOfLWComponents += addLW; -cont.numOfHWComponents += addHW; -} -}, "java.awt.Component"); -Clazz_defineMethod (c$, "decreaseComponentCount", -function (c) { -if (!c.isDisplayable ()) { -throw new IllegalStateException ("Peer does not exist while invoking the decreaseComponentCount() method"); -}var subHW = 0; -var subLW = 0; -if (Clazz_instanceOf (c, java.awt.Container)) { -subLW = (c).numOfLWComponents; -subHW = (c).numOfHWComponents; -}if (c.isLightweight ()) { -subLW++; -} else { -subHW++; -}for (var cont = this; cont != null; cont = cont.getContainer ()) { -cont.numOfLWComponents -= subLW; -cont.numOfHWComponents -= subHW; -} -}, "java.awt.Component"); -Clazz_declareInterface (java.awt.Container, "EventTargetFilter"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.Container, "MouseEventTargetFilter", null, java.awt.Container.EventTargetFilter); -Clazz_makeConstructor (c$, - function () { -}); -Clazz_overrideMethod (c$, "accept", -function (a) { -return (a.eventMask & 32) != 0 || (a.eventMask & 16) != 0 || (a.eventMask & 131072) != 0 || a.mouseListener != null || a.mouseMotionListener != null || a.mouseWheelListener != null; -}, "java.awt.Component"); -c$.FILTER = c$.prototype.FILTER = new java.awt.Container.MouseEventTargetFilter (); -c$ = Clazz_p0p (); -c$.EMPTY_ARRAY = c$.prototype.EMPTY_ARRAY = new Array (0); -Clazz_defineStatics (c$, -"INCLUDE_SELF", true, -"SEARCH_HEAVYWEIGHTS", true); -c$ = Clazz_decorateAsClass (function () { -this.nativeContainer = null; -this.mouseEventTarget = null; -this.targetLastEntered = null; -this.isMouseInNativeContainer = false; -this.eventMask = 0; -Clazz_instantialize (this, arguments); -}, java.awt, "LightweightDispatcher", null, java.awt.event.AWTEventListener); -Clazz_makeConstructor (c$, -function (nativeContainer) { -this.nativeContainer = nativeContainer; -this.mouseEventTarget = null; -this.eventMask = 0; -}, "java.awt.Container"); -Clazz_defineMethod (c$, "dispose", -function () { -this.stopListeningForOtherDrags (); -this.mouseEventTarget = null; -}); -Clazz_defineMethod (c$, "enableEvents", -function (events) { -this.eventMask |= events; -}, "~N"); -Clazz_defineMethod (c$, "dispatchEvent", -function (e) { -var ret = false; -if (Clazz_instanceOf (e, java.awt.event.MouseEvent) && (this.eventMask & 131120) != 0) { -var me = e; -ret = this.processMouseEvent (me); -}return ret; -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "isMouseGrab", - function (e) { -var modifiers = e.getModifiersEx (); -if (e.getID () == 501 || e.getID () == 502) { -switch (e.getButton ()) { -case 1: -modifiers ^= 1024; -break; -case 2: -modifiers ^= 2048; -break; -case 3: -modifiers ^= 4096; -break; -} -}return ((modifiers & (7168)) != 0); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "processMouseEvent", - function (e) { -var id = e.getID (); -var mouseOver = this.nativeContainer.getMouseEventTarget (e.getX (), e.getY (), true); -this.trackMouseEnterExit (mouseOver, e); -if (!this.isMouseGrab (e) && id != 500) { -this.mouseEventTarget = (mouseOver !== this.nativeContainer) ? mouseOver : null; -}if (this.mouseEventTarget != null) { -switch (id) { -case 504: -case 505: -break; -case 501: -this.retargetMouseEvent (this.mouseEventTarget, id, e); -break; -case 502: -this.retargetMouseEvent (this.mouseEventTarget, id, e); -break; -case 500: -if (mouseOver === this.mouseEventTarget) { -this.retargetMouseEvent (mouseOver, id, e); -}break; -case 503: -this.retargetMouseEvent (this.mouseEventTarget, id, e); -break; -case 506: -if (this.isMouseGrab (e)) { -this.retargetMouseEvent (this.mouseEventTarget, id, e); -}break; -case 507: -this.retargetMouseEvent (mouseOver, id, e); -break; -} -e.consume (); -}return e.isConsumed (); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "trackMouseEnterExit", - function (targetOver, e) { -var targetEnter = null; -var id = e.getID (); -if (id != 505 && id != 506 && id != 1500 && this.isMouseInNativeContainer == false) { -this.isMouseInNativeContainer = true; -this.startListeningForOtherDrags (); -} else if (id == 505) { -this.isMouseInNativeContainer = false; -this.stopListeningForOtherDrags (); -}if (this.isMouseInNativeContainer) { -targetEnter = targetOver; -}if (this.targetLastEntered === targetEnter) { -return; -}if (this.targetLastEntered != null) { -this.retargetMouseEvent (this.targetLastEntered, 505, e); -}if (id == 505) { -e.consume (); -}if (targetEnter != null) { -this.retargetMouseEvent (targetEnter, 504, e); -}if (id == 504) { -e.consume (); -}this.targetLastEntered = targetEnter; -}, "java.awt.Component,java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "startListeningForOtherDrags", - function () { -}); -Clazz_defineMethod (c$, "stopListeningForOtherDrags", - function () { -}); -Clazz_overrideMethod (c$, "eventDispatched", -function (e) { -var isForeignDrag = (Clazz_instanceOf (e, java.awt.event.MouseEvent)) && (e.id == 506) && (e.getSource () !== this.nativeContainer); -if (!isForeignDrag) { -return; -}var srcEvent = e; -var me; -{ -var srcComponent = srcEvent.getComponent (); -if (!srcComponent.isShowing ()) { -return; -}var c = this.nativeContainer; -while ((c != null) && !(Clazz_instanceOf (c, java.awt.Window))) { -c = c.getParent_NoClientCode (); -} -if ((c == null) || (c).isModalBlocked ()) { -return; -}me = new java.awt.event.MouseEvent (this.nativeContainer, 1500, srcEvent.getWhen (), srcEvent.getModifiersEx () | srcEvent.getModifiers (), srcEvent.getX (), srcEvent.getY (), srcEvent.getXOnScreen (), srcEvent.getYOnScreen (), srcEvent.getClickCount (), srcEvent.isPopupTrigger (), srcEvent.getButton ()); -(srcEvent).copyPrivateDataInto (me); -}var targetOver = this.nativeContainer.getMouseEventTarget (me.getX (), me.getY (), true); -this.trackMouseEnterExit (targetOver, me); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "retargetMouseEvent", -function (target, id, e) { -if (target == null) { -return; -}var x = e.getX (); -var y = e.getY (); -var component; -for (component = target; component != null && component !== this.nativeContainer; component = component.getParent ()) { -x -= component.x; -y -= component.y; -} -var retargeted; -if (component != null) { -if (id == 507) { -retargeted = new java.awt.event.MouseWheelEvent (target, id, e.getWhen (), e.getModifiersEx () | e.getModifiers (), x, y, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), (e).getScrollType (), (e).getScrollAmount (), (e).getWheelRotation ()); -} else { -retargeted = new java.awt.event.MouseEvent (target, id, e.getWhen (), e.getModifiersEx () | e.getModifiers (), x, y, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), e.getButton ()); -}(e).copyPrivateDataInto (retargeted); -if (target === this.nativeContainer) { -(target).dispatchEventToSelf (retargeted); -} else { -if (this.nativeContainer.modalComp != null) { -if ((this.nativeContainer.modalComp).isAncestorOf (target)) { -target.dispatchEvent (retargeted); -} else { -e.consume (); -}} else { -target.dispatchEvent (retargeted); -}}}}, "java.awt.Component,~N,java.awt.event.MouseEvent"); -Clazz_defineStatics (c$, -"LWD_MOUSE_DRAGGED_OVER", 1500, -"MOUSE_MASK", 131120); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.lang.Enum", "java.awt.image.ImageObserver", "java.util.HashMap", "java.awt.ComponentOrientation"], "java.awt.Component", ["java.lang.Boolean", "$.Character", "$.Double", "$.Float", "$.IllegalArgumentException", "$.Long", "$.NullPointerException", "$.Short", "$.Thread", "java.awt.AWTEventMulticaster", "$.Cursor", "$.Dimension", "$.EventQueue", "$.IllegalComponentStateException", "$.Point", "$.Rectangle", "$.Toolkit", "java.awt.event.ComponentEvent", "$.ComponentListener", "$.FocusEvent", "$.FocusListener", "$.HierarchyBoundsListener", "$.HierarchyEvent", "$.HierarchyListener", "$.InputEvent", "$.InputMethodEvent", "$.InputMethodListener", "$.KeyEvent", "$.KeyListener", "$.MouseEvent", "$.MouseListener", "$.MouseMotionListener", "$.MouseWheelEvent", "$.MouseWheelListener", "$.PaintEvent", "java.awt.peer.LightweightPeer", "java.beans.PropertyChangeListener", "$.PropertyChangeSupport", "jssun.awt.AppContext", "$.SunToolkit", "jssun.font.FontDesignMetrics", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.threadGroup = null; -this.myThread = null; -this.peer = null; -this.parent = null; -this.appContext = null; -this.x = 0; -this.y = 0; -this.width = 0; -this.height = 0; -this.foreground = null; -this.background = null; -this.font = null; -this.peerFont = null; -this.cursor = null; -this.locale = null; -this.visible = true; -this.enabled = true; -this.valid = false; -this.popups = null; -this.name = null; -this.nameExplicitlySet = false; -this.focusable = true; -this.$isFocusTraversableOverridden = 0; -this.focusTraversalKeysEnabled = false; -this.minSize = null; -this.minSizeSet = false; -this.prefSize = null; -this.prefSizeSet = false; -this.maxSize = null; -this.maxSizeSet = false; -this.componentOrientation = null; -this.newEventsOnly = false; -this.componentListener = null; -this.focusListener = null; -this.hierarchyListener = null; -this.hierarchyBoundsListener = null; -this.keyListener = null; -this.mouseListener = null; -this.mouseMotionListener = null; -this.mouseWheelListener = null; -this.inputMethodListener = null; -this.windowClosingException = null; -this.eventMask = 4096; -this.changeSupport = null; -this.changeSupportLock = null; -this.isPacked = false; -this.boundsOp = 3; -this.isAddNotifyComplete = false; -this.backgroundEraseDisabled = false; -this.htmlName = null; -this.num = 0; -this.graphicsConfig = null; -this.eventCache = null; -this.coalescingEnabled = false; -this.autoFocusTransferOnDisposal = true; -Clazz_instantialize (this, arguments); -}, java.awt, "Component", null, java.awt.image.ImageObserver); -Clazz_prepareFields (c$, function () { -this.componentOrientation = java.awt.ComponentOrientation.UNKNOWN; -this.changeSupportLock = new Clazz._O (); -this.coalescingEnabled = this.checkCoalescing (); -}); -Clazz_defineMethod (c$, "getAppContext", -function () { -return this.appContext; -}); -Clazz_defineMethod (c$, "getChangeSupportLock", - function () { -return this.changeSupportLock; -}); -Clazz_defineMethod (c$, "getBoundsOp", -function () { -return this.boundsOp; -}); -Clazz_defineMethod (c$, "setBoundsOp", -function (op) { -if (op == 5) { -this.boundsOp = 3; -} else if (this.boundsOp == 3) { -this.boundsOp = op; -}}, "~N"); -Clazz_makeConstructor (c$, -function () { -this.setAppContext (); -}); -Clazz_defineMethod (c$, "setAppContext", -function () { -this.appContext = jssun.awt.AppContext.getAppContext (); -this.num = ++java.awt.Component.incr; -}); -Clazz_defineMethod (c$, "getHTMLName", -function (uid) { -return (this.htmlName == null ? this.htmlName = this.appContext.getThreadGroup ().getName () + "_" + uid + "_" + this.num : this.htmlName); -}, "~S"); -Clazz_defineMethod (c$, "constructComponentName", -function () { -return null; -}); -Clazz_defineMethod (c$, "getName", -function () { -if (this.name == null && !this.nameExplicitlySet) { -{ -if (this.name == null && !this.nameExplicitlySet) this.name = this.constructComponentName (); -}}return this.name; -}); -Clazz_defineMethod (c$, "setName", -function (name) { -var oldName; -{ -oldName = this.name; -this.name = name; -this.nameExplicitlySet = true; -}this.firePropertyChangeObject ("name", oldName, name); -}, "~S"); -Clazz_defineMethod (c$, "getParent", -function () { -return this.getParent_NoClientCode (); -}); -Clazz_defineMethod (c$, "getParent_NoClientCode", -function () { -return this.parent; -}); -Clazz_defineMethod (c$, "getContainer", -function () { -return this.getParent (); -}); -Clazz_defineMethod (c$, "getPeer", -function () { -return this.peer; -}); -Clazz_defineMethod (c$, "getGraphicsConfiguration", -function () { -return swingjs.JSToolkit.getGraphicsConfiguration (); -}); -Clazz_defineMethod (c$, "resetGC", -function () { -}); -Clazz_defineMethod (c$, "getToolkit", -function () { -return this.getToolkitImpl (); -}); -Clazz_defineMethod (c$, "getToolkitImpl", -function () { -var peer = this.peer; -if ((peer != null) && !(Clazz_instanceOf (peer, java.awt.peer.LightweightPeer))) { -return peer.getToolkit (); -}var parent = this.parent; -if (parent != null) { -return parent.getToolkitImpl (); -}return java.awt.Toolkit.getDefaultToolkit (); -}); -Clazz_defineMethod (c$, "isValid", -function () { -return this.valid; -}); -Clazz_defineMethod (c$, "isDisplayable", -function () { -return true; -}); -Clazz_defineMethod (c$, "isVisible", -function () { -return this.isVisible_NoClientCode (); -}); -Clazz_defineMethod (c$, "isVisible_NoClientCode", -function () { -return this.visible; -}); -Clazz_defineMethod (c$, "isRecursivelyVisible", -function () { -return this.visible && (this.parent == null || this.parent.isRecursivelyVisible ()); -}); -Clazz_defineMethod (c$, "pointRelativeToComponent", -function (absolute) { -var compCoords = this.getLocationOnScreen (); -return new java.awt.Point (absolute.x - compCoords.x, absolute.y - compCoords.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "getMousePosition", -function () { -return null; -}); -Clazz_defineMethod (c$, "isSameOrAncestorOf", -function (comp, allowChildren) { -return comp === this; -}, "java.awt.Component,~B"); -Clazz_defineMethod (c$, "isShowing", -function () { -if (this.visible) { -var parent = this.parent; -return (parent == null) || parent.isShowing (); -}return false; -}); -Clazz_defineMethod (c$, "isEnabled", -function () { -return this.isEnabledImpl (); -}); -Clazz_defineMethod (c$, "isEnabledImpl", -function () { -return this.enabled; -}); -Clazz_defineMethod (c$, "setEnabled", -function (b) { -this.enable (b); -}, "~B"); -Clazz_defineMethod (c$, "enable", -function () { -if (!this.enabled) { -this.enabled = true; -var peer = this.peer; -if (peer != null) { -peer.setEnabled (true); -if (this.visible) { -this.updateCursorImmediately (); -}}}}); -Clazz_defineMethod (c$, "enable", -function (b) { -if (b) { -this.enable (); -} else { -this.disable (); -}}, "~B"); -Clazz_defineMethod (c$, "disable", -function () { -if (this.enabled) { -this.enabled = false; -var peer = this.peer; -if (peer != null) { -peer.setEnabled (false); -if (this.visible) { -this.updateCursorImmediately (); -}}}}); -Clazz_defineMethod (c$, "isDoubleBuffered", -function () { -return false; -}); -Clazz_defineMethod (c$, "setVisible", -function (b) { -this.show (b); -}, "~B"); -Clazz_defineMethod (c$, "show", -function () { -if (!this.visible) { -this.visible = true; -var peer = this.peer; -if (peer != null) { -peer.setVisible (true); -this.createHierarchyEvents (1400, this, this.parent, 4, java.awt.Toolkit.enabledOnToolkit (32768)); -if (Clazz_instanceOf (peer, java.awt.peer.LightweightPeer)) { -this.repaint (); -}this.updateCursorImmediately (); -}if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) { -var e = new java.awt.event.ComponentEvent (this, 102); -java.awt.Toolkit.getEventQueue ().postEvent (e); -}}var parent = this.parent; -if (parent != null) { -parent.invalidate (); -}}); -Clazz_defineMethod (c$, "containsFocus", -function () { -return this.isFocusOwner (); -}); -Clazz_defineMethod (c$, "clearCurrentFocusCycleRootOnHide", -function () { -}); -Clazz_defineMethod (c$, "hide", -function () { -this.isPacked = false; -if (this.visible) { -this.clearCurrentFocusCycleRootOnHide (); -this.visible = false; -this.mixOnHiding (this.isLightweight ()); -var peer = this.peer; -if (peer != null) { -peer.setVisible (false); -this.createHierarchyEvents (1400, this, this.parent, 4, java.awt.Toolkit.enabledOnToolkit (32768)); -if (Clazz_instanceOf (peer, java.awt.peer.LightweightPeer)) { -this.repaint (); -}this.updateCursorImmediately (); -}if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) { -var e = new java.awt.event.ComponentEvent (this, 103); -java.awt.Toolkit.getEventQueue ().postEvent (e); -}}var parent = this.parent; -if (parent != null) { -parent.invalidate (); -}}); -Clazz_defineMethod (c$, "getForeground", -function () { -var foreground = this.foreground; -if (foreground != null) { -return foreground; -}var parent = this.parent; -return (parent != null) ? parent.getForeground () : null; -}); -Clazz_defineMethod (c$, "setForeground", -function (c) { -var oldColor = this.foreground; -var peer = this.peer; -this.foreground = c; -if (peer != null) { -c = this.getForeground (); -if (c != null) { -peer.setForeground (c); -}}this.firePropertyChangeObject ("foreground", oldColor, c); -}, "java.awt.Color"); -Clazz_defineMethod (c$, "isForegroundSet", -function () { -return (this.foreground != null); -}); -Clazz_defineMethod (c$, "getBackground", -function () { -var background = this.background; -if (background != null) { -return background; -}var parent = this.parent; -return (parent != null) ? parent.getBackground () : null; -}); -Clazz_defineMethod (c$, "setBackground", -function (c) { -var oldColor = this.background; -var peer = this.peer; -this.background = c; -if (peer != null) { -c = this.getBackground (); -if (c != null) { -peer.setBackground (c); -}}this.firePropertyChangeObject ("background", oldColor, c); -}, "java.awt.Color"); -Clazz_defineMethod (c$, "isBackgroundSet", -function () { -return (this.background != null); -}); -Clazz_defineMethod (c$, "getFont", -function () { -return this.getFont_NoClientCode (); -}); -Clazz_defineMethod (c$, "getFont_NoClientCode", -function () { -var font = this.font; -if (font != null) { -return font; -}var parent = this.parent; -return (parent != null) ? parent.getFont_NoClientCode () : null; -}); -Clazz_defineMethod (c$, "setFont", -function (f) { -this.setFontComp (f); -}, "java.awt.Font"); -Clazz_defineMethod (c$, "setFontComp", -function (f) { -var oldFont; -var newFont; -oldFont = this.font; -newFont = this.font = f; -{ -{ -}var peer = this.peer; -if (peer != null) { -f = this.getFont (); -if (f != null) { -peer.setFont (f); -this.peerFont = f; -}}}this.firePropertyChangeObject ("font", oldFont, newFont); -if (f !== oldFont && (oldFont == null || !oldFont.equals (f))) { -this.invalidateIfValid (); -}}, "java.awt.Font"); -Clazz_defineMethod (c$, "isFontSet", -function () { -return (this.font != null); -}); -Clazz_defineMethod (c$, "getLocale", -function () { -var locale = this.locale; -if (locale != null) { -return locale; -}var parent = this.parent; -if (parent == null) { -throw new java.awt.IllegalComponentStateException ("This component must have a parent in order to determine its locale"); -} else { -return parent.getLocale (); -}}); -Clazz_defineMethod (c$, "setLocale", -function (l) { -var oldValue = this.locale; -this.locale = l; -this.firePropertyChangeObject ("locale", oldValue, l); -this.invalidateIfValid (); -}, "java.util.Locale"); -Clazz_defineMethod (c$, "getLocation", -function () { -return this.location (); -}); -Clazz_defineMethod (c$, "getLocationOnScreen", -function () { -return this.getLocationOnScreen_NoTreeLock (); -}); -Clazz_defineMethod (c$, "getLocationOnScreen_NoTreeLock", -function () { -if (this.isShowing ()) { -if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { -var host = this.getNativeContainer (); -var pt = host.peer.getLocationOnScreen (); -for (var c = this; c !== host; c = c.getParent ()) { -pt.x += c.x; -pt.y += c.y; -} -return pt; -} else { -var pt = this.peer.getLocationOnScreen (); -return pt; -}} else { -throw new java.awt.IllegalComponentStateException ("component must be showing on the screen to determine its location"); -}}); -Clazz_defineMethod (c$, "location", -function () { -return this.location_NoClientCode (); -}); -Clazz_defineMethod (c$, "location_NoClientCode", - function () { -return new java.awt.Point (this.x, this.y); -}); -Clazz_defineMethod (c$, "setLocation", -function (x, y) { -this.setBoundsOp (1); -this.setBounds (x, y, this.width, this.height); -}, "~N,~N"); -Clazz_defineMethod (c$, "setLocation", -function (p) { -this.setLocation (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "getSize", -function () { -return this.size (); -}); -Clazz_defineMethod (c$, "size", -function () { -return new java.awt.Dimension (this.width, this.height); -}); -Clazz_defineMethod (c$, "setSize", -function (width, height) { -{ -if (arguments.length == 1) { -var d = arguments[0]; -width = d.width; -height = d.height; -} -}this.resize (width, height); -}, "~N,~N"); -Clazz_defineMethod (c$, "resize", -function (width, height) { -this.setBoundsOp (2); -this.setBounds (this.x, this.y, width, height); -}, "~N,~N"); -Clazz_defineMethod (c$, "setBounds", -function (x, y, width, height) { -this.reshape (x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setBounds", -function (r) { -this.setBounds (r.x, r.y, r.width, r.height); -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "reshape", -function (x, y, width, height) { -try { -this.setBoundsOp (3); -var resized = (this.width != width) || (this.height != height); -var moved = (this.x != x) || (this.y != y); -if (!resized && !moved) { -return; -}var oldX = this.x; -var oldY = this.y; -var oldWidth = this.width; -var oldHeight = this.height; -this.x = x; -this.y = y; -this.width = width; -this.height = height; -if (resized) { -this.isPacked = false; -System.out.println ("C " + swingjs.JSToolkit.getClassName (this) + " resized to " + this.getBounds ()); -}var needNotify = true; -this.mixOnReshaping (); -if (this.peer != null) { -this.reshapeNativePeer (x, y, width, height, this.getBoundsOp ()); -resized = (oldWidth != this.width) || (oldHeight != this.height); -moved = (oldX != this.x) || (oldY != this.y); -if (Clazz_instanceOf (this, java.awt.Window)) { -needNotify = false; -}if (resized) { -this.invalidate (); -}if (this.parent != null) { -this.parent.invalidateIfValid (); -}}if (needNotify) { -this.notifyNewBounds (resized, moved); -}this.repaintParentIfNeeded (oldX, oldY, oldWidth, oldHeight); -} finally { -this.setBoundsOp (5); -} -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "repaintParentIfNeeded", - function (oldX, oldY, oldWidth, oldHeight) { -if (this.parent != null && Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer) && this.isShowing ()) { -this.parent.repaint (oldX, oldY, oldWidth, oldHeight); -this.repaint (); -}}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "reshapeNativePeer", - function (x, y, width, height, op) { -var nativeX = x; -var nativeY = y; -for (var c = this.parent; (c != null) && (Clazz_instanceOf (c.peer, java.awt.peer.LightweightPeer)); c = c.parent) { -nativeX += c.x; -nativeY += c.y; -} -this.peer.setBounds (nativeX, nativeY, width, height, op); -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "notifyNewBounds", - function (resized, moved) { -if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) { -if (resized) { -var e = new java.awt.event.ComponentEvent (this, 101); -java.awt.Toolkit.getEventQueue ().postEvent (e); -}if (moved) { -var e = new java.awt.event.ComponentEvent (this, 100); -java.awt.Toolkit.getEventQueue ().postEvent (e); -}} else { -if (Clazz_instanceOf (this, java.awt.Container) && (this).countComponents () > 0) { -var enabledOnToolkit = java.awt.Toolkit.enabledOnToolkit (65536); -if (resized) { -(this).createChildHierarchyEvents (1402, 0, enabledOnToolkit); -}if (moved) { -(this).createChildHierarchyEvents (1401, 0, enabledOnToolkit); -}}}}, "~B,~B"); -Clazz_defineMethod (c$, "getX", -function () { -return this.x; -}); -Clazz_defineMethod (c$, "getY", -function () { -return this.y; -}); -Clazz_defineMethod (c$, "getWidth", -function () { -return this.width; -}); -Clazz_defineMethod (c$, "getHeight", -function () { -return this.height; -}); -Clazz_defineMethod (c$, "getBounds", -function (rv) { -if (rv == null) return new java.awt.Rectangle (this.getX (), this.getY (), this.getWidth (), this.getHeight ()); -rv.reshape (this.getX (), this.getY (), this.getWidth (), this.getHeight ()); -return rv; -}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "getSize", -function (rv) { -if (rv == null) { -return new java.awt.Dimension (this.getWidth (), this.getHeight ()); -} else { -rv.setSize (this.getWidth (), this.getHeight ()); -return rv; -}}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "getLocation", -function (rv) { -if (rv == null) { -return new java.awt.Point (this.getX (), this.getY ()); -} else { -rv.setLocation (this.getX (), this.getY ()); -return rv; -}}, "java.awt.Point"); -Clazz_defineMethod (c$, "isOpaque", -function () { -return true; -}); -Clazz_defineMethod (c$, "isLightweight", -function () { -return false; -}); -Clazz_defineMethod (c$, "setPreferredSize", -function (preferredSize) { -this.setPrefSizeComp (preferredSize); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "setPrefSizeComp", -function (preferredSize) { -var old = (this.prefSizeSet ? this.prefSize : null); -this.prefSize = preferredSize; -this.prefSizeSet = (preferredSize != null); -this.firePropertyChangeObject ("preferredSize", old, preferredSize); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "isPreferredSizeSet", -function () { -return this.prefSizeSet; -}); -Clazz_defineMethod (c$, "getPreferredSize", -function () { -return this.preferredSize (); -}); -Clazz_defineMethod (c$, "preferredSize", -function () { -return this.prefSizeComp (); -}); -Clazz_defineMethod (c$, "prefSizeComp", -function () { -var dim = this.prefSize; -if (dim == null || !(this.isPreferredSizeSet () || this.isValid ())) { -this.prefSize = this.getMinimumSize (); -dim = this.prefSize; -}return new java.awt.Dimension (dim); -}); -Clazz_defineMethod (c$, "setMinimumSize", -function (minimumSize) { -var old; -if (this.minSizeSet) { -old = this.minSize; -} else { -old = null; -}this.minSize = minimumSize; -this.minSizeSet = (minimumSize != null); -this.firePropertyChangeObject ("minimumSize", old, minimumSize); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "isMinimumSizeSet", -function () { -return this.minSizeSet; -}); -Clazz_defineMethod (c$, "getMinimumSize", -function () { -return this.minimumSize (); -}); -Clazz_defineMethod (c$, "minimumSize", -function () { -var dim = this.minSize; -if (dim == null || !(this.isMinimumSizeSet () || this.isValid ())) { -this.minSize = this.getSize (); -dim = this.minSize; -}return new java.awt.Dimension (dim); -}); -Clazz_defineMethod (c$, "setMaximumSize", -function (maximumSize) { -var old; -if (this.maxSizeSet) { -old = this.maxSize; -} else { -old = null; -}this.maxSize = maximumSize; -this.maxSizeSet = (maximumSize != null); -this.firePropertyChangeObject ("maximumSize", old, maximumSize); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "isMaximumSizeSet", -function () { -return this.maxSizeSet; -}); -Clazz_defineMethod (c$, "getMaximumSize", -function () { -return this.getMaxSizeComp (); -}); -Clazz_defineMethod (c$, "getMaxSizeComp", -function () { -if (this.isMaximumSizeSet ()) { -return new java.awt.Dimension (this.maxSize); -}return new java.awt.Dimension (32767, 32767); -}); -Clazz_defineMethod (c$, "getAlignmentX", -function () { -return this.getAlignmentXComp (); -}); -Clazz_defineMethod (c$, "getAlignmentXComp", -function () { -return 0.5; -}); -Clazz_defineMethod (c$, "getAlignmentY", -function () { -return this.getAlignmentYComp (); -}); -Clazz_defineMethod (c$, "getAlignmentYComp", -function () { -return 0.5; -}); -Clazz_defineMethod (c$, "getBaseline", -function (width, height) { -if (width < 0 || height < 0) { -throw new IllegalArgumentException ("Width and height must be >= 0"); -}return -1; -}, "~N,~N"); -Clazz_defineMethod (c$, "getBaselineResizeBehavior", -function () { -return java.awt.Component.BaselineResizeBehavior.OTHER; -}); -Clazz_defineMethod (c$, "doLayout", -function () { -this.layout (); -}); -Clazz_defineMethod (c$, "layout", -function () { -}); -Clazz_defineMethod (c$, "validate", -function () { -this.validateComponent (); -}); -Clazz_defineMethod (c$, "validateComponent", -function () { -{ -var peer = this.peer; -var wasValid = this.isValid (); -if (!wasValid && peer != null) { -var newfont = this.getFont (); -var oldfont = this.peerFont; -if (newfont !== oldfont && (oldfont == null || !oldfont.equals (newfont))) { -peer.setFont (newfont); -this.peerFont = newfont; -}peer.layout (); -}this.valid = true; -if (!wasValid) { -this.mixOnValidating (); -}}}); -Clazz_defineMethod (c$, "invalidate", -function () { -this.invalidateComp (); -}); -Clazz_defineMethod (c$, "invalidateComp", -function () { -this.valid = false; -if (!this.isPreferredSizeSet ()) { -this.prefSize = null; -}if (!this.isMinimumSizeSet ()) { -this.minSize = null; -}if (!this.isMaximumSizeSet ()) { -this.maxSize = null; -}if (this.parent != null) { -this.parent.invalidateIfValid (); -}}); -Clazz_defineMethod (c$, "invalidateIfValid", -function () { -if (this.isValid ()) { -this.invalidate (); -}}); -Clazz_defineMethod (c$, "getGraphics", -function () { -if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { -if (this.parent == null) return null; -var g = this.parent.getGraphics (); -if (g == null) return null; -g.setFont (this.getFont ()); -return g; -} else { -var peer = this.peer; -return (peer != null) ? peer.getGraphics () : null; -}}); -Clazz_defineMethod (c$, "getTreeLock", -function () { -return this; -}); -Clazz_defineMethod (c$, "getFontMetrics", -function (font) { -return jssun.font.FontDesignMetrics.getMetrics (font); -}, "java.awt.Font"); -Clazz_defineMethod (c$, "setCursor", -function (cursor) { -this.cursor = cursor; -this.updateCursorImmediately (); -}, "java.awt.Cursor"); -Clazz_defineMethod (c$, "updateCursorImmediately", -function () { -}); -Clazz_defineMethod (c$, "getCursor", -function () { -return this.getCursor_NoClientCode (); -}); -Clazz_defineMethod (c$, "getCursor_NoClientCode", -function () { -var cursor = this.cursor; -if (cursor != null) { -return cursor; -}var parent = this.parent; -if (parent != null) { -return parent.getCursor_NoClientCode (); -} else { -return java.awt.Cursor.getPredefinedCursor (0); -}}); -Clazz_defineMethod (c$, "isCursorSet", -function () { -return (this.cursor != null); -}); -Clazz_defineMethod (c$, "paint", -function (g) { -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintAll", -function (g) { -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "lightweightPaint", -function (g) { -this.lwPaintComp (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "lwPaintComp", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintHeavyweightComponents", -function (g) { -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "repaint", -function () { -this.repaintImpl (0, 0, 0, this.width, this.height); -}); -Clazz_defineMethod (c$, "repaint", -function (tm) { -this.repaintImpl (tm, 0, 0, this.width, this.height); -}, "~N"); -Clazz_defineMethod (c$, "repaint", -function (x, y, width, height) { -this.repaintImpl (0, x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "repaint", -function (tm, x, y, width, height) { -this.repaintImpl (tm, x, y, width, height); -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "repaintImpl", -function (tm, x, y, width, height) { -if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { -if (this.parent != null) { -var px = this.x + ((x < 0) ? 0 : x); -var py = this.y + ((y < 0) ? 0 : y); -var pwidth = (width > this.width) ? this.width : width; -var pheight = (height > this.height) ? this.height : height; -this.parent.repaint (tm, px, py, pwidth, pheight); -}} else { -if (this.isVisible () && (this.peer != null) && (width > 0) && (height > 0)) { -var e = new java.awt.event.PaintEvent (this, 801, new java.awt.Rectangle (x, y, width, height)); -java.awt.Toolkit.getEventQueue ().postEvent (e); -}}}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "print", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "printAll", -function (g) { -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "printHeavyweightComponents", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "imageUpdate", -function (img, infoflags, x, y, w, h) { -return false; -}, "java.awt.Image,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "createImage", -function (producer) { -return this.getToolkit ().createImage (producer); -}, "java.awt.image.ImageProducer"); -Clazz_defineMethod (c$, "createImage", -function (width, height) { -return java.awt.Toolkit.getDefaultToolkit ().createImage (null, width, height); -}, "~N,~N"); -Clazz_defineMethod (c$, "createVolatileImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_defineMethod (c$, "createVolatileImage", -function (width, height, caps) { -return this.createVolatileImage (width, height); -}, "~N,~N,java.awt.ImageCapabilities"); -Clazz_defineMethod (c$, "prepareImage", -function (image, observer) { -return this.prepareImage (image, -1, -1, observer); -}, "java.awt.Image,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "prepareImage", -function (image, width, height, observer) { -return false; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "checkImage", -function (image, observer) { -return this.checkImage (image, -1, -1, observer); -}, "java.awt.Image,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "checkImage", -function (image, width, height, observer) { -return 0; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "setIgnoreRepaint", -function (ignoreRepaint) { -}, "~B"); -Clazz_defineMethod (c$, "getIgnoreRepaint", -function () { -return false; -}); -Clazz_defineMethod (c$, "contains", -function (x, y) { -return this.inside (x, y); -}, "~N,~N"); -Clazz_defineMethod (c$, "inside", -function (x, y) { -return (x >= 0) && (x < this.width) && (y >= 0) && (y < this.height); -}, "~N,~N"); -Clazz_defineMethod (c$, "getComponentAt", -function (x, y) { -return this.locate (x, y); -}, "~N,~N"); -Clazz_defineMethod (c$, "locate", -function (x, y) { -return this.contains (x, y) ? this : null; -}, "~N,~N"); -Clazz_defineMethod (c$, "getComponentAt", -function (p) { -return this.getComponentAt (p.x, p.y); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "deliverEvent", -function (e) { -this.postEvent (e); -}, "java.awt.Event"); -Clazz_defineMethod (c$, "dispatchEvent", -function (e) { -this.dispatchEventImpl (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "dispatchEventImpl", -function (e) { -this.dispatchEventImplComp (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "dispatchEventImplComp", -function (e) { -var id = e.getID (); -java.awt.EventQueue.setCurrentEventAndMostRecentTime (e); -if (!e.focusManagerIsDispatching) { -if (e.isPosted) { -e.isPosted = true; -}}if (!e.isConsumed ()) { -if (Clazz_instanceOf (e, java.awt.event.KeyEvent)) { -if (e.isConsumed ()) { -return; -}}}if (this.areInputMethodsEnabled ()) { -if ((Clazz_instanceOf (e, java.awt.event.InputEvent)) || (Clazz_instanceOf (e, java.awt.event.FocusEvent))) { -}} else { -if (id == 1004) { -}}switch (id) { -case 401: -case 402: -var p = ((Clazz_instanceOf (this, java.awt.Container)) ? this : this.parent); -if (p != null) { -p.preProcessKeyEvent (e); -}break; -case 201: -break; -default: -break; -} -if (this.newEventsOnly) { -if (this.eventEnabled (e)) { -this.processEvent (e); -}} else if (id == 507) { -this.autoProcessMouseWheel (e); -} else if (!(Clazz_instanceOf (e, java.awt.event.MouseEvent) && !this.postsOldMouseEvents ())) { -}if (id == 201 && !e.isConsumed ()) { -}if (!(Clazz_instanceOf (e, java.awt.event.KeyEvent))) { -}}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "autoProcessMouseWheel", -function (e) { -}, "java.awt.event.MouseWheelEvent"); -Clazz_defineMethod (c$, "dispatchMouseWheelToAncestor", -function (e) { -var newX; -var newY; -newX = e.getX () + this.getX (); -newY = e.getY () + this.getY (); -var newMWE; -{ -var anc = this.getParent (); -while (anc != null && !anc.eventEnabled (e)) { -newX += anc.getX (); -newY += anc.getY (); -if (!(Clazz_instanceOf (anc, java.awt.Window))) { -anc = anc.getParent (); -} else { -break; -}} -if (anc != null && anc.eventEnabled (e)) { -newMWE = new java.awt.event.MouseWheelEvent (anc, e.getID (), e.getWhen (), e.getModifiers (), newX, newY, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), e.getScrollType (), e.getScrollAmount (), e.getWheelRotation ()); -(e).copyPrivateDataInto (newMWE); -anc.dispatchEventToSelf (newMWE); -}}return true; -}, "java.awt.event.MouseWheelEvent"); -Clazz_defineMethod (c$, "checkWindowClosingException", -function () { -if (this.windowClosingException != null) { -if (Clazz_instanceOf (this, java.awt.Dialog)) { -(this).interruptBlocking (); -} else { -this.windowClosingException.fillInStackTrace (); -this.windowClosingException.printStackTrace (); -this.windowClosingException = null; -}return true; -}return false; -}); -Clazz_defineMethod (c$, "areInputMethodsEnabled", -function () { -return ((this.eventMask & 4096) != 0) && ((this.eventMask & 8) != 0 || this.keyListener != null); -}); -Clazz_defineMethod (c$, "eventEnabled", -function (e) { -return this.eventTypeEnabled (e.id); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "eventTypeEnabled", -function (type) { -switch (type) { -case 100: -case 101: -case 102: -case 103: -if ((this.eventMask & 1) != 0 || this.componentListener != null) { -return true; -}break; -case 1004: -case 1005: -if ((this.eventMask & 4) != 0 || this.focusListener != null) { -return true; -}break; -case 401: -case 402: -case 400: -if ((this.eventMask & 8) != 0 || this.keyListener != null) { -return true; -}break; -case 501: -case 502: -case 504: -case 505: -case 500: -if ((this.eventMask & 16) != 0 || this.mouseListener != null) { -return true; -}break; -case 503: -case 506: -if ((this.eventMask & 32) != 0 || this.mouseMotionListener != null) { -return true; -}break; -case 507: -if ((this.eventMask & 131072) != 0 || this.mouseWheelListener != null) { -return true; -}break; -case 1100: -case 1101: -if ((this.eventMask & 2048) != 0 || this.inputMethodListener != null) { -return true; -}break; -case 1400: -if ((this.eventMask & 32768) != 0 || this.hierarchyListener != null) { -return true; -}break; -case 1401: -case 1402: -if ((this.eventMask & 65536) != 0 || this.hierarchyBoundsListener != null) { -return true; -}break; -case 1001: -if ((this.eventMask & 128) != 0) { -return true; -}break; -case 900: -if ((this.eventMask & 1024) != 0) { -return true; -}break; -case 701: -if ((this.eventMask & 512) != 0) { -return true; -}break; -case 601: -if ((this.eventMask & 256) != 0) { -return true; -}break; -default: -break; -} -if (type > 1999) { -return true; -}return false; -}, "~N"); -Clazz_defineMethod (c$, "postEvent", -function (e) { -if (this.handleEvent (e)) { -e.consume (); -return true; -}var parent = this.parent; -var eventx = e.x; -var eventy = e.y; -if (parent != null) { -e.translate (this.x, this.y); -if (parent.postEvent (e)) { -e.consume (); -return true; -}e.x = eventx; -e.y = eventy; -}return false; -}, "java.awt.Event"); -Clazz_defineMethod (c$, "addComponentListener", -function (l) { -if (l == null) { -return; -}this.componentListener = java.awt.AWTEventMulticaster.add (this.componentListener, l); -this.newEventsOnly = true; -}, "java.awt.event.ComponentListener"); -Clazz_defineMethod (c$, "removeComponentListener", -function (l) { -if (l == null) { -return; -}this.componentListener = java.awt.AWTEventMulticaster.remove (this.componentListener, l); -}, "java.awt.event.ComponentListener"); -Clazz_defineMethod (c$, "getComponentListeners", -function () { -return (this.getListeners (java.awt.event.ComponentListener)); -}); -Clazz_defineMethod (c$, "addFocusListener", -function (l) { -if (l == null) { -return; -}this.focusListener = java.awt.AWTEventMulticaster.add (this.focusListener, l); -this.newEventsOnly = true; -}, "java.awt.event.FocusListener"); -Clazz_defineMethod (c$, "removeFocusListener", -function (l) { -if (l == null) { -return; -}this.focusListener = java.awt.AWTEventMulticaster.remove (this.focusListener, l); -}, "java.awt.event.FocusListener"); -Clazz_defineMethod (c$, "getFocusListeners", -function () { -return (this.getListeners (java.awt.event.FocusListener)); -}); -Clazz_defineMethod (c$, "addHierarchyListener", -function (l) { -}, "java.awt.event.HierarchyListener"); -Clazz_defineMethod (c$, "removeHierarchyListener", -function (l) { -}, "java.awt.event.HierarchyListener"); -Clazz_defineMethod (c$, "getHierarchyListeners", -function () { -return (this.getListeners (java.awt.event.HierarchyListener)); -}); -Clazz_defineMethod (c$, "addHierarchyBoundsListener", -function (l) { -if (l == null) { -return; -}var notifyAncestors; -{ -notifyAncestors = (this.hierarchyBoundsListener == null && (this.eventMask & 65536) == 0); -this.hierarchyBoundsListener = java.awt.AWTEventMulticaster.add (this.hierarchyBoundsListener, l); -notifyAncestors = (notifyAncestors && this.hierarchyBoundsListener != null); -this.newEventsOnly = true; -}if (notifyAncestors) { -{ -this.adjustListeningChildrenOnParent (65536, 1); -}}}, "java.awt.event.HierarchyBoundsListener"); -Clazz_defineMethod (c$, "removeHierarchyBoundsListener", -function (l) { -if (l == null) { -return; -}var notifyAncestors; -{ -notifyAncestors = (this.hierarchyBoundsListener != null && (this.eventMask & 65536) == 0); -this.hierarchyBoundsListener = java.awt.AWTEventMulticaster.remove (this.hierarchyBoundsListener, l); -notifyAncestors = (notifyAncestors && this.hierarchyBoundsListener == null); -}if (notifyAncestors) { -{ -this.adjustListeningChildrenOnParent (65536, -1); -}}}, "java.awt.event.HierarchyBoundsListener"); -Clazz_defineMethod (c$, "numListening", -function (mask) { -return this.numListeningMask (mask); -}, "~N"); -Clazz_defineMethod (c$, "numListeningMask", -function (mask) { -if ((mask == 32768 && (this.hierarchyListener != null || (this.eventMask & 32768) != 0)) || (mask == 65536 && (this.hierarchyBoundsListener != null || (this.eventMask & 65536) != 0))) { -return 1; -} else { -return 0; -}}, "~N"); -Clazz_defineMethod (c$, "countHierarchyMembers", -function () { -return 1; -}); -Clazz_defineMethod (c$, "createHierarchyEvents", -function (id, changed, changedParent, changeFlags, enabledOnToolkit) { -return this.createHierEventsComp (id, changed, changedParent, changeFlags, enabledOnToolkit); -}, "~N,java.awt.Component,java.awt.Container,~N,~B"); -Clazz_defineMethod (c$, "createHierEventsComp", -function (id, changed, changedParent, changeFlags, enabledOnToolkit) { -switch (id) { -case 1400: -if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || enabledOnToolkit) { -var e = new java.awt.event.HierarchyEvent (this, id, changed, changedParent, changeFlags); -this.dispatchEvent (e); -return 1; -}break; -case 1401: -case 1402: -if (this.hierarchyBoundsListener != null || (this.eventMask & 65536) != 0 || enabledOnToolkit) { -var e = new java.awt.event.HierarchyEvent (this, id, changed, changedParent); -this.dispatchEvent (e); -return 1; -}break; -default: -break; -} -return 0; -}, "~N,java.awt.Component,java.awt.Container,~N,~B"); -Clazz_defineMethod (c$, "getHierarchyBoundsListeners", -function () { -return (this.getListeners (java.awt.event.HierarchyBoundsListener)); -}); -Clazz_defineMethod (c$, "adjustListeningChildrenOnParent", -function (mask, num) { -if (this.parent != null) { -this.parent.adjustListeningChildren (mask, num); -}}, "~N,~N"); -Clazz_defineMethod (c$, "addKeyListener", -function (l) { -if (l == null) { -return; -}this.keyListener = java.awt.AWTEventMulticaster.add (this.keyListener, l); -this.newEventsOnly = true; -}, "java.awt.event.KeyListener"); -Clazz_defineMethod (c$, "removeKeyListener", -function (l) { -if (l == null) { -return; -}this.keyListener = java.awt.AWTEventMulticaster.remove (this.keyListener, l); -}, "java.awt.event.KeyListener"); -Clazz_defineMethod (c$, "getKeyListeners", -function () { -return (this.getListeners (java.awt.event.KeyListener)); -}); -Clazz_defineMethod (c$, "addMouseListener", -function (l) { -if (l == null) { -return; -}System.out.println ("C adding mouse listener " + l); -this.mouseListener = java.awt.AWTEventMulticaster.add (this.mouseListener, l); -this.newEventsOnly = true; -}, "java.awt.event.MouseListener"); -Clazz_defineMethod (c$, "removeMouseListener", -function (l) { -if (l == null) { -return; -}this.mouseListener = java.awt.AWTEventMulticaster.remove (this.mouseListener, l); -}, "java.awt.event.MouseListener"); -Clazz_defineMethod (c$, "getMouseListeners", -function () { -return (this.getListeners (java.awt.event.MouseListener)); -}); -Clazz_defineMethod (c$, "addMouseMotionListener", -function (l) { -if (l == null) { -return; -}this.mouseMotionListener = java.awt.AWTEventMulticaster.add (this.mouseMotionListener, l); -this.newEventsOnly = true; -}, "java.awt.event.MouseMotionListener"); -Clazz_defineMethod (c$, "removeMouseMotionListener", -function (l) { -if (l == null) { -return; -}this.mouseMotionListener = java.awt.AWTEventMulticaster.remove (this.mouseMotionListener, l); -}, "java.awt.event.MouseMotionListener"); -Clazz_defineMethod (c$, "getMouseMotionListeners", -function () { -return (this.getListeners (java.awt.event.MouseMotionListener)); -}); -Clazz_defineMethod (c$, "addMouseWheelListener", -function (l) { -if (l == null) { -return; -}this.mouseWheelListener = java.awt.AWTEventMulticaster.add (this.mouseWheelListener, l); -this.newEventsOnly = true; -}, "java.awt.event.MouseWheelListener"); -Clazz_defineMethod (c$, "removeMouseWheelListener", -function (l) { -if (l == null) { -return; -}this.mouseWheelListener = java.awt.AWTEventMulticaster.remove (this.mouseWheelListener, l); -}, "java.awt.event.MouseWheelListener"); -Clazz_defineMethod (c$, "getMouseWheelListeners", -function () { -return (this.getListeners (java.awt.event.MouseWheelListener)); -}); -Clazz_defineMethod (c$, "addInputMethodListener", -function (l) { -if (l == null) { -return; -}this.inputMethodListener = java.awt.AWTEventMulticaster.add (this.inputMethodListener, l); -this.newEventsOnly = true; -}, "java.awt.event.InputMethodListener"); -Clazz_defineMethod (c$, "removeInputMethodListener", -function (l) { -if (l == null) { -return; -}this.inputMethodListener = java.awt.AWTEventMulticaster.remove (this.inputMethodListener, l); -}, "java.awt.event.InputMethodListener"); -Clazz_defineMethod (c$, "getInputMethodListeners", -function () { -return (this.getListeners (java.awt.event.InputMethodListener)); -}); -Clazz_defineMethod (c$, "getListeners", -function (listenerType) { -return this.getListenersComp (listenerType); -}, "Class"); -Clazz_defineMethod (c$, "getListenersComp", -function (listenerType) { -var l = null; -if (listenerType === java.awt.event.ComponentListener) { -l = this.componentListener; -} else if (listenerType === java.awt.event.FocusListener) { -l = this.focusListener; -} else if (listenerType === java.awt.event.HierarchyListener) { -l = this.hierarchyListener; -} else if (listenerType === java.awt.event.HierarchyBoundsListener) { -l = this.hierarchyBoundsListener; -} else if (listenerType === java.awt.event.KeyListener) { -l = this.keyListener; -} else if (listenerType === java.awt.event.MouseListener) { -l = this.mouseListener; -} else if (listenerType === java.awt.event.MouseMotionListener) { -l = this.mouseMotionListener; -} else if (listenerType === java.awt.event.MouseWheelListener) { -l = this.mouseWheelListener; -} else if (listenerType === java.awt.event.InputMethodListener) { -l = this.inputMethodListener; -} else if (listenerType === java.beans.PropertyChangeListener) { -return this.getPropertyChangeListeners (); -}return java.awt.AWTEventMulticaster.getListeners (l, listenerType); -}, "Class"); -Clazz_defineMethod (c$, "enableEvents", -function (eventsToEnable) { -var notifyAncestors = 0; -{ -if ((eventsToEnable & 32768) != 0 && this.hierarchyListener == null && (this.eventMask & 32768) == 0) { -notifyAncestors |= 32768; -}if ((eventsToEnable & 65536) != 0 && this.hierarchyBoundsListener == null && (this.eventMask & 65536) == 0) { -notifyAncestors |= 65536; -}this.eventMask |= eventsToEnable; -this.newEventsOnly = true; -}if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { -this.parent.proxyEnableEvents (this.eventMask); -}if (notifyAncestors != 0) { -{ -this.adjustListeningChildrenOnParent (notifyAncestors, 1); -}}}, "~N"); -Clazz_defineMethod (c$, "disableEvents", -function (eventsToDisable) { -var notifyAncestors = 0; -{ -if ((eventsToDisable & 32768) != 0 && this.hierarchyListener == null && (this.eventMask & 32768) != 0) { -notifyAncestors |= 32768; -}if ((eventsToDisable & 65536) != 0 && this.hierarchyBoundsListener == null && (this.eventMask & 65536) != 0) { -notifyAncestors |= 65536; -}this.eventMask &= ~eventsToDisable; -}if (notifyAncestors != 0) { -{ -this.adjustListeningChildrenOnParent (notifyAncestors, -1); -}}}, "~N"); -Clazz_defineMethod (c$, "checkCoalescing", - function () { -if (this.getClass ().getClassLoader () == null) { -return false; -}var clazz = this.getClass (); -{ -var value = java.awt.Component.coalesceMap.get (clazz); -if (value != null) { -return value; -}var enabled = Boolean.$valueOf (swingjs.JSToolkit.checkClassMethod (this, "coalesceEvents", "\\java.awt.AWTEvent\\java.awt.AWTEvent")); -java.awt.Component.coalesceMap.put (clazz, enabled); -return enabled; -}}); -Clazz_defineMethod (c$, "isCoalescingEnabled", -function () { -return this.coalescingEnabled; -}); -Clazz_defineMethod (c$, "coalesceEvents", -function (existingEvent, newEvent) { -return null; -}, "java.awt.AWTEvent,java.awt.AWTEvent"); -Clazz_defineMethod (c$, "processEvent", -function (e) { -this.processEventComp (e); -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "processEventComp", -function (e) { -if (Clazz_instanceOf (e, java.awt.event.FocusEvent)) { -this.processFocusEvent (e); -} else if (Clazz_instanceOf (e, java.awt.event.MouseEvent)) { -switch (e.getID ()) { -case 501: -case 502: -case 500: -case 504: -case 505: -this.processMouseEvent (e); -break; -case 503: -case 506: -this.processMouseMotionEvent (e); -break; -case 507: -this.processMouseWheelEvent (e); -break; -} -} else if (Clazz_instanceOf (e, java.awt.event.KeyEvent)) { -this.processKeyEvent (e); -} else if (Clazz_instanceOf (e, java.awt.event.ComponentEvent)) { -this.processComponentEvent (e); -} else if (Clazz_instanceOf (e, java.awt.event.InputMethodEvent)) { -this.processInputMethodEvent (e); -} else if (Clazz_instanceOf (e, java.awt.event.HierarchyEvent)) { -switch (e.getID ()) { -case 1400: -this.processHierarchyEvent (e); -break; -case 1401: -case 1402: -this.processHierarchyBoundsEvent (e); -break; -} -}}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "processComponentEvent", -function (e) { -var listener = this.componentListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 101: -listener.componentResized (e); -break; -case 100: -listener.componentMoved (e); -break; -case 102: -listener.componentShown (e); -break; -case 103: -listener.componentHidden (e); -break; -} -}}, "java.awt.event.ComponentEvent"); -Clazz_defineMethod (c$, "processFocusEvent", -function (e) { -var listener = this.focusListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 1004: -listener.focusGained (e); -break; -case 1005: -listener.focusLost (e); -break; -} -}}, "java.awt.event.FocusEvent"); -Clazz_defineMethod (c$, "processKeyEvent", -function (e) { -var listener = this.keyListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 400: -listener.keyTyped (e); -break; -case 401: -listener.keyPressed (e); -break; -case 402: -listener.keyReleased (e); -break; -} -}}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "processMouseEvent", -function (e) { -var listener = this.mouseListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 501: -listener.mousePressed (e); -break; -case 502: -listener.mouseReleased (e); -break; -case 500: -listener.mouseClicked (e); -break; -case 505: -listener.mouseExited (e); -break; -case 504: -listener.mouseEntered (e); -break; -} -}}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "processMouseMotionEvent", -function (e) { -var listener = this.mouseMotionListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 503: -listener.mouseMoved (e); -break; -case 506: -listener.mouseDragged (e); -break; -} -}}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "processMouseWheelEvent", -function (e) { -var listener = this.mouseWheelListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 507: -listener.mouseWheelMoved (e); -break; -} -}}, "java.awt.event.MouseWheelEvent"); -Clazz_defineMethod (c$, "postsOldMouseEvents", -function () { -return false; -}); -Clazz_defineMethod (c$, "processInputMethodEvent", -function (e) { -var listener = this.inputMethodListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 1100: -listener.inputMethodTextChanged (e); -break; -case 1101: -listener.caretPositionChanged (e); -break; -} -}}, "java.awt.event.InputMethodEvent"); -Clazz_defineMethod (c$, "processHierarchyEvent", -function (e) { -var listener = this.hierarchyListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 1400: -listener.hierarchyChanged (e); -break; -} -}}, "java.awt.event.HierarchyEvent"); -Clazz_defineMethod (c$, "processHierarchyBoundsEvent", -function (e) { -var listener = this.hierarchyBoundsListener; -if (listener != null) { -var id = e.getID (); -switch (id) { -case 1401: -listener.ancestorMoved (e); -break; -case 1402: -listener.ancestorResized (e); -break; -} -}}, "java.awt.event.HierarchyEvent"); -Clazz_defineMethod (c$, "handleEvent", -function (evt) { -switch (evt.id) { -case 504: -return this.mouseEnter (evt, evt.x, evt.y); -case 505: -return this.mouseExit (evt, evt.x, evt.y); -case 503: -return this.mouseMove (evt, evt.x, evt.y); -case 501: -return this.mouseDown (evt, evt.x, evt.y); -case 506: -return this.mouseDrag (evt, evt.x, evt.y); -case 502: -return this.mouseUp (evt, evt.x, evt.y); -case 401: -case 403: -return this.keyDown (evt, evt.key); -case 402: -case 404: -return this.keyUp (evt, evt.key); -case 1001: -return this.action (evt, evt.arg); -case 1004: -return this.gotFocus (evt, evt.arg); -case 1005: -return this.lostFocus (evt, evt.arg); -} -return false; -}, "java.awt.Event"); -Clazz_defineMethod (c$, "mouseDown", -function (evt, x, y) { -return false; -}, "java.awt.Event,~N,~N"); -Clazz_defineMethod (c$, "mouseDrag", -function (evt, x, y) { -return false; -}, "java.awt.Event,~N,~N"); -Clazz_defineMethod (c$, "mouseUp", -function (evt, x, y) { -return false; -}, "java.awt.Event,~N,~N"); -Clazz_defineMethod (c$, "mouseMove", -function (evt, x, y) { -return false; -}, "java.awt.Event,~N,~N"); -Clazz_defineMethod (c$, "mouseEnter", -function (evt, x, y) { -return false; -}, "java.awt.Event,~N,~N"); -Clazz_defineMethod (c$, "mouseExit", -function (evt, x, y) { -return false; -}, "java.awt.Event,~N,~N"); -Clazz_defineMethod (c$, "keyDown", -function (evt, key) { -return false; -}, "java.awt.Event,~N"); -Clazz_defineMethod (c$, "keyUp", -function (evt, key) { -return false; -}, "java.awt.Event,~N"); -Clazz_defineMethod (c$, "action", -function (evt, what) { -return false; -}, "java.awt.Event,~O"); -Clazz_defineMethod (c$, "addNotify", -function () { -this.addNotifyComp (); -}); -Clazz_defineMethod (c$, "addNotifyComp", -function () { -{ -var peer = this.peer; -if (peer == null || Clazz_instanceOf (peer, java.awt.peer.LightweightPeer)) { -if (peer == null) { -this.peer = peer = this.getToolkit ().createComponent (this); -}if (this.parent != null) { -var mask = 0; -if ((this.mouseListener != null) || ((this.eventMask & 16) != 0)) { -mask |= 16; -}if ((this.mouseMotionListener != null) || ((this.eventMask & 32) != 0)) { -mask |= 32; -}if ((this.mouseWheelListener != null) || ((this.eventMask & 131072) != 0)) { -mask |= 131072; -}if (this.focusListener != null || (this.eventMask & 4) != 0) { -mask |= 4; -}if (this.keyListener != null || (this.eventMask & 8) != 0) { -mask |= 8; -}if (mask != 0) { -this.parent.proxyEnableEvents (mask); -}}} else { -var parent = this.parent; -if (parent != null && Clazz_instanceOf (parent.peer, java.awt.peer.LightweightPeer)) { -this.relocateComponent (); -}}this.invalidate (); -this.peerFont = this.getFont (); -if (this.getContainer () != null && !this.isAddNotifyComplete) { -this.getContainer ().increaseComponentCount (this); -}if (this.parent != null && this.parent.peer != null) { -var parentContPeer = this.parent.peer; -if (Clazz_instanceOf (parentContPeer, java.awt.peer.LightweightPeer) && !(Clazz_instanceOf (peer, java.awt.peer.LightweightPeer))) { -var hwParent = this.getNativeContainer (); -if (hwParent != null && hwParent.peer != null) { -parentContPeer = hwParent.peer; -}}}if (!this.isAddNotifyComplete) { -this.mixOnShowing (); -}this.isAddNotifyComplete = true; -if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || java.awt.Toolkit.enabledOnToolkit (32768)) { -var e = new java.awt.event.HierarchyEvent (this, 1400, this, this.parent, 2 | ((this.isRecursivelyVisible ()) ? 4 : 0)); -this.dispatchEvent (e); -}}}); -Clazz_defineMethod (c$, "getNativeContainer", -function () { -var p = this.parent; -while (p != null && Clazz_instanceOf (p.peer, java.awt.peer.LightweightPeer)) { -p = p.getParent (); -} -return p; -}); -Clazz_defineMethod (c$, "removeNotify", -function () { -this.removeNotifyComp (); -}); -Clazz_defineMethod (c$, "removeNotifyComp", -function () { -{ -if (this.getContainer () != null && this.isAddNotifyComplete) { -this.getContainer ().decreaseComponentCount (this); -}var p = this.peer; -if (p != null) { -var isLightweight = this.isLightweight (); -this.peer = null; -this.peerFont = null; -java.awt.Toolkit.getEventQueue ().removeSourceEvents (this, false); -p.dispose (); -this.mixOnHiding (isLightweight); -this.isAddNotifyComplete = false; -}if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || java.awt.Toolkit.enabledOnToolkit (32768)) { -var e = new java.awt.event.HierarchyEvent (this, 1400, this, this.parent, 2 | ((this.isRecursivelyVisible ()) ? 4 : 0)); -this.dispatchEvent (e); -}}}); -Clazz_defineMethod (c$, "gotFocus", -function (evt, what) { -return false; -}, "java.awt.Event,~O"); -Clazz_defineMethod (c$, "lostFocus", -function (evt, what) { -return false; -}, "java.awt.Event,~O"); -Clazz_defineMethod (c$, "isFocusTraversable", -function () { -if (this.$isFocusTraversableOverridden == 0) { -this.$isFocusTraversableOverridden = 1; -}return this.focusable; -}); -Clazz_defineMethod (c$, "isFocusable", -function () { -return this.isFocusTraversable (); -}); -Clazz_defineMethod (c$, "setFocusable", -function (focusable) { -var oldFocusable; -{ -oldFocusable = this.focusable; -this.focusable = focusable; -}this.$isFocusTraversableOverridden = 2; -this.firePropertyChangeObject ("focusable", new Boolean (oldFocusable), new Boolean (focusable)); -}, "~B"); -Clazz_defineMethod (c$, "isFocusTraversableOverridden", -function () { -return (this.$isFocusTraversableOverridden != 1); -}); -Clazz_defineMethod (c$, "getFocusTraversalKeysEnabled", -function () { -return this.focusTraversalKeysEnabled; -}); -Clazz_defineMethod (c$, "requestFocus", -function () { -swingjs.JSToolkit.requestFocus (this); -}); -Clazz_defineMethod (c$, "requestFocus", -function (temporary) { -return swingjs.JSToolkit.requestFocus (this); -}, "~B"); -Clazz_defineMethod (c$, "requestFocusInWindow", -function () { -return swingjs.JSToolkit.requestFocus (this); -}); -Clazz_defineMethod (c$, "requestFocusInWindow", -function (temporary) { -return swingjs.JSToolkit.requestFocus (this); -}, "~B"); -Clazz_defineMethod (c$, "getFocusCycleRootAncestor", -function () { -var rootAncestor = this.parent; -while (rootAncestor != null && !rootAncestor.isFocusCycleRoot ()) { -rootAncestor = rootAncestor.parent; -} -return rootAncestor; -}); -Clazz_defineMethod (c$, "isFocusCycleRoot", -function (container) { -return this.isFocusCycleRootComp (container); -}, "java.awt.Container"); -Clazz_defineMethod (c$, "isFocusCycleRootComp", -function (container) { -var rootAncestor = this.getFocusCycleRootAncestor (); -return (rootAncestor === container); -}, "java.awt.Container"); -Clazz_defineMethod (c$, "hasFocus", -function () { -return swingjs.JSToolkit.hasFocus (this); -}); -Clazz_defineMethod (c$, "isFocusOwner", -function () { -return this.hasFocus (); -}); -Clazz_defineMethod (c$, "setAutoFocusTransferOnDisposal", -function (value) { -this.autoFocusTransferOnDisposal = value; -}, "~B"); -Clazz_defineMethod (c$, "isAutoFocusTransferOnDisposal", -function () { -return this.autoFocusTransferOnDisposal; -}); -Clazz_defineMethod (c$, "paramString", -function () { -return this.paramStringComp (); -}); -Clazz_defineMethod (c$, "paramStringComp", -function () { -var thisName = this.getName (); -var str = (thisName != null ? thisName : ""); -if (!this.isValid ()) { -str += ",invalid"; -}if (!this.visible) { -str += ",hidden"; -}if (!this.enabled) { -str += ",disabled"; -}str += ",parent:" + (this.parent == null ? null : this.parent.getName ()) + "," + this.x + "," + this.y + "," + this.width + "x" + this.height; -return str; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[" + this.paramString () + "]"; -}); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (listener) { -this.addPropChangeListenerComp (listener); -}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "addPropChangeListenerComp", -function (listener) { -{ -if (listener == null) { -return; -}if (this.changeSupport == null) { -this.changeSupport = new java.beans.PropertyChangeSupport (this); -}this.changeSupport.addPropertyChangeListener1 (listener); -}}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (listener) { -{ -if (listener == null || this.changeSupport == null) { -return; -}this.changeSupport.removePropertyChangeListener (listener); -}}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -{ -if (this.changeSupport == null) { -return new Array (0); -}return this.changeSupport.getPropertyChangeListeners (); -}}); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (propertyName, listener) { -this.addPropChangeListComp (propertyName, listener); -}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "addPropChangeListComp", -function (propertyName, listener) { -{ -if (arguments.length == 1) { -addPropertyChangeListener1(propertyName); return; } -}{ -if (listener == null) { -return; -}if (this.changeSupport == null) { -this.changeSupport = new java.beans.PropertyChangeSupport (this); -}this.changeSupport.addPropertyChangeListener2 (propertyName, listener); -}}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (propertyName, listener) { -{ -if (listener == null || this.changeSupport == null) { -return; -}this.changeSupport.removePropertyChangeListener (propertyName, listener); -}}, "~S,java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function (propertyName) { -{ -if (this.changeSupport == null) { -return new Array (0); -}return this.changeSupport.getPropertyChangeListeners (propertyName); -}}, "~S"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -this.firePropertyChangeObject (propertyName, oldValue, newValue); -}, "~S,~O,~O"); -Clazz_defineMethod (c$, "firePropertyChangeObject", -function (propertyName, oldValue, newValue) { -var changeSupport; -{ -changeSupport = this.changeSupport; -}if (changeSupport == null || (oldValue != null && newValue != null && oldValue.equals (newValue))) { -return; -}changeSupport.firePropertyChange (propertyName, oldValue, newValue); -}, "~S,~O,~O"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -this.firePropertyChangeBool (propertyName, oldValue, newValue); -}, "~S,~B,~B"); -Clazz_defineMethod (c$, "firePropertyChangeBool", -function (propertyName, oldValue, newValue) { -var changeSupport = this.changeSupport; -if (changeSupport == null || oldValue == newValue) { -return; -}changeSupport.firePropertyChange (propertyName, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); -}, "~S,~B,~B"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -this.firePropertyChangeInt (propertyName, oldValue, newValue); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "firePropertyChangeInt", -function (propertyName, oldValue, newValue) { -var changeSupport = this.changeSupport; -if (changeSupport == null || oldValue == newValue) { -return; -}changeSupport.firePropertyChange (propertyName, Integer.$valueOf (oldValue), Integer.$valueOf (newValue)); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -this.firePropertyChangeChar (propertyName, oldValue, newValue); -}, "~S,~S,~S"); -Clazz_defineMethod (c$, "firePropertyChangeChar", -function (propertyName, oldValue, newValue) { -if (this.changeSupport == null || oldValue == newValue) { -return; -}this.firePropertyChangeObject (propertyName, new Character (oldValue), new Character (newValue)); -}, "~S,~S,~S"); -Clazz_defineMethod (c$, "firePropertyChangeShort", -function (propertyName, oldValue, newValue) { -if (this.changeSupport == null || oldValue == newValue) { -return; -}this.firePropertyChangeObject (propertyName, Short.$valueOf (oldValue), Short.$valueOf (newValue)); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "firePropertyChangeLong", -function (propertyName, oldValue, newValue) { -if (this.changeSupport == null || oldValue == newValue) { -return; -}this.firePropertyChangeObject (propertyName, Long.$valueOf (oldValue), Long.$valueOf (newValue)); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "firePropertyChangeFloat", -function (propertyName, oldValue, newValue) { -if (this.changeSupport == null || oldValue == newValue) { -return; -}this.firePropertyChangeObject (propertyName, Float.$valueOf (oldValue), Float.$valueOf (newValue)); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "firePropertyChangeDouble", -function (propertyName, oldValue, newValue) { -if (this.changeSupport == null || oldValue == newValue) { -return; -}this.firePropertyChangeObject (propertyName, Double.$valueOf (oldValue), Double.$valueOf (newValue)); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "setComponentOrientation", -function (o) { -var oldValue = this.componentOrientation; -this.componentOrientation = o; -this.firePropertyChangeObject ("componentOrientation", oldValue, o); -this.invalidateIfValid (); -}, "java.awt.ComponentOrientation"); -Clazz_defineMethod (c$, "getComponentOrientation", -function () { -return this.componentOrientation; -}); -Clazz_defineMethod (c$, "applyComponentOrientation", -function (orientation) { -this.applyCompOrientComp (orientation); -}, "java.awt.ComponentOrientation"); -Clazz_defineMethod (c$, "applyCompOrientComp", -function (orientation) { -if (orientation == null) { -throw new NullPointerException (); -}this.setComponentOrientation (orientation); -}, "java.awt.ComponentOrientation"); -Clazz_defineMethod (c$, "canBeFocusOwner", -function () { -if (this.isEnabled () && this.isDisplayable () && this.isVisible () && this.isFocusable ()) { -return true; -}return false; -}); -Clazz_defineMethod (c$, "canBeFocusOwnerRecursively", -function () { -if (!this.canBeFocusOwner ()) { -return false; -}if (this.parent != null) { -return this.parent.canContainFocusOwner (this); -}return true; -}); -Clazz_defineMethod (c$, "relocateComponent", -function () { -}); -Clazz_defineMethod (c$, "getContainingWindow", -function () { -return jssun.awt.SunToolkit.getContainingWindow (this); -}); -c$.isInstanceOf = Clazz_defineMethod (c$, "isInstanceOf", -function (obj, className) { -if (obj == null) return false; -if (className == null) return false; -var cls = obj.getClass (); -while (cls != null) { -if (cls.getName ().equals (className)) { -return true; -}cls = cls.getSuperclass (); -} -return false; -}, "~O,~S"); -Clazz_defineMethod (c$, "areBoundsValid", -function () { -var cont = this.getContainer (); -return cont == null || cont.isValid () || cont.getLayout () == null; -}); -Clazz_defineMethod (c$, "getLocationOnWindow", -function () { -var curLocation = this.getLocation (); -for (var parent = this.getContainer (); parent != null && !(Clazz_instanceOf (parent, java.awt.Window)); parent = parent.getContainer ()) { -curLocation.x += parent.getX (); -curLocation.y += parent.getY (); -} -return curLocation; -}); -Clazz_defineMethod (c$, "getSiblingIndexAbove", -function () { -var parent = this.getContainer (); -if (parent == null) { -return -1; -}var nextAbove = parent.getComponentZOrder (this) - 1; -return nextAbove < 0 ? -1 : nextAbove; -}); -Clazz_defineMethod (c$, "getSiblingIndexBelow", -function () { -var parent = this.getContainer (); -if (parent == null) { -return -1; -}var nextBelow = parent.getComponentZOrder (this) + 1; -return nextBelow >= parent.getComponentCount () ? -1 : nextBelow; -}); -Clazz_defineMethod (c$, "mixOnShowing", -function () { -}); -Clazz_defineMethod (c$, "mixOnHiding", -function (isLightweight) { -}, "~B"); -Clazz_defineMethod (c$, "mixOnReshaping", -function () { -swingjs.JSToolkit.taintUI (this); -}); -Clazz_defineMethod (c$, "mixOnZOrderChanging", -function (oldZorder, newZorder) { -}, "~N,~N"); -Clazz_defineMethod (c$, "mixOnValidating", -function () { -}); -c$.doesClassImplement = Clazz_defineMethod (c$, "doesClassImplement", - function (cls, interfaceName) { -if (cls == null) return false; -for (var c, $c = 0, $$c = cls.getInterfaces (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) { -if (c.getName ().equals (interfaceName)) { -return true; -}} -return java.awt.Component.doesClassImplement (cls.getSuperclass (), interfaceName); -}, "Class,~S"); -c$.doesImplement = Clazz_defineMethod (c$, "doesImplement", -function (obj, interfaceName) { -if (obj == null) return false; -if (interfaceName == null) return false; -return java.awt.Component.doesClassImplement (obj.getClass (), interfaceName); -}, "~O,~S"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.Component, "BaselineResizeBehavior", Enum); -Clazz_defineEnumConstant (c$, "CONSTANT_ASCENT", 0, []); -Clazz_defineEnumConstant (c$, "CONSTANT_DESCENT", 1, []); -Clazz_defineEnumConstant (c$, "CENTER_OFFSET", 2, []); -Clazz_defineEnumConstant (c$, "OTHER", 3, []); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.Component, "AWTTreeLock"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"FOCUS_TRAVERSABLE_UNKNOWN", 0, -"FOCUS_TRAVERSABLE_DEFAULT", 1, -"FOCUS_TRAVERSABLE_SET", 2, -"actionListenerK", "actionL", -"adjustmentListenerK", "adjustmentL", -"componentListenerK", "componentL", -"containerListenerK", "containerL", -"focusListenerK", "focusL", -"itemListenerK", "itemL", -"keyListenerK", "keyL", -"mouseListenerK", "mouseL", -"mouseMotionListenerK", "mouseMotionL", -"mouseWheelListenerK", "mouseWheelL", -"textListenerK", "textL", -"ownedWindowK", "ownedL", -"windowListenerK", "windowL", -"inputMethodListenerK", "inputMethodL", -"hierarchyListenerK", "hierarchyL", -"hierarchyBoundsListenerK", "hierarchyBoundsL", -"windowStateListenerK", "windowStateL", -"windowFocusListenerK", "windowFocusL", -"isInc", false, -"incRate", 0, -"TOP_ALIGNMENT", 0.0, -"CENTER_ALIGNMENT", 0.5, -"BOTTOM_ALIGNMENT", 1.0, -"LEFT_ALIGNMENT", 0.0, -"RIGHT_ALIGNMENT", 1.0, -"incr", 0); -c$.coalesceMap = c$.prototype.coalesceMap = new java.util.HashMap (); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (null, "jssun.awt.SunGraphicsCallback", ["java.awt.Container", "$.Graphics2D", "jssun.awt.ConstrainableGraphics", "$.Graphics2Delegate"], function () { -c$ = Clazz_declareType (jssun.awt, "SunGraphicsCallback"); -Clazz_defineMethod (c$, "constrainGraphics", -function (g, bounds) { -if (Clazz_instanceOf (g, jssun.awt.ConstrainableGraphics)) { -(g).constrain (bounds.x, bounds.y, bounds.width, bounds.height); -} else { -g.translate (bounds.x, bounds.y); -}g.clipRect (0, 0, bounds.width, bounds.height); -}, "java.awt.Graphics,java.awt.Rectangle"); -Clazz_defineMethod (c$, "runOneComponent", -function (comp, bounds, g, clip, weightFlags) { -if (comp == null || !comp.isLightweight () || !comp.isVisible ()) { -return; -}var lightweight = comp.isLightweight (); -if ((lightweight && (weightFlags & 2) == 0) || (!lightweight && (weightFlags & 1) == 0)) { -return; -}if (bounds == null) { -bounds = comp.getBounds (); -}if (clip == null || clip.intersects (bounds)) { -var cg = g.createSwingJS (); -try { -this.constrainGraphics (cg, bounds); -cg.setFont (comp.getFont ()); -cg.setColor (comp.getForeground ()); -if (Clazz_instanceOf (cg, java.awt.Graphics2D)) { -(cg).setBackground (comp.getBackground ()); -} else if (Clazz_instanceOf (cg, jssun.awt.Graphics2Delegate)) { -(cg).setBackground (comp.getBackground ()); -}this.run (comp, cg); -} finally { -cg.dispose (); -} -}}, "java.awt.Component,java.awt.Rectangle,java.awt.Graphics,java.awt.Shape,~N"); -Clazz_defineMethod (c$, "runComponents", -function (comps, g, weightFlags) { -var ncomponents = comps.length; -var clip = g.getClip (); -for (var i = ncomponents - 1; i >= 0; i--) { -this.runOneComponent (comps[i], null, g, clip, weightFlags); -} -}, "~A,java.awt.Graphics,~N"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (jssun.awt.SunGraphicsCallback, "PaintHeavyweightComponentsCallback", jssun.awt.SunGraphicsCallback); -Clazz_makeConstructor (c$, - function () { -Clazz_superConstructor (this, jssun.awt.SunGraphicsCallback.PaintHeavyweightComponentsCallback, []); -}); -Clazz_overrideMethod (c$, "run", -function (a, b) { -if (!a.isLightweight ()) { -a.paintAll (b); -} else if (Clazz_instanceOf (a, java.awt.Container)) { -this.runComponents ((a).getComponents (), b, 3); -}}, "java.awt.Component,java.awt.Graphics"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function () { -return jssun.awt.SunGraphicsCallback.PaintHeavyweightComponentsCallback.instance; -}); -c$.instance = c$.prototype.instance = new jssun.awt.SunGraphicsCallback.PaintHeavyweightComponentsCallback (); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"HEAVYWEIGHTS", 0x1, -"LIGHTWEIGHTS", 0x2, -"TWO_PASSES", 0x4); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.util.HashMap", "java.awt.Rectangle"], "javax.swing.RepaintManager", ["java.lang.StringBuffer", "$.Thread", "java.util.ArrayList", "$.HashSet", "$.IdentityHashMap", "java.applet.Applet", "java.awt.Frame", "$.Toolkit", "$.Window", "java.awt.event.InvocationEvent", "javax.swing.CellRendererPane", "$.JComponent", "$.SwingUtilities", "jssun.awt.AWTAccessor", "$.AppContext", "$.SunToolkit", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.volatileMap = null; -this.hwDirtyComponents = null; -this.dirtyComponents = null; -this.tmpDirtyComponents = null; -this.invalidComponents = null; -this.runnableList = null; -this.paintDepth = 0; -this.painting = false; -this.repaintRoot = null; -this.paintThread = null; -this.processingRunnable = null; -this.myComponent = null; -this.tmp = null; -if (!Clazz_isClassDefined ("javax.swing.RepaintManager.ProcessingRunnable")) { -javax.swing.RepaintManager.$RepaintManager$ProcessingRunnable$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "RepaintManager"); -Clazz_prepareFields (c$, function () { -this.volatileMap = new java.util.HashMap (1); -this.tmp = new java.awt.Rectangle (); -}); -c$.currentManager = Clazz_defineMethod (c$, "currentManager", -function (c) { -var appContext = jssun.awt.AppContext.getAppContext (); -var rm = appContext.get (javax.swing.RepaintManager.repaintManagerKey); -if (rm == null) { -rm = new javax.swing.RepaintManager (); -rm.set (c); -appContext.put (javax.swing.RepaintManager.repaintManagerKey, rm); -}return rm; -}, "java.awt.Component"); -c$.setCurrentManager = Clazz_defineMethod (c$, "setCurrentManager", -function (aRepaintManager) { -if (aRepaintManager != null) { -javax.swing.SwingUtilities.appContextPut (javax.swing.RepaintManager.repaintManagerKey, aRepaintManager); -} else { -javax.swing.SwingUtilities.appContextRemove (javax.swing.RepaintManager.repaintManagerKey); -}}, "javax.swing.RepaintManager"); -Clazz_makeConstructor (c$, - function () { -this.processingRunnable = Clazz_innerTypeInstance (javax.swing.RepaintManager.ProcessingRunnable, this, null); -}); -Clazz_defineMethod (c$, "set", - function (c) { -this.myComponent = c; -this.dirtyComponents = new java.util.IdentityHashMap (); -this.tmpDirtyComponents = new java.util.IdentityHashMap (); -this.hwDirtyComponents = new java.util.IdentityHashMap (); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "addInvalidComponent", -function (invalidComponent) { -var validateRoot = null; -for (var c = invalidComponent; c != null; c = c.getParent ()) { -if ((Clazz_instanceOf (c, javax.swing.CellRendererPane))) { -return; -}if ((Clazz_instanceOf (c, javax.swing.JComponent)) && ((c).isValidateRoot ())) { -validateRoot = c; -break; -}} -if (validateRoot == null) { -return; -}var root = null; -for (var c = validateRoot; c != null; c = c.getParent ()) { -if (!c.isVisible ()) { -return; -}if ((Clazz_instanceOf (c, java.awt.Window)) || (Clazz_instanceOf (c, java.applet.Applet))) { -root = c; -break; -}} -if (root == null) { -return; -}if (this.invalidComponents == null) { -this.invalidComponents = new java.util.ArrayList (); -} else { -var n = this.invalidComponents.size (); -for (var i = 0; i < n; i++) { -if (validateRoot === this.invalidComponents.get (i)) { -return; -}} -}this.invalidComponents.add (validateRoot); -this.scheduleProcessingRunnable (root); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "removeInvalidComponent", -function (component) { -if (this.invalidComponents != null) { -var index = this.invalidComponents.indexOf (component); -if (index != -1) { -this.invalidComponents.remove (index); -}}}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "addDirtyRegion0", - function (c, x, y, w, h) { -{ -var g = c.getGraphics(); -if (g == null || g.gc == null)return; -}if ((w <= 0) || (h <= 0) || (c == null)) { -return; -}if ((c.getWidth () <= 0) || (c.getHeight () <= 0)) { -return; -}if (this.extendDirtyRegion (c, x, y, w, h)) { -return; -}var root = null; -for (var p = c; p != null; p = p.getParent ()) { -if (!p.isVisible () || p.getPeer () == null) { -return; -}if ((Clazz_instanceOf (p, java.awt.Window)) || (Clazz_instanceOf (p, java.applet.Applet))) { -if (Clazz_instanceOf (p, java.awt.Frame) && ((p).getExtendedState () & 1) == 1) { -return; -}root = p; -break; -}} -if (root == null) return; -{ -if (this.extendDirtyRegion (c, x, y, w, h)) { -return; -}this.dirtyComponents.put (c, new java.awt.Rectangle (x, y, w, h)); -}this.scheduleProcessingRunnable (c); -}, "java.awt.Container,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "addDirtyRegion", -function (c, x, y, w, h) { -this.addDirtyRegion0 (c, x, y, w, h); -}, "javax.swing.JComponent,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "addDirtyRegion", -function (window, x, y, w, h) { -this.addDirtyRegion0 (window, x, y, w, h); -}, "java.awt.Window,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "addDirtyRegion", -function (applet, x, y, w, h) { -this.addDirtyRegion0 (applet, x, y, w, h); -}, "java.applet.Applet,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "scheduleHeavyWeightPaints", -function () { -var hws; -{ -if (this.hwDirtyComponents.size () == 0) { -return; -}hws = this.hwDirtyComponents; -this.hwDirtyComponents = new java.util.IdentityHashMap (); -}for (var hw, $hw = hws.keySet ().iterator (); $hw.hasNext () && ((hw = $hw.next ()) || true);) { -var dirty = hws.get (hw); -if (Clazz_instanceOf (hw, java.awt.Window)) { -this.addDirtyRegion (hw, dirty.x, dirty.y, dirty.width, dirty.height); -} else if (Clazz_instanceOf (hw, java.applet.Applet)) { -this.addDirtyRegion (hw, dirty.x, dirty.y, dirty.width, dirty.height); -} else { -this.addDirtyRegion0 (hw, dirty.x, dirty.y, dirty.width, dirty.height); -}} -}); -Clazz_defineMethod (c$, "nativeAddDirtyRegion", -function (appContext, c, x, y, w, h) { -if (w > 0 && h > 0) { -{ -var dirty = this.hwDirtyComponents.get (c); -if (dirty == null) { -this.hwDirtyComponents.put (c, new java.awt.Rectangle (x, y, w, h)); -} else { -this.hwDirtyComponents.put (c, javax.swing.SwingUtilities.computeUnion (x, y, w, h, dirty)); -}}this.scheduleProcessingRunnable (appContext); -}}, "jssun.awt.AppContext,java.awt.Container,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "extendDirtyRegion", - function (c, x, y, w, h) { -var r = this.dirtyComponents.get (c); -if (r != null) { -javax.swing.SwingUtilities.computeUnion (x, y, w, h, r); -return true; -}return false; -}, "java.awt.Component,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getDirtyRegion", -function (aComponent) { -var r = null; -{ -r = this.dirtyComponents.get (aComponent); -}if (r == null) return new java.awt.Rectangle (0, 0, 0, 0); - else return new java.awt.Rectangle (r); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "markCompletelyDirty", -function (aComponent) { -this.addDirtyRegion (aComponent, 0, 0, 2147483647, 2147483647); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "markCompletelyClean", -function (aComponent) { -{ -this.dirtyComponents.remove (aComponent); -}}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "isCompletelyDirty", -function (aComponent) { -var r; -r = this.getDirtyRegion (aComponent); -if (r.width == 2147483647 && r.height == 2147483647) return true; - else return false; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "validateInvalidComponents", -function () { -var ic; -{ -if (this.invalidComponents == null) { -return; -}ic = this.invalidComponents; -this.invalidComponents = null; -}var n = ic.size (); -for (var i = 0; i < n; i++) { -var c = ic.get (i); -c.validate (); -} -}); -Clazz_defineMethod (c$, "prePaintDirtyRegions", - function () { -var dirtyComponents; -var runnableList; -{ -dirtyComponents = this.dirtyComponents; -runnableList = this.runnableList; -this.runnableList = null; -}if (runnableList != null) { -for (var runnable, $runnable = runnableList.iterator (); $runnable.hasNext () && ((runnable = $runnable.next ()) || true);) { -runnable.run (); -} -}this.paintDirtyRegions (); -if (dirtyComponents.size () > 0) { -this.paintDirtyRegions1 (dirtyComponents); -}}); -Clazz_defineMethod (c$, "updateWindows", - function (dirtyComponents) { -var toolkit = java.awt.Toolkit.getDefaultToolkit (); -if (!(Clazz_instanceOf (toolkit, jssun.awt.SunToolkit) && (toolkit).needUpdateWindow ())) { -return dirtyComponents; -}var windows = new java.util.HashSet (); -var dirtyComps = dirtyComponents.keySet (); -for (var it = dirtyComps.iterator (); it.hasNext (); ) { -var dirty = it.next (); -var window = Clazz_instanceOf (dirty, java.awt.Window) ? dirty : javax.swing.SwingUtilities.getWindowAncestor (dirty); -if (window != null && !jssun.awt.AWTAccessor.getWindowAccessor ().isOpaque (window)) { -it.remove (); -windows.add (window); -}} -for (var window, $window = windows.iterator (); $window.hasNext () && ((window = $window.next ()) || true);) { -jssun.awt.AWTAccessor.getWindowAccessor ().updateWindow (window, null); -} -return dirtyComponents; -}, "java.util.Map"); -Clazz_defineMethod (c$, "paintDirtyRegions", -function () { -{ -var tmp = this.tmpDirtyComponents; -this.tmpDirtyComponents = this.dirtyComponents; -this.dirtyComponents = tmp; -this.dirtyComponents.clear (); -}this.paintDirtyRegions1 (this.tmpDirtyComponents); -}); -Clazz_defineMethod (c$, "paintDirtyRegions1", - function (tmpDirtyComponents) { -if (tmpDirtyComponents.isEmpty ()) { -return; -}this.updateWindows (tmpDirtyComponents); -var roots = new java.util.ArrayList (tmpDirtyComponents.size ()); -for (var dirty, $dirty = tmpDirtyComponents.keySet ().iterator (); $dirty.hasNext () && ((dirty = $dirty.next ()) || true);) { -this.collectDirtyComponents (tmpDirtyComponents, dirty, roots); -} -var count = roots.size (); -this.painting = true; -try { -for (var j = 0; j < count; j++) { -var i = j; -var dirtyComponent = roots.get (j); -var rect = tmpDirtyComponents.get (dirtyComponent); -var localBoundsH = dirtyComponent.getHeight (); -var localBoundsW = dirtyComponent.getWidth (); -javax.swing.SwingUtilities.computeIntersection (0, 0, localBoundsW, localBoundsH, rect); -if (Clazz_instanceOf (dirtyComponent, javax.swing.JComponent)) { -(dirtyComponent).paintImmediately (rect.x, rect.y, rect.width, rect.height); -} else if (dirtyComponent.isShowing ()) { -var g = javax.swing.JComponent.safelyGetGraphics (dirtyComponent, dirtyComponent); -if (g != null) { -try { -dirtyComponent.paint (g); -} finally { -g.dispose (); -} -}}if (this.repaintRoot != null) { -this.adjustRoots (this.repaintRoot, roots, i + 1); -count = roots.size (); -this.repaintRoot.paintImmediately (0, 0, this.repaintRoot.getWidth (), this.repaintRoot.getHeight ()); -this.repaintRoot = null; -}} -} finally { -this.painting = false; -} -tmpDirtyComponents.clear (); -}, "java.util.Map"); -Clazz_defineMethod (c$, "adjustRoots", - function (root, roots, index) { -for (var i = roots.size () - 1; i >= index; i--) { -var c = roots.get (i); -for (; ; ) { -if (c === root || c == null || !(Clazz_instanceOf (c, javax.swing.JComponent))) { -break; -}c = c.getParent (); -} -if (c === root) { -roots.remove (i); -}} -}, "javax.swing.JComponent,java.util.List,~N"); -Clazz_defineMethod (c$, "collectDirtyComponents", -function (dirtyComponents, dirtyComponent, roots) { -var dx; -var dy; -var rootDx; -var rootDy; -var component; -var rootDirtyComponent; -var parent; -component = rootDirtyComponent = dirtyComponent; -var x = dirtyComponent.getX (); -var y = dirtyComponent.getY (); -var w = dirtyComponent.getWidth (); -var h = dirtyComponent.getHeight (); -dx = rootDx = 0; -dy = rootDy = 0; -this.tmp.setBounds (dirtyComponents.get (dirtyComponent)); -javax.swing.SwingUtilities.computeIntersection (0, 0, w, h, this.tmp); -if (this.tmp.isEmpty ()) { -return; -}for (; ; ) { -if (!(Clazz_instanceOf (component, javax.swing.JComponent))) break; -parent = component.getParent (); -if (parent == null) break; -component = parent; -dx += x; -dy += y; -this.tmp.setLocation (this.tmp.x + x, this.tmp.y + y); -x = component.getX (); -y = component.getY (); -w = component.getWidth (); -h = component.getHeight (); -this.tmp = javax.swing.SwingUtilities.computeIntersection (0, 0, w, h, this.tmp); -if (this.tmp.isEmpty ()) { -return; -}if (dirtyComponents.get (component) != null) { -rootDirtyComponent = component; -rootDx = dx; -rootDy = dy; -}} -if (dirtyComponent !== rootDirtyComponent) { -var r; -this.tmp.setLocation (this.tmp.x + rootDx - dx, this.tmp.y + rootDy - dy); -r = dirtyComponents.get (rootDirtyComponent); -javax.swing.SwingUtilities.computeUnion (this.tmp.x, this.tmp.y, this.tmp.width, this.tmp.height, r); -}if (!roots.contains (rootDirtyComponent)) roots.add (rootDirtyComponent); -}, "java.util.Map,java.awt.Component,java.util.List"); -Clazz_overrideMethod (c$, "toString", -function () { -var sb = new StringBuffer (); -if (this.dirtyComponents != null) sb.append ("" + this.dirtyComponents); -return sb.toString (); -}); -Clazz_defineMethod (c$, "getOffscreenBuffer", -function (c, proposedWidth, proposedHeight) { -return null; -}, "java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getVolatileOffscreenBuffer", -function (c, proposedWidth, proposedHeight) { -var config = c.getGraphicsConfiguration (); -var maxSize = this.getDoubleBufferMaximumSize (); -var width = proposedWidth < 1 ? 1 : (proposedWidth > maxSize.width ? maxSize.width : proposedWidth); -var height = proposedHeight < 1 ? 1 : (proposedHeight > maxSize.height ? maxSize.height : proposedHeight); -var image = this.volatileMap.get (config); -if (image == null || image.getWidth () < width || image.getHeight () < height) { -if (image != null) { -image.flush (); -}image = config.createCompatibleVolatileImage (width, height); -this.volatileMap.put (config, image); -}return image; -}, "java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "setDoubleBufferMaximumSize", -function (d) { -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "getDoubleBufferMaximumSize", -function () { -return null; -}); -Clazz_defineMethod (c$, "setDoubleBufferingEnabled", -function (aFlag) { -}, "~B"); -Clazz_defineMethod (c$, "resetDoubleBuffer", -function () { -}); -Clazz_defineMethod (c$, "resetVolatileDoubleBuffer", -function (gc) { -var image = this.volatileMap.remove (gc); -if (image != null) { -image.flush (); -}}, "java.awt.GraphicsConfiguration"); -Clazz_defineMethod (c$, "useVolatileDoubleBuffer", -function () { -return javax.swing.RepaintManager.volatileImageBufferEnabled; -}); -Clazz_defineMethod (c$, "isPaintingThread", - function () { -return (Thread.currentThread () === this.paintThread); -}); -Clazz_defineMethod (c$, "paint", -function (paintingComponent, bufferComponent, g, x, y, w, h) { -paintingComponent.paintToOffscreen (g, x, y, w, h, x + w, y + h); -}, "javax.swing.JComponent,javax.swing.JComponent,java.awt.Graphics,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "beginPaint", -function () { -var multiThreadedPaint = false; -var paintDepth = 0; -var currentThread = Thread.currentThread (); -{ -paintDepth = this.paintDepth; -if (this.paintThread == null || currentThread === this.paintThread) { -this.paintThread = currentThread; -this.paintDepth++; -} else { -multiThreadedPaint = true; -}}}); -Clazz_defineMethod (c$, "endPaint", -function () { -if (this.isPaintingThread ()) { -}}); -Clazz_defineMethod (c$, "doubleBufferingChanged", -function (rootPane) { -}, "javax.swing.JRootPane"); -Clazz_defineMethod (c$, "scheduleProcessingRunnable", - function (c) { -this.scheduleProcessingRunnable (c.getAppContext ()); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "scheduleProcessingRunnable", - function (context) { -if (this.processingRunnable.markPending ()) { -jssun.awt.SunToolkit.getSystemEventQueueImplPP (context).postEvent ( new java.awt.event.InvocationEvent (java.awt.Toolkit.getDefaultToolkit (), this.processingRunnable)); -}}, "jssun.awt.AppContext"); -c$.$RepaintManager$ProcessingRunnable$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -this.pending = false; -Clazz_instantialize (this, arguments); -}, javax.swing.RepaintManager, "ProcessingRunnable", null, Runnable); -Clazz_defineMethod (c$, "markPending", -function () { -if (!this.pending) { -this.pending = true; -return true; -}return false; -}); -Clazz_overrideMethod (c$, "run", -function () { -{ -this.pending = false; -}this.b$["javax.swing.RepaintManager"].scheduleHeavyWeightPaints (); -this.b$["javax.swing.RepaintManager"].validateInvalidComponents (); -this.b$["javax.swing.RepaintManager"].prePaintDirtyRegions (); -swingjs.JSToolkit.forceRepaint (this.b$["javax.swing.RepaintManager"].myComponent); -}); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"HANDLE_TOP_LEVEL_PAINT", false); -c$.repaintManagerKey = c$.prototype.repaintManagerKey = javax.swing.RepaintManager; -Clazz_defineStatics (c$, -"volatileImageBufferEnabled", true); -{ -javax.swing.RepaintManager.volatileImageBufferEnabled = false; -var headless = false; -if (javax.swing.RepaintManager.volatileImageBufferEnabled && headless) { -javax.swing.RepaintManager.volatileImageBufferEnabled = false; -}javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT = true; -}}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (["java.awt.Toolkit", "jssun.awt.ComponentFactory", "$.WindowClosingListener", "$.WindowClosingSupport", "java.util.HashMap"], "jssun.awt.SunToolkit", ["java.lang.NullPointerException", "$.Thread", "java.awt.Component", "$.Dimension", "$.EventQueue", "$.Panel", "$.Window", "jssun.awt.AWTAccessor", "$.AWTAutoShutdown", "$.AppContext", "$.PeerEvent", "$.PostEventQueue", "jssun.font.FontDesignMetrics"], function () { -c$ = Clazz_decorateAsClass (function () { -this.windowClosingListener = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "SunToolkit", java.awt.Toolkit, [jssun.awt.WindowClosingSupport, jssun.awt.WindowClosingListener, jssun.awt.ComponentFactory]); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, jssun.awt.SunToolkit, []); -var eventQueue; -eventQueue = new java.awt.EventQueue (); -var appContext = jssun.awt.AppContext.getAppContext (); -if (appContext != null) { -appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, eventQueue); -var postEventQueue = new jssun.awt.PostEventQueue (eventQueue); -appContext.put ("PostEventQueue", postEventQueue); -}}); -Clazz_defineMethod (c$, "useBufferPerWindow", -function () { -return false; -}); -c$.createNewAppContext = Clazz_defineMethod (c$, "createNewAppContext", -function () { -var threadGroup = Thread.currentThread ().getThreadGroup (); -return jssun.awt.SunToolkit.createNewAppContext (threadGroup); -}); -c$.createNewAppContext = Clazz_defineMethod (c$, "createNewAppContext", -function (threadGroup) { -var eventQueue; -var eqName = System.getProperty ("AWT.EventQueueClass", "java.awt.EventQueue"); -try { -eventQueue = Clazz._4Name (eqName).newInstance (); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -System.err.println ("Failed loading " + eqName + ": " + e); -eventQueue = new java.awt.EventQueue (); -} else { -throw e; -} -} -var appContext = new jssun.awt.AppContext (threadGroup); -appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, eventQueue); -var postEventQueue = new jssun.awt.PostEventQueue (eventQueue); -appContext.put ("PostEventQueue", postEventQueue); -return appContext; -}, "ThreadGroup"); -c$.wakeupEventQueue = Clazz_defineMethod (c$, "wakeupEventQueue", -function (q, isShutdown) { -q.wakeup (isShutdown); -}, "java.awt.EventQueue,~B"); -c$.targetToPeer = Clazz_defineMethod (c$, "targetToPeer", -function (target) { -if (target != null) { -return jssun.awt.AWTAutoShutdown.getInstance ().getPeer (target); -}return null; -}, "~O"); -c$.targetCreatedPeer = Clazz_defineMethod (c$, "targetCreatedPeer", -function (target, peer) { -if (target != null && peer != null) { -jssun.awt.AWTAutoShutdown.getInstance ().registerPeer (target, peer); -}}, "~O,~O"); -c$.targetDisposedPeer = Clazz_defineMethod (c$, "targetDisposedPeer", -function (target, peer) { -if (target != null && peer != null) { -jssun.awt.AWTAutoShutdown.getInstance ().unregisterPeer (target, peer); -}}, "~O,~O"); -c$.setAppContext = Clazz_defineMethod (c$, "setAppContext", - function (target, context) { -if (Clazz_instanceOf (target, java.awt.Component)) { -jssun.awt.AWTAccessor.getComponentAccessor ().setAppContext (target, context); -} else { -return false; -}return true; -}, "~O,jssun.awt.AppContext"); -c$.getAppContext = Clazz_defineMethod (c$, "getAppContext", - function (target) { -if (Clazz_instanceOf (target, java.awt.Component)) { -{ -return target.appContext; -}} else { -return null; -}}, "~O"); -c$.targetToAppContext = Clazz_defineMethod (c$, "targetToAppContext", -function (target) { -if (target == null) { -return null; -}var context = jssun.awt.SunToolkit.getAppContext (target); -if (context == null) { -context = jssun.awt.SunToolkit.appContextMap.get (target); -}return context; -}, "~O"); -c$.setLWRequestStatus = Clazz_defineMethod (c$, "setLWRequestStatus", -function (changed, status) { -jssun.awt.AWTAccessor.getWindowAccessor ().setLWRequestStatus (changed, status); -}, "java.awt.Window,~B"); -c$.checkAndSetPolicy = Clazz_defineMethod (c$, "checkAndSetPolicy", -function (cont, isSwingCont) { -}, "java.awt.Container,~B"); -c$.insertTargetMapping = Clazz_defineMethod (c$, "insertTargetMapping", -function (target, appContext) { -if (!jssun.awt.SunToolkit.setAppContext (target, appContext)) { -jssun.awt.SunToolkit.appContextMap.put (target, appContext); -}}, "~O,jssun.awt.AppContext"); -c$.postEvent = Clazz_defineMethod (c$, "postEvent", -function (appContext, event) { -if (event == null) { -throw new NullPointerException (); -}var postEventQueue = appContext.get ("PostEventQueue"); -if (postEventQueue != null) { -postEventQueue.postEvent (event); -}}, "jssun.awt.AppContext,java.awt.AWTEvent"); -c$.postPriorityEvent = Clazz_defineMethod (c$, "postPriorityEvent", -function (e) { -var pe = new jssun.awt.PeerEvent (java.awt.Toolkit.getDefaultToolkit (), ((Clazz_isClassDefined ("jssun.awt.SunToolkit$1") ? 0 : jssun.awt.SunToolkit.$SunToolkit$1$ ()), Clazz_innerTypeInstance (jssun.awt.SunToolkit$1, this, Clazz_cloneFinals ("e", e))), 2); -jssun.awt.SunToolkit.postEvent (jssun.awt.SunToolkit.targetToAppContext (e.getSource ()), pe); -}, "java.awt.AWTEvent"); -c$.flushPendingEvents = Clazz_defineMethod (c$, "flushPendingEvents", -function () { -var appContext = jssun.awt.AppContext.getAppContext (); -var postEventQueue = appContext.get ("PostEventQueue"); -if (postEventQueue != null) { -postEventQueue.flush (); -}}); -c$.isPostEventQueueEmpty = Clazz_defineMethod (c$, "isPostEventQueueEmpty", -function () { -var appContext = jssun.awt.AppContext.getAppContext (); -var postEventQueue = appContext.get ("PostEventQueue"); -return (postEventQueue == null || postEventQueue.noEvents ()); -}); -c$.executeOnEventHandlerThread = Clazz_defineMethod (c$, "executeOnEventHandlerThread", -function (target, runnable) { -jssun.awt.SunToolkit.executeOnEventHandlerThread ( new jssun.awt.PeerEvent (target, runnable, 1)); -}, "~O,Runnable"); -c$.executeOnEventHandlerThread = Clazz_defineMethod (c$, "executeOnEventHandlerThread", -function (target, runnable, when) { -jssun.awt.SunToolkit.executeOnEventHandlerThread (((Clazz_isClassDefined ("jssun.awt.SunToolkit$2") ? 0 : jssun.awt.SunToolkit.$SunToolkit$2$ ()), Clazz_innerTypeInstance (jssun.awt.SunToolkit$2, this, Clazz_cloneFinals ("when", when), target, runnable, 1))); -}, "~O,Runnable,~N"); -c$.executeOnEventHandlerThread = Clazz_defineMethod (c$, "executeOnEventHandlerThread", -function (peerEvent) { -jssun.awt.SunToolkit.postEvent (jssun.awt.SunToolkit.targetToAppContext (peerEvent.getSource ()), peerEvent); -}, "jssun.awt.PeerEvent"); -c$.invokeLaterOnAppContext = Clazz_defineMethod (c$, "invokeLaterOnAppContext", -function (appContext, dispatcher) { -jssun.awt.SunToolkit.postEvent (appContext, new jssun.awt.PeerEvent (java.awt.Toolkit.getDefaultToolkit (), dispatcher, 1)); -}, "jssun.awt.AppContext,Runnable"); -c$.isDispatchThreadForAppContext = Clazz_defineMethod (c$, "isDispatchThreadForAppContext", -function (target) { -var appContext = jssun.awt.SunToolkit.targetToAppContext (target); -var eq = appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY); -var next = jssun.awt.AWTAccessor.getEventQueueAccessor ().getNextQueue (eq); -while (next != null) { -eq = next; -next = jssun.awt.AWTAccessor.getEventQueueAccessor ().getNextQueue (eq); -} -return (Thread.currentThread () === jssun.awt.AWTAccessor.getEventQueueAccessor ().getDispatchThread (eq)); -}, "~O"); -Clazz_overrideMethod (c$, "getScreenSize", -function () { -return new java.awt.Dimension (this.getScreenWidth (), this.getScreenHeight ()); -}); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -return jssun.font.FontDesignMetrics.getMetrics (font); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "getFontList", -function () { -var hardwiredFontList = Clazz_newArray (-1, ["Dialog", "SansSerif", "Serif", "Monospaced", "DialogInput"]); -return hardwiredFontList; -}); -Clazz_overrideMethod (c$, "createPanel", -function (target) { -return this.createComponent (target); -}, "java.awt.Panel"); -Clazz_defineMethod (c$, "disableBackgroundErase", -function (component) { -this.disableBackgroundEraseImpl (component); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "disableBackgroundEraseImpl", - function (component) { -jssun.awt.AWTAccessor.getComponentAccessor ().setBackgroundEraseDisabled (component, true); -}, "java.awt.Component"); -c$.getSunAwtNoerasebackground = Clazz_defineMethod (c$, "getSunAwtNoerasebackground", -function () { -return false; -}); -c$.getSunAwtErasebackgroundonresize = Clazz_defineMethod (c$, "getSunAwtErasebackgroundonresize", -function () { -return true; -}); -Clazz_defineMethod (c$, "setOverrideRedirect", -function (target) { -}, "java.awt.Window"); -c$.getImageFromHash = Clazz_defineMethod (c$, "getImageFromHash", -function (tk, url) { -var img = jssun.awt.SunToolkit.imgCache.get (url); -if (img == null) { -try { -img = tk.createImage (url); -jssun.awt.SunToolkit.imgCache.put (url, img); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -} else { -throw e; -} -} -}return img; -}, "java.awt.Toolkit,java.net.URL"); -c$.getImageFromHash = Clazz_defineMethod (c$, "getImageFromHash", -function (tk, filename) { -var img = jssun.awt.SunToolkit.imgCache.get (filename); -if (img == null) { -try { -tk.createImage (filename); -jssun.awt.SunToolkit.imgCache.put (filename, img); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -} else { -throw e; -} -} -}return img; -}, "java.awt.Toolkit,~S"); -Clazz_defineMethod (c$, "getImage", -function (filename) { -return jssun.awt.SunToolkit.getImageFromHash (this, filename); -}, "~S"); -Clazz_defineMethod (c$, "getImage", -function (url) { -return jssun.awt.SunToolkit.getImageFromHash (this, url); -}, "java.net.URL"); -Clazz_overrideMethod (c$, "checkImage", -function (img, w, h, o) { -return 0; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "prepareImage", -function (img, w, h, o) { -if (w == 0 || h == 0) { -return true; -}return true; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "getSystemEventQueueImpl", -function () { -return jssun.awt.SunToolkit.getSystemEventQueueImplPP (); -}); -c$.getSystemEventQueueImplPP = Clazz_defineMethod (c$, "getSystemEventQueueImplPP", -function () { -return jssun.awt.SunToolkit.getSystemEventQueueImplPP (jssun.awt.AppContext.getAppContext ()); -}); -c$.getSystemEventQueueImplPP = Clazz_defineMethod (c$, "getSystemEventQueueImplPP", -function (appContext) { -var theEventQueue = appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY); -return theEventQueue; -}, "jssun.awt.AppContext"); -c$.getNativeContainer = Clazz_defineMethod (c$, "getNativeContainer", -function (c) { -return java.awt.Toolkit.getNativeContainer (c); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "enableInputMethodsForTextComponent", -function () { -return false; -}); -c$.getStartupLocale = Clazz_defineMethod (c$, "getStartupLocale", -function () { -if (jssun.awt.SunToolkit.startupLocale == null) { -{ -}}return jssun.awt.SunToolkit.startupLocale; -}); -Clazz_defineMethod (c$, "getDefaultKeyboardLocale", -function () { -return jssun.awt.SunToolkit.getStartupLocale (); -}); -c$.setDataTransfererClassName = Clazz_defineMethod (c$, "setDataTransfererClassName", -function (className) { -jssun.awt.SunToolkit.dataTransfererClassName = className; -}, "~S"); -c$.getDataTransfererClassName = Clazz_defineMethod (c$, "getDataTransfererClassName", -function () { -if (jssun.awt.SunToolkit.dataTransfererClassName == null) { -java.awt.Toolkit.getDefaultToolkit (); -}return jssun.awt.SunToolkit.dataTransfererClassName; -}); -Clazz_overrideMethod (c$, "getWindowClosingListener", -function () { -return this.windowClosingListener; -}); -Clazz_overrideMethod (c$, "setWindowClosingListener", -function (wcl) { -this.windowClosingListener = wcl; -}, "jssun.awt.WindowClosingListener"); -Clazz_defineMethod (c$, "windowClosingNotify", -function (event) { -if (this.windowClosingListener != null) { -return this.windowClosingListener.windowClosingNotify (event); -} else { -return null; -}}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "windowClosingDelivered", -function (event) { -if (this.windowClosingListener != null) { -return this.windowClosingListener.windowClosingDelivered (event); -} else { -return null; -}}, "java.awt.event.WindowEvent"); -c$.isModalExcluded = Clazz_defineMethod (c$, "isModalExcluded", -function (window) { -return true; -}, "java.awt.Window"); -c$.isLightweightOrUnknown = Clazz_defineMethod (c$, "isLightweightOrUnknown", -function (comp) { -if (comp.isLightweight () || !(Clazz_instanceOf (java.awt.Toolkit.getDefaultToolkit (), jssun.awt.SunToolkit))) { -return true; -}return !(Clazz_instanceOf (comp, java.awt.Panel) || Clazz_instanceOf (comp, java.awt.Window)); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getDesktopAAHints", -function () { -return null; -}); -c$.getContainingWindow = Clazz_defineMethod (c$, "getContainingWindow", -function (comp) { -while (comp != null && !(Clazz_instanceOf (comp, java.awt.Window))) { -comp = comp.getParent (); -} -return comp; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "isNativeGTKAvailable", -function () { -return false; -}); -Clazz_defineMethod (c$, "isWindowOpacitySupported", -function () { -return false; -}); -Clazz_defineMethod (c$, "isWindowShapingSupported", -function () { -return false; -}); -Clazz_defineMethod (c$, "isWindowTranslucencySupported", -function () { -return false; -}); -Clazz_defineMethod (c$, "isTranslucencyCapable", -function (gc) { -return false; -}, "java.awt.GraphicsConfiguration"); -Clazz_defineMethod (c$, "needUpdateWindow", -function () { -return false; -}); -c$.$SunToolkit$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (jssun.awt, "SunToolkit$1", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -jssun.awt.AWTAccessor.getAWTEventAccessor ().setPosted (this.f$.e); -(this.f$.e.getSource ()).dispatchEvent (this.f$.e); -}); -c$ = Clazz_p0p (); -}; -c$.$SunToolkit$2$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (jssun.awt, "SunToolkit$2", jssun.awt.PeerEvent); -Clazz_overrideMethod (c$, "getWhen", -function () { -return this.f$.when; -}); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"GRAB_EVENT_MASK", 0x80000000, -"POST_EVENT_QUEUE_KEY", "PostEventQueue"); -c$.appContextMap = c$.prototype.appContextMap = new java.util.HashMap (); -c$.imgCache = c$.prototype.imgCache = new java.util.HashMap (); -Clazz_defineStatics (c$, -"startupLocale", null, -"dataTransfererClassName", null, -"DESKTOPFONTHINTS", "awt.font.desktophints"); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "Conditional"); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.PaintEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.updateRect = null; -Clazz_instantialize (this, arguments); -}, java.awt.event, "PaintEvent", java.awt.event.ComponentEvent); -Clazz_makeConstructor (c$, -function (source, id, updateRect) { -Clazz_superConstructor (this, java.awt.event.PaintEvent, [source, id]); -this.updateRect = updateRect; -}, "java.awt.Component,~N,java.awt.Rectangle"); -Clazz_defineMethod (c$, "getUpdateRect", -function () { -return this.updateRect; -}); -Clazz_defineMethod (c$, "setUpdateRect", -function (updateRect) { -this.updateRect = updateRect; -}, "java.awt.Rectangle"); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 800: -typeStr = "PAINT"; -break; -case 801: -typeStr = "UPDATE"; -break; -default: -typeStr = "unknown type"; -} -return typeStr + ",updateRect=" + (this.updateRect != null ? this.updateRect.toString () : "null"); -}); -Clazz_defineStatics (c$, -"PAINT_FIRST", 800, -"PAINT_LAST", 801, -"PAINT", 800, -"UPDATE", 801); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent", "$.EventFilter", "swingjs.JSThread", "java.util.Vector"], "java.awt.EventDispatchThread", ["java.lang.Error", "$.RuntimeException", "$.Thread", "java.awt.Component", "$.Container", "$.ModalEventFilter", "$.Window", "jssun.awt.AWTAutoShutdown", "$.ModalExclude", "$.SunToolkit", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.theQueue = null; -this.eventFilters = null; -this.modalFiltersCount = 0; -this.filter = null; -this.cond = null; -this.id = 0; -this.doDispatch = true; -if (!Clazz_isClassDefined ("java.awt.EventDispatchThread.StopDispatchEvent")) { -java.awt.EventDispatchThread.$EventDispatchThread$StopDispatchEvent$ (); -} -Clazz_instantialize (this, arguments); -}, java.awt, "EventDispatchThread", swingjs.JSThread); -Clazz_prepareFields (c$, function () { -this.eventFilters = new java.util.Vector (); -}); -Clazz_makeConstructor (c$, -function (group, name, queue) { -Clazz_superConstructor (this, java.awt.EventDispatchThread, [group, name]); -this.theQueue = queue; -}, "ThreadGroup,~S,java.awt.EventQueue"); -Clazz_defineMethod (c$, "stopDispatchingImpl", -function (wait) { -var stopEvent = Clazz_innerTypeInstance (java.awt.EventDispatchThread.StopDispatchEvent, this, null); -if (Thread.currentThread () !== this) { -this.theQueue.postEventPrivate (stopEvent); -if (wait) { -try { -this.join (); -} catch (e) { -if (Clazz_exceptionOf (e, InterruptedException)) { -} else { -throw e; -} -} -}} else { -stopEvent.dispatch (); -}{ -if (this.theQueue.getDispatchThread () === this) { -this.theQueue.detachDispatchThread (); -}}}, "~B"); -Clazz_defineMethod (c$, "stopDispatching", -function () { -this.stopDispatchingImpl (true); -}); -Clazz_defineMethod (c$, "stopDispatchingLater", -function () { -this.stopDispatchingImpl (false); -}); -Clazz_overrideMethod (c$, "run", -function () { -this.pumpEvents (-1, null); -}); -Clazz_defineMethod (c$, "pumpEvents", -function (id, cond) { -this.pumpEventsForHierarchy (id, cond, null); -}, "~N,java.awt.Conditional"); -Clazz_defineMethod (c$, "pumpEventsForHierarchy", -function (id, cond, modalComponent) { -this.pumpEventsForFilter (id, cond, new java.awt.EventDispatchThread.HierarchyEventFilter (modalComponent)); -}, "~N,java.awt.Conditional,java.awt.Component"); -Clazz_defineMethod (c$, "pumpEventsForFilter", -function (id, cond, filter) { -this.filter = filter; -this.cond = cond; -this.id = id; -this.run1 (0); -}, "~N,java.awt.Conditional,java.awt.EventFilter"); -Clazz_overrideMethod (c$, "run1", -function (mode) { -try { -while (true) switch (mode) { -case 0: -this.addEventFilter (this.filter); -mode = 1; -case 1: -if (!this.doDispatch || this.cond != null && !this.cond.evaluate () || this.isInterrupted ()) { -this.doDispatch = false; -return; -}var myid = this.id; -var r = ((Clazz_isClassDefined ("java.awt.EventDispatchThread$1") ? 0 : java.awt.EventDispatchThread.$EventDispatchThread$1$ ()), Clazz_innerTypeInstance (java.awt.EventDispatchThread$1, this, Clazz_cloneFinals ("myid", myid))); -this.dispatchAndReturn (r, mode); -if (this.isJS) return; -break; -case 2: -this.doDispatch = false; -return; -} - -} finally { -if (!this.doDispatch) this.finish (); -} -}, "~N"); -Clazz_defineMethod (c$, "dispatchAndReturn", -function (r, mode) { -var f = null; -var me = this; -{ -f = function() {r.run();me.run1(mode) -}; -}swingjs.JSToolkit.setTimeout (f, 0, 0); -}, "Runnable,~N"); -Clazz_defineMethod (c$, "finish", - function () { -this.doDispatch = false; -this.removeEventFilter (this.filter); -{ -if (this.theQueue.getDispatchThread () === this) { -this.theQueue.detachDispatchThread (); -}if (this.theQueue.peekEvent () != null || !jssun.awt.SunToolkit.isPostEventQueueEmpty ()) { -this.theQueue.initDispatchThread (); -}jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadFree (this); -}}); -Clazz_defineMethod (c$, "addEventFilter", -function (filter) { -{ -if (!this.eventFilters.contains (filter)) { -if (Clazz_instanceOf (filter, java.awt.ModalEventFilter)) { -var newFilter = filter; -var k = 0; -for (k = 0; k < this.eventFilters.size (); k++) { -var f = this.eventFilters.get (k); -if (Clazz_instanceOf (f, java.awt.ModalEventFilter)) { -var cf = f; -if (cf.compareTo (newFilter) > 0) { -break; -}}} -this.eventFilters.add (k, filter); -this.modalFiltersCount++; -} else { -this.eventFilters.add (filter); -}}}}, "java.awt.EventFilter"); -Clazz_defineMethod (c$, "removeEventFilter", -function (filter) { -{ -if (this.eventFilters.contains (filter)) { -if (Clazz_instanceOf (filter, java.awt.ModalEventFilter)) { -this.modalFiltersCount--; -}this.eventFilters.remove (filter); -}}}, "java.awt.EventFilter"); -Clazz_defineMethod (c$, "pumpOneEventForFilters", -function (id) { -try { -var event; -var eventOK; -do { -event = (id == -1) ? this.theQueue.getNextEvent () : this.theQueue.getNextEventForID (id); -if (event == null) return (this.doDispatch = false); -eventOK = true; -{ -for (var i = this.eventFilters.size () - 1; i >= 0; i--) { -var f = this.eventFilters.get (i); -var accept = f.acceptEvent (event); -if (accept === java.awt.EventFilter.FilterAction.REJECT) { -eventOK = false; -break; -} else if (accept === java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY) { -break; -}} -}if (!eventOK) { -event.consume (); -}} while (eventOK == false); -this.theQueue.dispatchEvent (event); -return this.doDispatch = true; -} catch (e$$) { -if (Clazz_exceptionOf (e$$, ThreadDeath)) { -var death = e$$; -{ -return this.doDispatch = false; -} -} else if (Clazz_exceptionOf (e$$, InterruptedException)) { -var interruptedException = e$$; -{ -return this.doDispatch = false; -} -} else { -var e = e$$; -{ -this.processException (e, this.modalFiltersCount > 0); -} -} -} -return this.doDispatch = true; -}, "~N"); -Clazz_defineMethod (c$, "processException", - function (e, isModal) { -if (!this.handleException (e)) { -if (isModal) { -System.err.println ("Exception occurred during event dispatching:"); -e.printStackTrace (); -} else if (Clazz_instanceOf (e, RuntimeException)) { -throw e; -} else if (Clazz_instanceOf (e, Error)) { -throw e; -}}}, "Throwable,~B"); -Clazz_defineMethod (c$, "handleException", - function (thrown) { -return false; -}, "Throwable"); -Clazz_defineMethod (c$, "isDispatching", -function (eq) { -return this.theQueue.equals (eq); -}, "java.awt.EventQueue"); -Clazz_defineMethod (c$, "getEventQueue", -function () { -return this.theQueue; -}); -c$.$EventDispatchThread$StopDispatchEvent$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, java.awt.EventDispatchThread, "StopDispatchEvent", java.awt.AWTEvent, java.awt.ActiveEvent); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, java.awt.EventDispatchThread.StopDispatchEvent, [this.b$["java.awt.EventDispatchThread"], 0]); -}); -Clazz_overrideMethod (c$, "dispatch", -function () { -this.b$["java.awt.EventDispatchThread"].doDispatch = false; -}); -c$ = Clazz_p0p (); -}; -c$.$EventDispatchThread$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (java.awt, "EventDispatchThread$1", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -this.b$["java.awt.EventDispatchThread"].pumpOneEventForFilters (this.f$.myid); -}); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.modalComponent = null; -Clazz_instantialize (this, arguments); -}, java.awt.EventDispatchThread, "HierarchyEventFilter", null, java.awt.EventFilter); -Clazz_makeConstructor (c$, -function (a) { -this.modalComponent = a; -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "acceptEvent", -function (a) { -if (this.modalComponent != null) { -var b = a.getID (); -var c = (b >= 500) && (b <= 507); -var d = (b >= 1001) && (b <= 1001); -var e = (b == 201); -if (java.awt.Component.isInstanceOf (this.modalComponent, "javax.swing.JInternalFrame")) { -return e ? java.awt.EventFilter.FilterAction.REJECT : java.awt.EventFilter.FilterAction.ACCEPT; -}if (c || d || e) { -var f = a.getSource (); -if (Clazz_instanceOf (f, jssun.awt.ModalExclude)) { -return java.awt.EventFilter.FilterAction.ACCEPT; -} else if (Clazz_instanceOf (f, java.awt.Component)) { -var g = f; -var h = false; -if (Clazz_instanceOf (this.modalComponent, java.awt.Container)) { -while (g !== this.modalComponent && g != null) { -if ((Clazz_instanceOf (g, java.awt.Window)) && (jssun.awt.SunToolkit.isModalExcluded (g))) { -h = true; -break; -}g = g.getParent (); -} -}if (!h && (g !== this.modalComponent)) { -return java.awt.EventFilter.FilterAction.REJECT; -}}}}return java.awt.EventFilter.FilterAction.ACCEPT; -}, "java.awt.AWTEvent"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"ANY_EVENT", -1); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.lang.Enum"], "java.awt.EventFilter", null, function () { -Clazz_declareInterface (java.awt, "EventFilter"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.EventFilter, "FilterAction", Enum); -Clazz_defineEnumConstant (c$, "ACCEPT", 0, []); -Clazz_defineEnumConstant (c$, "REJECT", 1, []); -Clazz_defineEnumConstant (c$, "ACCEPT_IMMEDIATELY", 2, []); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.EventFilter"], "java.awt.ModalEventFilter", ["java.awt.Component", "$.Dialog", "$.Window", "jssun.awt.ModalExclude"], function () { -c$ = Clazz_decorateAsClass (function () { -this.modalDialog = null; -this.disabled = false; -Clazz_instantialize (this, arguments); -}, java.awt, "ModalEventFilter", null, java.awt.EventFilter); -Clazz_makeConstructor (c$, -function (modalDialog) { -this.modalDialog = modalDialog; -this.disabled = false; -}, "java.awt.Dialog"); -Clazz_defineMethod (c$, "getModalDialog", -function () { -return this.modalDialog; -}); -Clazz_overrideMethod (c$, "acceptEvent", -function (event) { -if (this.disabled || !this.modalDialog.isVisible ()) { -return java.awt.EventFilter.FilterAction.ACCEPT; -}var eventID = event.getID (); -if ((eventID >= 500 && eventID <= 507) || (eventID >= 1001 && eventID <= 1001) || eventID == 201) { -var o = event.getSource (); -if (Clazz_instanceOf (o, jssun.awt.ModalExclude)) { -} else if (Clazz_instanceOf (o, java.awt.Component)) { -var c = o; -while ((c != null) && !(Clazz_instanceOf (c, java.awt.Window))) { -c = c.getParent_NoClientCode (); -} -if (c != null) { -return this.acceptWindow (c); -}}}return java.awt.EventFilter.FilterAction.ACCEPT; -}, "java.awt.AWTEvent"); -Clazz_defineMethod (c$, "disable", -function () { -this.disabled = true; -}); -Clazz_defineMethod (c$, "compareTo", -function (another) { -var anotherDialog = another.getModalDialog (); -var c = this.modalDialog; -while (c != null) { -if (c === anotherDialog) { -return 1; -}c = c.getParent_NoClientCode (); -} -c = anotherDialog; -while (c != null) { -if (c === this.modalDialog) { -return -1; -}c = c.getParent_NoClientCode (); -} -var blocker = this.modalDialog.getModalBlocker (); -while (blocker != null) { -if (blocker === anotherDialog) { -return -1; -}blocker = blocker.getModalBlocker (); -} -blocker = anotherDialog.getModalBlocker (); -while (blocker != null) { -if (blocker === this.modalDialog) { -return 1; -}blocker = blocker.getModalBlocker (); -} -return this.modalDialog.getModalityType ().compareTo (anotherDialog.getModalityType ()); -}, "java.awt.ModalEventFilter"); -c$.createFilterForDialog = Clazz_defineMethod (c$, "createFilterForDialog", -function (modalDialog) { -switch (modalDialog.getModalityType ()) { -case java.awt.Dialog.ModalityType.DOCUMENT_MODAL: -return new java.awt.ModalEventFilter.DocumentModalEventFilter (modalDialog); -case java.awt.Dialog.ModalityType.APPLICATION_MODAL: -return new java.awt.ModalEventFilter.ApplicationModalEventFilter (modalDialog); -case java.awt.Dialog.ModalityType.TOOLKIT_MODAL: -return new java.awt.ModalEventFilter.ToolkitModalEventFilter (modalDialog); -} -return null; -}, "java.awt.Dialog"); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.appContext = null; -Clazz_instantialize (this, arguments); -}, java.awt.ModalEventFilter, "ToolkitModalEventFilter", java.awt.ModalEventFilter); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.awt.ModalEventFilter.ToolkitModalEventFilter, [a]); -this.appContext = a.appContext; -}, "java.awt.Dialog"); -Clazz_overrideMethod (c$, "acceptWindow", -function (a) { -if (a.isModalExcluded (java.awt.Dialog.ModalExclusionType.TOOLKIT_EXCLUDE)) { -return java.awt.EventFilter.FilterAction.ACCEPT; -}if (a.appContext !== this.appContext) { -return java.awt.EventFilter.FilterAction.REJECT; -}while (a != null) { -if (a === this.modalDialog) { -return java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY; -}a = a.getOwner (); -} -return java.awt.EventFilter.FilterAction.REJECT; -}, "java.awt.Window"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.appContext = null; -Clazz_instantialize (this, arguments); -}, java.awt.ModalEventFilter, "ApplicationModalEventFilter", java.awt.ModalEventFilter); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.awt.ModalEventFilter.ApplicationModalEventFilter, [a]); -this.appContext = a.appContext; -}, "java.awt.Dialog"); -Clazz_overrideMethod (c$, "acceptWindow", -function (a) { -if (a.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { -return java.awt.EventFilter.FilterAction.ACCEPT; -}if (a.appContext === this.appContext) { -while (a != null) { -if (a === this.modalDialog) { -return java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY; -}a = a.getOwner (); -} -return java.awt.EventFilter.FilterAction.REJECT; -}return java.awt.EventFilter.FilterAction.ACCEPT; -}, "java.awt.Window"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.documentRoot = null; -Clazz_instantialize (this, arguments); -}, java.awt.ModalEventFilter, "DocumentModalEventFilter", java.awt.ModalEventFilter); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, java.awt.ModalEventFilter.DocumentModalEventFilter, [a]); -this.documentRoot = a.getDocumentRoot (); -}, "java.awt.Dialog"); -Clazz_overrideMethod (c$, "acceptWindow", -function (a) { -if (a.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { -var b = this.modalDialog.getOwner (); -while (b != null) { -if (b === a) { -return java.awt.EventFilter.FilterAction.REJECT; -}b = b.getOwner (); -} -return java.awt.EventFilter.FilterAction.ACCEPT; -}while (a != null) { -if (a === this.modalDialog) { -return java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY; -}if (a === this.documentRoot) { -return java.awt.EventFilter.FilterAction.REJECT; -}a = a.getOwner (); -} -return java.awt.EventFilter.FilterAction.ACCEPT; -}, "java.awt.Window"); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("java.awt.peer"); -Clazz_load (["java.awt.peer.ComponentPeer"], "java.awt.peer.CanvasPeer", null, function () { -Clazz_declareInterface (java.awt.peer, "CanvasPeer", java.awt.peer.ComponentPeer); -}); -Clazz_declarePackage ("java.awt.peer"); -c$ = Clazz_declareInterface (java.awt.peer, "ComponentPeer"); -Clazz_defineStatics (c$, -"SET_LOCATION", 1, -"SET_SIZE", 2, -"SET_BOUNDS", 3, -"SET_CLIENT_SIZE", 4, -"RESET_OPERATION", 5, -"NO_EMBEDDED_CHECK", (16384), -"DEFAULT_OPERATION", 3); -Clazz_declarePackage ("java.awt.peer"); -Clazz_load (["java.awt.peer.ComponentPeer"], "java.awt.peer.ContainerPeer", null, function () { -Clazz_declareInterface (java.awt.peer, "ContainerPeer", java.awt.peer.ComponentPeer); -}); -Clazz_declarePackage ("java.awt.peer"); -Clazz_load (["java.awt.peer.WindowPeer"], "java.awt.peer.FramePeer", null, function () { -Clazz_declareInterface (java.awt.peer, "FramePeer", java.awt.peer.WindowPeer); -}); -Clazz_declarePackage ("java.awt.peer"); -Clazz_load (["java.awt.peer.ComponentPeer"], "java.awt.peer.LightweightPeer", null, function () { -Clazz_declareInterface (java.awt.peer, "LightweightPeer", java.awt.peer.ComponentPeer); -}); -Clazz_declarePackage ("java.awt.peer"); -Clazz_load (["java.awt.peer.ContainerPeer"], "java.awt.peer.PanelPeer", null, function () { -Clazz_declareInterface (java.awt.peer, "PanelPeer", java.awt.peer.ContainerPeer); -}); -Clazz_declarePackage ("java.awt.peer"); -Clazz_load (["java.awt.peer.ContainerPeer"], "java.awt.peer.WindowPeer", null, function () { -Clazz_declareInterface (java.awt.peer, "WindowPeer", java.awt.peer.ContainerPeer); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent"], "java.awt.SentEvent", ["java.awt.Toolkit", "jssun.awt.SunToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.$dispatched = false; -this.nested = null; -this.toNotify = null; -Clazz_instantialize (this, arguments); -}, java.awt, "SentEvent", java.awt.AWTEvent, java.awt.ActiveEvent); -Clazz_makeConstructor (c$, -function () { -this.construct (null); -}); -Clazz_makeConstructor (c$, -function (nested) { -this.construct (nested, null); -}, "java.awt.AWTEvent"); -Clazz_makeConstructor (c$, -function (nested, toNotify) { -Clazz_superConstructor (this, java.awt.SentEvent, [(nested != null) ? nested.getSource () : java.awt.Toolkit.getDefaultToolkit (), 1007]); -this.nested = nested; -this.toNotify = toNotify; -}, "java.awt.AWTEvent,jssun.awt.AppContext"); -Clazz_overrideMethod (c$, "dispatch", -function () { -try { -if (this.nested != null) { -java.awt.Toolkit.getEventQueue ().dispatchEvent (this.nested); -}} finally { -this.$dispatched = true; -if (this.toNotify != null) { -jssun.awt.SunToolkit.postEvent (this.toNotify, new java.awt.SentEvent ()); -}{ -this.notifyAll (); -}} -}); -Clazz_defineMethod (c$, "dispose", -function () { -this.$dispatched = true; -if (this.toNotify != null) { -jssun.awt.SunToolkit.postEvent (this.toNotify, new java.awt.SentEvent ()); -}{ -this.notifyAll (); -}}); -Clazz_defineStatics (c$, -"ID", 1007); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent", "java.util.LinkedList"], "java.awt.SequencedEvent", ["java.lang.Thread", "java.awt.Component", "$.Conditional", "$.EventQueue", "$.SentEvent", "$.Toolkit", "jssun.awt.AppContext", "$.SunToolkit", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.nested = null; -this.appContext = null; -this.disposed = false; -Clazz_instantialize (this, arguments); -}, java.awt, "SequencedEvent", java.awt.AWTEvent, java.awt.ActiveEvent); -Clazz_makeConstructor (c$, -function (nested) { -Clazz_superConstructor (this, java.awt.SequencedEvent, [nested.getSource (), 1006]); -this.nested = nested; -{ -java.awt.SequencedEvent.list.add (this); -}}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "dispatch", -function () { -try { -this.appContext = jssun.awt.AppContext.getAppContext (); -if (java.awt.SequencedEvent.getFirst () !== this) { -if (java.awt.EventQueue.isDispatchThread ()) { -var edt = Thread.currentThread (); -edt.pumpEvents (1007, ((Clazz_isClassDefined ("java.awt.SequencedEvent$1") ? 0 : java.awt.SequencedEvent.$SequencedEvent$1$ ()), Clazz_innerTypeInstance (java.awt.SequencedEvent$1, this, null))); -} else { -while (!this.isFirstOrDisposed ()) { -{ -try { -swingjs.JSToolkit.warn ("Cannot wait in SequenceEvent"); -java.awt.SequencedEvent.wait (1000); -} catch (e) { -if (Clazz_exceptionOf (e, InterruptedException)) { -break; -} else { -throw e; -} -} -}} -}}if (!this.disposed) { -java.awt.Toolkit.getEventQueue ().dispatchEvent (this.nested); -}} finally { -this.dispose (); -} -}); -c$.isOwnerAppContextDisposed = Clazz_defineMethod (c$, "isOwnerAppContextDisposed", - function (se) { -if (se != null) { -var target = se.nested.getSource (); -if (Clazz_instanceOf (target, java.awt.Component)) { -return (target).appContext.isDisposed (); -}}return false; -}, "java.awt.SequencedEvent"); -Clazz_defineMethod (c$, "isFirstOrDisposed", -function () { -if (this.disposed) { -return true; -}return this === java.awt.SequencedEvent.getFirstWithContext () || this.disposed; -}); -c$.getFirst = Clazz_defineMethod (c$, "getFirst", - function () { -return java.awt.SequencedEvent.list.getFirst (); -}); -c$.getFirstWithContext = Clazz_defineMethod (c$, "getFirstWithContext", - function () { -var first = java.awt.SequencedEvent.getFirst (); -while (java.awt.SequencedEvent.isOwnerAppContextDisposed (first)) { -first.dispose (); -first = java.awt.SequencedEvent.getFirst (); -} -return first; -}); -Clazz_defineMethod (c$, "dispose", -function () { -{ -if (this.disposed) { -return; -}this.disposed = true; -}if (this.appContext != null) { -jssun.awt.SunToolkit.postEvent (this.appContext, new java.awt.SentEvent ()); -}var next = null; -{ -java.awt.SequencedEvent.notifyAll (); -if (java.awt.SequencedEvent.list.getFirst () === this) { -java.awt.SequencedEvent.list.removeFirst (); -if (!java.awt.SequencedEvent.list.isEmpty ()) { -next = java.awt.SequencedEvent.list.getFirst (); -}} else { -java.awt.SequencedEvent.list.remove (this); -}}if (next != null && next.appContext != null) { -jssun.awt.SunToolkit.postEvent (next.appContext, new java.awt.SentEvent ()); -}}); -c$.$SequencedEvent$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (java.awt, "SequencedEvent$1", null, java.awt.Conditional); -Clazz_overrideMethod (c$, "evaluate", -function () { -return !this.b$["java.awt.SequencedEvent"].isFirstOrDisposed (); -}); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"ID", 1006); -c$.list = c$.prototype.list = new java.util.LinkedList (); -}); -Clazz_load(["java.util.AbstractList"],"java.util.AbstractSequentialList",["java.lang.IndexOutOfBoundsException"],function(){ -c$=Clazz_declareType(java.util,"AbstractSequentialList",java.util.AbstractList); -Clazz_defineMethod(c$,"add", -function(location,object){ -this.listIterator(location).add(object); -},"~N,~O"); -Clazz_defineMethod(c$,"addAll", -function(location,collection){ -var it=this.listIterator(location); -var colIt=collection.iterator(); -var next=it.nextIndex(); -while(colIt.hasNext()){ -it.add(colIt.next()); -it.previous(); -} -return next!=it.nextIndex(); -},"~N,java.util.Collection"); -Clazz_overrideMethod(c$,"get", -function(location){ -try{ -return this.listIterator(location).next(); -}catch(e){ -if(Clazz_instanceOf(e,java.util.NoSuchElementException)){ -throw new IndexOutOfBoundsException(); -}else{ -throw e; -} -} -},"~N"); -Clazz_overrideMethod(c$,"iterator", -function(){ -return this.listIterator(0); -}); -Clazz_defineMethod(c$,"remove", -function(location){ -try{ -var it=this.listIterator(location); -var result=it.next(); -it.remove(); -return result; -}catch(e){ -if(Clazz_instanceOf(e,java.util.NoSuchElementException)){ -throw new IndexOutOfBoundsException(); -}else{ -throw e; -} -} -},"~N"); -Clazz_overrideMethod(c$,"set", -function(location,object){ -var it=this.listIterator(location); -var result=it.next(); -it.set(object); -return result; -},"~N,~O"); -}); -Clazz_load(["java.util.AbstractSequentialList","$.List","$.ListIterator","$.Queue"],"java.util.LinkedList",["java.lang.IllegalStateException","$.IndexOutOfBoundsException","java.lang.reflect.Array","java.util.ConcurrentModificationException","$.NoSuchElementException"],function(){ -c$=Clazz_decorateAsClass(function(){ -this.$size=0; -this.voidLink=null; -Clazz_instantialize(this,arguments); -},java.util,"LinkedList",java.util.AbstractSequentialList,[java.util.List,java.util.Queue,Cloneable,java.io.Serializable]); -Clazz_makeConstructor(c$, -function(){ -Clazz_superConstructor(this,java.util.LinkedList,[]); -this.voidLink=new java.util.LinkedList.Link(null,null,null); -this.voidLink.previous=this.voidLink; -this.voidLink.next=this.voidLink; -}); -Clazz_makeConstructor(c$, -function(collection){ -this.construct(); -this.addAll(collection); -},"java.util.Collection"); -Clazz_defineMethod(c$,"add", -function(location,object){ -if(0<=location&&location<=this.$size){ -var link=this.voidLink; -if(location<(Math.floor(this.$size/2))){ -for(var i=0;i<=location;i++){ -link=link.next; -} -}else{ -for(var i=this.$size;i>location;i--){ -link=link.previous; -} -}var previous=link.previous; -var newLink=new java.util.LinkedList.Link(object,previous,link); -previous.next=newLink; -link.previous=newLink; -this.$size++; -this.modCount++; -}else{ -throw new IndexOutOfBoundsException(); -}},"~N,~O"); -Clazz_defineMethod(c$,"add", -function(object){ -var oldLast=this.voidLink.previous; -var newLink=new java.util.LinkedList.Link(object,oldLast,this.voidLink); -this.voidLink.previous=newLink; -oldLast.next=newLink; -this.$size++; -this.modCount++; -return true; -},"~O"); -Clazz_defineMethod(c$,"addAll", -function(location,collection){ -if(location<0||location>this.$size){ -throw new IndexOutOfBoundsException(); -}var adding=collection.size(); -if(adding==0){ -return false; -}var previous=this.voidLink; -if(location<(Math.floor(this.$size/2))){ -for(var i=0;i=location;i--){ -previous=previous.previous; -} -}var next=previous.next; -for(var e,$e=collection.iterator();$e.hasNext()&&((e=$e.next())||true);){ -var newLink=new java.util.LinkedList.Link(e,previous,null); -previous.next=newLink; -previous=newLink; -} -previous.next=next; -next.previous=previous; -this.$size+=adding; -this.modCount++; -return true; -},"~N,java.util.Collection"); -Clazz_defineMethod(c$,"addAll", -function(collection){ -var adding=collection.size(); -if(adding==0){ -return false; -}var previous=this.voidLink.previous; -for(var e,$e=collection.iterator();$e.hasNext()&&((e=$e.next())||true);){ -var newLink=new java.util.LinkedList.Link(e,previous,null); -previous.next=newLink; -previous=newLink; -} -previous.next=this.voidLink; -this.voidLink.previous=previous; -this.$size+=adding; -this.modCount++; -return true; -},"java.util.Collection"); -Clazz_defineMethod(c$,"addFirst", -function(object){ -var oldFirst=this.voidLink.next; -var newLink=new java.util.LinkedList.Link(object,this.voidLink,oldFirst); -this.voidLink.next=newLink; -oldFirst.previous=newLink; -this.$size++; -this.modCount++; -},"~O"); -Clazz_defineMethod(c$,"addLast", -function(object){ -var oldLast=this.voidLink.previous; -var newLink=new java.util.LinkedList.Link(object,oldLast,this.voidLink); -this.voidLink.previous=newLink; -oldLast.next=newLink; -this.$size++; -this.modCount++; -},"~O"); -Clazz_overrideMethod(c$,"clear", -function(){ -if(this.$size>0){ -this.$size=0; -this.voidLink.next=this.voidLink; -this.voidLink.previous=this.voidLink; -this.modCount++; -}}); -Clazz_overrideMethod(c$,"clone", -function(){ -return new java.util.LinkedList(this); -}); -Clazz_overrideMethod(c$,"contains", -function(object){ -var link=this.voidLink.next; -if(object!=null){ -while(link!==this.voidLink){ -if(object.equals(link.data)){ -return true; -}link=link.next; -} -}else{ -while(link!==this.voidLink){ -if(link.data==null){ -return true; -}link=link.next; -} -}return false; -},"~O"); -Clazz_overrideMethod(c$,"get", -function(location){ -if(0<=location&&locationlocation;i--){ -link=link.previous; -} -}return link.data; -}throw new IndexOutOfBoundsException(); -},"~N"); -Clazz_defineMethod(c$,"getFirst", -function(){ -var first=this.voidLink.next; -if(first!==this.voidLink){ -return first.data; -}throw new java.util.NoSuchElementException(); -}); -Clazz_defineMethod(c$,"getLast", -function(){ -var last=this.voidLink.previous; -if(last!==this.voidLink){ -return last.data; -}throw new java.util.NoSuchElementException(); -}); -Clazz_overrideMethod(c$,"indexOf", -function(object){ -var pos=0; -var link=this.voidLink.next; -if(object!=null){ -while(link!==this.voidLink){ -if(object.equals(link.data)){ -return pos; -}link=link.next; -pos++; -} -}else{ -while(link!==this.voidLink){ -if(link.data==null){ -return pos; -}link=link.next; -pos++; -} -}return-1; -},"~O"); -Clazz_overrideMethod(c$,"lastIndexOf", -function(object){ -var pos=this.$size; -var link=this.voidLink.previous; -if(object!=null){ -while(link!==this.voidLink){ -pos--; -if(object.equals(link.data)){ -return pos; -}link=link.previous; -} -}else{ -while(link!==this.voidLink){ -pos--; -if(link.data==null){ -return pos; -}link=link.previous; -} -}return-1; -},"~O"); -Clazz_defineMethod(c$,"listIterator", -function(location){ -return new java.util.LinkedList.LinkIterator(this,location); -},"~N"); -Clazz_defineMethod(c$,"remove", -function(location){ -if(0<=location&&locationlocation;i--){ -link=link.previous; -} -}var previous=link.previous; -var next=link.next; -previous.next=next; -next.previous=previous; -this.$size--; -this.modCount++; -return link.data; -}throw new IndexOutOfBoundsException(); -},"~N"); -Clazz_defineMethod(c$,"remove", -function(object){ -var link=this.voidLink.next; -if(object!=null){ -while(link!==this.voidLink&&!object.equals(link.data)){ -link=link.next; -} -}else{ -while(link!==this.voidLink&&link.data!=null){ -link=link.next; -} -}if(link===this.voidLink){ -return false; -}var next=link.next; -var previous=link.previous; -previous.next=next; -next.previous=previous; -this.$size--; -this.modCount++; -return true; -},"~O"); -Clazz_defineMethod(c$,"removeFirst", -function(){ -var first=this.voidLink.next; -if(first!==this.voidLink){ -var next=first.next; -this.voidLink.next=next; -next.previous=this.voidLink; -this.$size--; -this.modCount++; -return first.data; -}throw new java.util.NoSuchElementException(); -}); -Clazz_defineMethod(c$,"removeLast", -function(){ -var last=this.voidLink.previous; -if(last!==this.voidLink){ -var previous=last.previous; -this.voidLink.previous=previous; -previous.next=this.voidLink; -this.$size--; -this.modCount++; -return last.data; -}throw new java.util.NoSuchElementException(); -}); -Clazz_overrideMethod(c$,"set", -function(location,object){ -if(0<=location&&locationlocation;i--){ -link=link.previous; -} -}var result=link.data; -link.data=object; -return result; -}throw new IndexOutOfBoundsException(); -},"~N,~O"); -Clazz_overrideMethod(c$,"size", -function(){ -return this.$size; -}); -Clazz_overrideMethod(c$,"offer", -function(o){ -this.add(o); -return true; -},"~O"); -Clazz_overrideMethod(c$,"poll", -function(){ -return this.$size==0?null:this.removeFirst(); -}); -Clazz_defineMethod(c$,"remove", -function(){ -return this.removeFirst(); -}); -Clazz_overrideMethod(c$,"peek", -function(){ -var first=this.voidLink.next; -return first===this.voidLink?null:first.data; -}); -Clazz_overrideMethod(c$,"element", -function(){ -return this.getFirst(); -}); -Clazz_defineMethod(c$,"toArray", -function(){ -var index=0; -var contents=new Array(this.$size); -var link=this.voidLink.next; -while(link!==this.voidLink){ -contents[index++]=link.data; -link=link.next; -} -return contents; -}); -Clazz_defineMethod(c$,"toArray", -function(contents){ -var index=0; -if(this.$size>contents.length){ -var ct=contents.getClass().getComponentType(); -contents=java.lang.reflect.Array.newInstance(ct,this.$size); -}var link=this.voidLink.next; -while(link!==this.voidLink){ -contents[index++]=link.data; -link=link.next; -} -if(index=b;this.pos--){ -this.link=this.link.previous; -} -}}else{ -throw new IndexOutOfBoundsException(); -}},"java.util.LinkedList,~N"); -Clazz_overrideMethod(c$,"add", -function(a){ -if(this.expectedModCount==this.list.modCount){ -var b=this.link.next; -var c=new java.util.LinkedList.Link(a,this.link,b); -this.link.next=c; -b.previous=c; -this.link=c; -this.lastLink=null; -this.pos++; -this.expectedModCount++; -this.list.$size++; -this.list.modCount++; -}else{ -throw new java.util.ConcurrentModificationException(); -}},"~O"); -Clazz_overrideMethod(c$,"hasNext", -function(){ -return this.link.next!==this.list.voidLink; -}); -Clazz_overrideMethod(c$,"hasPrevious", -function(){ -return this.link!==this.list.voidLink; -}); -Clazz_overrideMethod(c$,"next", -function(){ -if(this.expectedModCount==this.list.modCount){ -var a=this.link.next; -if(a!==this.list.voidLink){ -this.lastLink=this.link=a; -this.pos++; -return this.link.data; -}throw new java.util.NoSuchElementException(); -}throw new java.util.ConcurrentModificationException(); -}); -Clazz_overrideMethod(c$,"nextIndex", -function(){ -return this.pos+1; -}); -Clazz_overrideMethod(c$,"previous", -function(){ -if(this.expectedModCount==this.list.modCount){ -if(this.link!==this.list.voidLink){ -this.lastLink=this.link; -this.link=this.link.previous; -this.pos--; -return this.lastLink.data; -}throw new java.util.NoSuchElementException(); -}throw new java.util.ConcurrentModificationException(); -}); -Clazz_overrideMethod(c$,"previousIndex", -function(){ -return this.pos; -}); -Clazz_overrideMethod(c$,"remove", -function(){ -if(this.expectedModCount==this.list.modCount){ -if(this.lastLink!=null){ -var a=this.lastLink.next; -var b=this.lastLink.previous; -a.previous=b; -b.next=a; -if(this.lastLink===this.link){ -this.pos--; -}this.link=b; -this.lastLink=null; -this.expectedModCount++; -this.list.$size--; -this.list.modCount++; -}else{ -throw new IllegalStateException(); -}}else{ -throw new java.util.ConcurrentModificationException(); -}}); -Clazz_overrideMethod(c$,"set", -function(a){ -if(this.expectedModCount==this.list.modCount){ -if(this.lastLink!=null){ -this.lastLink.data=a; -}else{ -throw new IllegalStateException(); -}}else{ -throw new java.util.ConcurrentModificationException(); -}},"~O"); -c$=Clazz_p0p(); -}); -Clazz_declarePackage ("JU"); -Clazz_load (["JU.T3"], "JU.V3", null, function () { -c$ = Clazz_declareType (JU, "V3", JU.T3); -Clazz_makeConstructor (c$, -function () { -}); -c$.newV = Clazz_defineMethod (c$, "newV", -function (t) { -return JU.V3.new3 (t.x, t.y, t.z); -}, "JU.T3"); -c$.newVsub = Clazz_defineMethod (c$, "newVsub", -function (t1, t2) { -return JU.V3.new3 (t1.x - t2.x, t1.y - t2.y, t1.z - t2.z); -}, "JU.T3,JU.T3"); -c$.new3 = Clazz_defineMethod (c$, "new3", -function (x, y, z) { -var v = new JU.V3 (); -v.x = x; -v.y = y; -v.z = z; -return v; -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "angle", -function (v1) { -var xx = this.y * v1.z - this.z * v1.y; -var yy = this.z * v1.x - this.x * v1.z; -var zz = this.x * v1.y - this.y * v1.x; -var cross = Math.sqrt (xx * xx + yy * yy + zz * zz); -return Math.abs (Math.atan2 (cross, this.dot (v1))); -}, "JU.V3"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.util.Vector"], "javax.swing.ButtonGroup", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.buttons = null; -this.selection = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "ButtonGroup"); -Clazz_prepareFields (c$, function () { -this.buttons = new java.util.Vector (); -}); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "add", -function (b) { -if (b == null) { -return; -}this.buttons.addElement (b); -if (b.isSelected ()) { -if (this.selection == null) { -this.selection = b.getModel (); -} else { -b.setSelected (false); -}}b.getModel ().setGroup (this); -}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "remove", -function (b) { -if (b == null) { -return; -}this.buttons.removeElement (b); -if (b.getModel () === this.selection) { -this.selection = null; -}b.getModel ().setGroup (null); -}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "clearSelection", -function () { -if (this.selection != null) { -var oldSelection = this.selection; -this.selection = null; -oldSelection.setSelected (false); -}}); -Clazz_defineMethod (c$, "getElements", -function () { -return this.buttons.elements (); -}); -Clazz_defineMethod (c$, "getSelection", -function () { -return this.selection; -}); -Clazz_defineMethod (c$, "setSelected", -function (m, b) { -if (b && m != null && m !== this.selection) { -var oldSelection = this.selection; -this.selection = m; -if (oldSelection != null) { -oldSelection.setSelected (false); -}m.setSelected (true); -}}, "javax.swing.ButtonModel,~B"); -Clazz_defineMethod (c$, "isSelected", -function (m) { -return (m === this.selection); -}, "javax.swing.ButtonModel"); -Clazz_defineMethod (c$, "getButtonCount", -function () { -if (this.buttons == null) { -return 0; -} else { -return this.buttons.size (); -}}); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["jssun.awt.PaintEventDispatcher"], "javax.swing.SwingPaintEventDispatcher", ["javax.swing.RootPaneContainer", "jssun.awt.SunToolkit"], function () { -c$ = Clazz_declareType (javax.swing, "SwingPaintEventDispatcher", jssun.awt.PaintEventDispatcher); -Clazz_overrideMethod (c$, "shouldDoNativeBackgroundErase", -function (c) { -return javax.swing.SwingPaintEventDispatcher.ERASE_BACKGROUND || !(Clazz_instanceOf (c, javax.swing.RootPaneContainer)); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "queueSurfaceDataReplacing", -function (c, r) { -if (Clazz_instanceOf (c, javax.swing.RootPaneContainer)) { -var appContext = jssun.awt.SunToolkit.targetToAppContext (c); -return true; -}return Clazz_superCall (this, javax.swing.SwingPaintEventDispatcher, "queueSurfaceDataReplacing", [c, r]); -}, "java.awt.Component,Runnable"); -Clazz_defineStatics (c$, -"SHOW_FROM_DOUBLE_BUFFER", false, -"ERASE_BACKGROUND", false); -{ -javax.swing.SwingPaintEventDispatcher.SHOW_FROM_DOUBLE_BUFFER = false; -javax.swing.SwingPaintEventDispatcher.ERASE_BACKGROUND = true; -}}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (["java.util.HashSet", "$.IdentityHashMap"], "jssun.awt.AWTAutoShutdown", ["java.awt.AWTEvent"], function () { -c$ = Clazz_decorateAsClass (function () { -this.busyThreadSet = null; -this.toolkitThreadBusy = false; -this.peerMap = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "AWTAutoShutdown", null, Runnable); -Clazz_prepareFields (c$, function () { -this.busyThreadSet = new java.util.HashSet (7); -this.peerMap = new java.util.IdentityHashMap (); -}); -Clazz_makeConstructor (c$, - function () { -}); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function () { -return (jssun.awt.AWTAutoShutdown.theInstance == null ? (jssun.awt.AWTAutoShutdown.theInstance = new jssun.awt.AWTAutoShutdown ()) : jssun.awt.AWTAutoShutdown.theInstance); -}); -c$.notifyToolkitThreadBusy = Clazz_defineMethod (c$, "notifyToolkitThreadBusy", -function () { -jssun.awt.AWTAutoShutdown.getInstance ().setToolkitBusy (true); -}); -c$.notifyToolkitThreadFree = Clazz_defineMethod (c$, "notifyToolkitThreadFree", -function () { -jssun.awt.AWTAutoShutdown.getInstance ().setToolkitBusy (false); -}); -Clazz_defineMethod (c$, "notifyThreadBusy", -function (thread) { -this.busyThreadSet.add (thread); -}, "Thread"); -Clazz_defineMethod (c$, "notifyThreadFree", -function (thread) { -this.busyThreadSet.remove (thread); -}, "Thread"); -Clazz_defineMethod (c$, "notifyPeerMapUpdated", -function () { -if (!this.isReadyToShutdown ()) { -this.activateBlockerThread (); -}}); -Clazz_defineMethod (c$, "isReadyToShutdown", - function () { -return (!this.toolkitThreadBusy && this.peerMap.isEmpty () && this.busyThreadSet.isEmpty ()); -}); -Clazz_defineMethod (c$, "setToolkitBusy", - function (busy) { -if (busy != this.toolkitThreadBusy) { -if (busy != this.toolkitThreadBusy) { -if (busy) { -this.toolkitThreadBusy = busy; -} else { -this.toolkitThreadBusy = busy; -}}}}, "~B"); -Clazz_overrideMethod (c$, "run", -function () { -}); -c$.getShutdownEvent = Clazz_defineMethod (c$, "getShutdownEvent", -function () { -return ((Clazz_isClassDefined ("jssun.awt.AWTAutoShutdown$1") ? 0 : jssun.awt.AWTAutoShutdown.$AWTAutoShutdown$1$ ()), Clazz_innerTypeInstance (jssun.awt.AWTAutoShutdown$1, this, null, jssun.awt.AWTAutoShutdown.getInstance (), 0)); -}); -Clazz_defineMethod (c$, "activateBlockerThread", - function () { -}); -Clazz_defineMethod (c$, "registerPeer", -function (target, peer) { -this.peerMap.put (target, peer); -this.notifyPeerMapUpdated (); -}, "~O,~O"); -Clazz_defineMethod (c$, "unregisterPeer", -function (target, peer) { -if (this.peerMap.get (target) === peer) { -this.peerMap.remove (target); -}}, "~O,~O"); -Clazz_defineMethod (c$, "getPeer", -function (target) { -return this.peerMap.get (target); -}, "~O"); -Clazz_defineMethod (c$, "dumpPeers", -function (aLog) { -aLog.fine ("Mapped peers:"); -for (var key, $key = this.peerMap.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) { -aLog.fine (key + "->" + this.peerMap.get (key)); -} -}, "java.util.logging.Logger"); -c$.$AWTAutoShutdown$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (jssun.awt, "AWTAutoShutdown$1", java.awt.AWTEvent); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"theInstance", null); -}); -Clazz_declarePackage ("jssun.awt"); -c$ = Clazz_decorateAsClass (function () { -this.event = null; -this.next = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "EventQueueItem"); -Clazz_makeConstructor (c$, -function (evt) { -this.event = evt; -}, "java.awt.AWTEvent"); -Clazz_declarePackage ("jssun.awt"); -Clazz_declareInterface (jssun.awt, "ModalExclude"); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (["java.awt.peer.CanvasPeer", "$.LightweightPeer", "$.PanelPeer"], "jssun.awt.NullComponentPeer", ["java.lang.IllegalStateException", "$.UnsupportedOperationException", "java.awt.Dimension", "$.Insets", "$.Point", "$.Rectangle"], function () { -c$ = Clazz_declareType (jssun.awt, "NullComponentPeer", null, [java.awt.peer.LightweightPeer, java.awt.peer.CanvasPeer, java.awt.peer.PanelPeer]); -Clazz_overrideMethod (c$, "isObscured", -function () { -return false; -}); -Clazz_overrideMethod (c$, "canDetermineObscurity", -function () { -return false; -}); -Clazz_overrideMethod (c$, "isFocusable", -function () { -return false; -}); -Clazz_overrideMethod (c$, "setVisible", -function (b) { -}, "~B"); -Clazz_defineMethod (c$, "show", -function () { -}); -Clazz_defineMethod (c$, "hide", -function () { -}); -Clazz_overrideMethod (c$, "setEnabled", -function (b) { -}, "~B"); -Clazz_defineMethod (c$, "enable", -function () { -}); -Clazz_defineMethod (c$, "disable", -function () { -}); -Clazz_overrideMethod (c$, "paint", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "repaint", -function (tm, x, y, width, height) { -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "print", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "setBounds", -function (x, y, width, height, op) { -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "reshape", -function (x, y, width, height) { -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "coalescePaintEvent", -function (e) { -}, "java.awt.event.PaintEvent"); -Clazz_defineMethod (c$, "handleEvent", -function (e) { -return false; -}, "java.awt.Event"); -Clazz_defineMethod (c$, "handleEvent", -function (arg0) { -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "getPreferredSize", -function () { -return new java.awt.Dimension (1, 1); -}); -Clazz_overrideMethod (c$, "getMinimumSize", -function () { -return new java.awt.Dimension (1, 1); -}); -Clazz_overrideMethod (c$, "getToolkit", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getColorModel", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getGraphics", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getGraphicsConfiguration", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -return null; -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "dispose", -function () { -}); -Clazz_overrideMethod (c$, "setForeground", -function (c) { -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setBackground", -function (c) { -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setFont", -function (f) { -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "updateCursorImmediately", -function () { -}); -Clazz_defineMethod (c$, "setCursor", -function (cursor) { -}, "java.awt.Cursor"); -Clazz_overrideMethod (c$, "requestFocus", -function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { -return false; -}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); -Clazz_defineMethod (c$, "createImage", -function (producer) { -return null; -}, "java.awt.image.ImageProducer"); -Clazz_defineMethod (c$, "createImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "prepareImage", -function (img, w, h, o) { -return false; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "checkImage", -function (img, w, h, o) { -return 0; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "preferredSize", -function () { -return this.getPreferredSize (); -}); -Clazz_defineMethod (c$, "minimumSize", -function () { -return this.getMinimumSize (); -}); -Clazz_overrideMethod (c$, "getLocationOnScreen", -function () { -return new java.awt.Point (0, 0); -}); -Clazz_overrideMethod (c$, "getInsets", -function () { -return this.insets (); -}); -Clazz_overrideMethod (c$, "beginValidate", -function () { -}); -Clazz_overrideMethod (c$, "endValidate", -function () { -}); -Clazz_defineMethod (c$, "insets", -function () { -return new java.awt.Insets (0, 0, 0, 0); -}); -Clazz_defineMethod (c$, "isPaintPending", -function () { -return false; -}); -Clazz_overrideMethod (c$, "handlesWheelScrolling", -function () { -return false; -}); -Clazz_overrideMethod (c$, "createVolatileImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "beginLayout", -function () { -}); -Clazz_overrideMethod (c$, "endLayout", -function () { -}); -Clazz_overrideMethod (c$, "getBackBuffer", -function () { -throw new IllegalStateException ("Page-flipping is not allowed on a lightweight component"); -}); -Clazz_overrideMethod (c$, "destroyBuffers", -function () { -}); -Clazz_overrideMethod (c$, "isReparentSupported", -function () { -return false; -}); -Clazz_overrideMethod (c$, "reparent", -function (newNativeParent) { -throw new UnsupportedOperationException (); -}, "java.awt.peer.ContainerPeer"); -Clazz_defineMethod (c$, "restack", -function () { -throw new UnsupportedOperationException (); -}); -Clazz_defineMethod (c$, "isRestackSupported", -function () { -return false; -}); -Clazz_overrideMethod (c$, "layout", -function () { -}); -Clazz_overrideMethod (c$, "getBounds", -function () { -return new java.awt.Rectangle (0, 0, 0, 0); -}); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (null, "jssun.awt.PaintEventDispatcher", ["java.awt.Rectangle", "java.awt.event.PaintEvent"], function () { -c$ = Clazz_declareType (jssun.awt, "PaintEventDispatcher"); -c$.setPaintEventDispatcher = Clazz_defineMethod (c$, "setPaintEventDispatcher", -function (dispatcher) { -{ -jssun.awt.PaintEventDispatcher.dispatcher = dispatcher; -}}, "jssun.awt.PaintEventDispatcher"); -c$.getPaintEventDispatcher = Clazz_defineMethod (c$, "getPaintEventDispatcher", -function () { -{ -if (jssun.awt.PaintEventDispatcher.dispatcher == null) { -jssun.awt.PaintEventDispatcher.dispatcher = new jssun.awt.PaintEventDispatcher (); -}return jssun.awt.PaintEventDispatcher.dispatcher; -}}); -Clazz_defineMethod (c$, "createPaintEvent", -function (target, x, y, w, h) { -return new java.awt.event.PaintEvent (target, 800, new java.awt.Rectangle (x, y, w, h)); -}, "java.awt.Component,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "shouldDoNativeBackgroundErase", -function (c) { -return true; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "queueSurfaceDataReplacing", -function (c, r) { -return false; -}, "java.awt.Component,Runnable"); -Clazz_defineStatics (c$, -"dispatcher", null); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (null, "jssun.awt.PostEventQueue", ["jssun.awt.EventQueueItem", "$.SunToolkit", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.queueHead = null; -this.queueTail = null; -this.eventQueue = null; -Clazz_instantialize (this, arguments); -}, jssun.awt, "PostEventQueue"); -Clazz_makeConstructor (c$, -function (eq) { -this.eventQueue = eq; -}, "java.awt.EventQueue"); -Clazz_defineMethod (c$, "noEvents", -function () { -return this.queueHead == null; -}); -Clazz_defineMethod (c$, "flush", -function () { -if (this.queueHead != null) { -var tempQueue; -{ -tempQueue = this.queueHead; -this.queueHead = this.queueTail = null; -while (tempQueue != null) { -swingjs.JSToolkit.alert ("postevent IS NOT IMPLEMENTED " + tempQueue.event); -this.eventQueue.postEvent (tempQueue.event); -tempQueue = tempQueue.next; -} -}}}); -Clazz_defineMethod (c$, "postEvent", -function (event) { -var item = new jssun.awt.EventQueueItem (event); -{ -if (this.queueHead == null) { -this.queueHead = this.queueTail = item; -} else { -this.queueTail.next = item; -this.queueTail = item; -}}jssun.awt.SunToolkit.wakeupEventQueue (this.eventQueue, false); -}, "java.awt.AWTEvent"); -}); -Clazz_declarePackage ("jssun.java2d"); -Clazz_load (["java.awt.Graphics2D"], "jssun.java2d.SunGraphics2D", ["java.awt.geom.AffineTransform"], function () { -c$ = Clazz_decorateAsClass (function () { -this.transformState = 0; -this.foregroundColor = null; -this.backgroundColor = null; -this.$transform = null; -this.transX = 0; -this.transY = 0; -this.hints = null; -Clazz_instantialize (this, arguments); -}, jssun.java2d, "SunGraphics2D", java.awt.Graphics2D); -Clazz_defineMethod (c$, "clone", -function () { -return this.clone0 (); -}); -Clazz_defineMethod (c$, "clone0", -function () { -try { -var g; -{ -g = Clazz_clone(this); -}g.$transform = new java.awt.geom.AffineTransform (this.$transform); -if (this.hints != null) { -g.hints = this.hints.clone (); -}return g; -} catch (e) { -if (Clazz_exceptionOf (e, CloneNotSupportedException)) { -} else { -throw e; -} -} -return null; -}); -Clazz_defineMethod (c$, "create", -function () { -return this.clone0 (); -}); -Clazz_defineStatics (c$, -"TRANSFORM_GENERIC", 4, -"TRANSFORM_TRANSLATESCALE", 3, -"TRANSFORM_ANY_TRANSLATE", 2, -"TRANSFORM_INT_TRANSLATE", 1, -"TRANSFORM_ISIDENT", 0); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (null, "javax.swing.UIManager", ["java.util.ArrayList", "java.util.Locale", "javax.swing.RepaintManager", "$.SwingPaintEventDispatcher", "$.SwingUtilities", "jssun.awt.PaintEventDispatcher", "swingjs.JSToolkit"], function () { -c$ = Clazz_declareType (javax.swing, "UIManager"); -c$.getLookAndFeelDefaults = Clazz_defineMethod (c$, "getLookAndFeelDefaults", -function () { -return javax.swing.UIManager.uid; -}); -c$.getInstalledLookAndFeels = Clazz_defineMethod (c$, "getInstalledLookAndFeels", -function () { -return javax.swing.UIManager.installedLAFs; -}); -c$.setInstalledLookAndFeels = Clazz_defineMethod (c$, "setInstalledLookAndFeels", -function (infos) { -swingjs.JSToolkit.notImplemented (null); -}, "~A"); -c$.installLookAndFeel = Clazz_defineMethod (c$, "installLookAndFeel", -function (info) { -swingjs.JSToolkit.notImplemented (null); -}, "javax.swing.UIManager.LookAndFeelInfo"); -c$.installLookAndFeel = Clazz_defineMethod (c$, "installLookAndFeel", -function (name, className) { -swingjs.JSToolkit.notImplemented (null); -}, "~S,~S"); -c$.getLookAndFeel = Clazz_defineMethod (c$, "getLookAndFeel", -function () { -return (javax.swing.UIManager.laf == null ? (javax.swing.UIManager.laf = swingjs.JSToolkit.getInstance ("swingjs.plaf.HTML5LookAndFeel")) : javax.swing.UIManager.laf); -}); -c$.setLookAndFeel = Clazz_defineMethod (c$, "setLookAndFeel", -function (newLookAndFeel) { -}, "javax.swing.LookAndFeel"); -c$.setLookAndFeel = Clazz_defineMethod (c$, "setLookAndFeel", -function (className) { -var lnfClass = javax.swing.SwingUtilities.loadSystemClass (className); -javax.swing.UIManager.setLookAndFeel ((lnfClass.newInstance ())); -}, "~S"); -c$.getSystemLookAndFeelClassName = Clazz_defineMethod (c$, "getSystemLookAndFeelClassName", -function () { -return javax.swing.UIManager.getCrossPlatformLookAndFeelClassName (); -}); -c$.getCrossPlatformLookAndFeelClassName = Clazz_defineMethod (c$, "getCrossPlatformLookAndFeelClassName", -function () { -return "swingjs.plaf.HTML5LookAndFeel"; -}); -c$.getDefaults = Clazz_defineMethod (c$, "getDefaults", -function () { -javax.swing.UIManager.maybeInitialize (); -return javax.swing.UIManager.uid; -}); -c$.getFont = Clazz_defineMethod (c$, "getFont", -function (key) { -return javax.swing.UIManager.getDefaults ().getFont (key); -}, "~O"); -c$.getFont = Clazz_defineMethod (c$, "getFont", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getFont (key, l); -}, "~O,java.util.Locale"); -c$.getColor = Clazz_defineMethod (c$, "getColor", -function (key) { -return javax.swing.UIManager.getDefaults ().getColor (key); -}, "~O"); -c$.getColor = Clazz_defineMethod (c$, "getColor", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getColor (key, l); -}, "~O,java.util.Locale"); -c$.getIcon = Clazz_defineMethod (c$, "getIcon", -function (key) { -return javax.swing.UIManager.getDefaults ().getIcon (key); -}, "~O"); -c$.getIcon = Clazz_defineMethod (c$, "getIcon", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getIcon (key, l); -}, "~O,java.util.Locale"); -c$.getBorder = Clazz_defineMethod (c$, "getBorder", -function (key) { -return javax.swing.UIManager.getDefaults ().getBorder (key); -}, "~O"); -c$.getBorder = Clazz_defineMethod (c$, "getBorder", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getBorder (key, l); -}, "~O,java.util.Locale"); -c$.getString = Clazz_defineMethod (c$, "getString", -function (key) { -return javax.swing.UIManager.getDefaults ().getString (key); -}, "~O"); -c$.getString = Clazz_defineMethod (c$, "getString", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getString (key, l); -}, "~O,java.util.Locale"); -c$.getString = Clazz_defineMethod (c$, "getString", -function (key, c) { -var l = (c == null) ? java.util.Locale.getDefault () : c.getLocale (); -return javax.swing.UIManager.getString (key, l); -}, "~O,java.awt.Component"); -c$.getInt = Clazz_defineMethod (c$, "getInt", -function (key) { -return javax.swing.UIManager.getDefaults ().getInt (key); -}, "~O"); -c$.getInt = Clazz_defineMethod (c$, "getInt", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getInt (key, l); -}, "~O,java.util.Locale"); -c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", -function (key) { -return javax.swing.UIManager.getDefaults ().getBoolean (key); -}, "~O"); -c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getBoolean (key, l); -}, "~O,java.util.Locale"); -c$.getInsets = Clazz_defineMethod (c$, "getInsets", -function (key) { -return javax.swing.UIManager.getDefaults ().getInsets (key); -}, "~O"); -c$.getInsets = Clazz_defineMethod (c$, "getInsets", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getInsets (key, l); -}, "~O,java.util.Locale"); -c$.getDimension = Clazz_defineMethod (c$, "getDimension", -function (key) { -return javax.swing.UIManager.getDefaults ().getDimension (key); -}, "~O"); -c$.getDimension = Clazz_defineMethod (c$, "getDimension", -function (key, l) { -return javax.swing.UIManager.getDefaults ().getDimension (key, l); -}, "~O,java.util.Locale"); -c$.get = Clazz_defineMethod (c$, "get", -function (key) { -return javax.swing.UIManager.getDefaults ().get (key); -}, "~O"); -c$.get = Clazz_defineMethod (c$, "get", -function (key, l) { -return javax.swing.UIManager.getDefaults ().get (key, l); -}, "~O,java.util.Locale"); -c$.put = Clazz_defineMethod (c$, "put", -function (key, value) { -return javax.swing.UIManager.getDefaults ().put (key, value); -}, "~O,~O"); -c$.getUI = Clazz_defineMethod (c$, "getUI", -function (target) { -javax.swing.UIManager.maybeInitialize (); -var ui = null; -ui = javax.swing.UIManager.getDefaults ().getUI (target); -if (ui == null) System.out.println (target.getUIClassID () + " has not been implemented"); -return ui; -}, "javax.swing.JComponent"); -c$.addPropertyChangeListener = Clazz_defineMethod (c$, "addPropertyChangeListener", -function (listener) { -}, "java.beans.PropertyChangeListener"); -c$.removePropertyChangeListener = Clazz_defineMethod (c$, "removePropertyChangeListener", -function (listener) { -}, "java.beans.PropertyChangeListener"); -c$.getPropertyChangeListeners = Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -return new Array (0); -}); -c$.maybeInitialize = Clazz_defineMethod (c$, "maybeInitialize", - function () { -if (javax.swing.UIManager.uid == null) { -javax.swing.UIManager.uid = swingjs.JSToolkit.getLookAndFeelDefaults (); -javax.swing.UIManager.initialize (); -}}); -c$.initialize = Clazz_defineMethod (c$, "initialize", - function () { -if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { -jssun.awt.PaintEventDispatcher.setPaintEventDispatcher ( new javax.swing.SwingPaintEventDispatcher ()); -}}); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.name = null; -this.className = null; -Clazz_instantialize (this, arguments); -}, javax.swing.UIManager, "LookAndFeelInfo"); -Clazz_makeConstructor (c$, -function (a, b) { -this.name = a; -this.className = b; -}, "~S,~S"); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_defineMethod (c$, "getClassName", -function () { -return this.className; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return this.getClass ().getName () + "[" + this.getName () + " " + this.getClassName () + "]"; -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"installedLAFs", null); -{ -var iLAFs = new java.util.ArrayList (4); -iLAFs.add ( new javax.swing.UIManager.LookAndFeelInfo ("HTML5", "swingjs.plaf.HTML5LookAndFeel")); -javax.swing.UIManager.installedLAFs = iLAFs.toArray ( new Array (iLAFs.size ())); -}Clazz_defineStatics (c$, -"laf", null, -"uid", null); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.util.Hashtable", "java.util.Locale"], "javax.swing.UIDefaults", ["java.lang.Boolean", "$.Error", "java.util.HashMap", "$.Vector", "java.awt.Color", "$.Dimension", "$.Font", "$.Insets", "javax.swing.Icon", "$.SwingUtilities", "javax.swing.border.Border", "javax.swing.event.SwingPropertyChangeSupport", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.changeSupport = null; -this.resourceBundles = null; -this.defaultLocale = null; -this.resourceCache = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "UIDefaults", java.util.Hashtable); -Clazz_prepareFields (c$, function () { -this.defaultLocale = java.util.Locale.getDefault (); -}); -Clazz_makeConstructor (c$, -function () { -this.construct (700, .75); -}); -Clazz_makeConstructor (c$, -function (initialCapacity, loadFactor) { -Clazz_superConstructor (this, javax.swing.UIDefaults, [initialCapacity, loadFactor]); -this.resourceCache = new java.util.HashMap (); -}, "~N,~N"); -Clazz_makeConstructor (c$, -function (keyValueList) { -Clazz_superConstructor (this, javax.swing.UIDefaults, [Clazz_doubleToInt (keyValueList.length / 2)]); -for (var i = 0; i < keyValueList.length; i += 2) { -Clazz_superCall (this, javax.swing.UIDefaults, "put", [keyValueList[i], keyValueList[i + 1]]); -} -}, "~A"); -Clazz_defineMethod (c$, "get", -function (key) { -var value = this.getFromHashtable (key); -return (value != null) ? value : this.getFromResourceBundle (key, null); -}, "~O"); -Clazz_defineMethod (c$, "getFromHashtable", - function (key) { -var value = Clazz_superCall (this, javax.swing.UIDefaults, "get", [key]); -if (value == null && (Clazz_instanceOf (key, String))) { -var skey = key; -if (skey.endsWith (".font") || skey.endsWith (".background") || skey.endsWith (".foreground")) value = Clazz_superCall (this, javax.swing.UIDefaults, "get", ["*" + skey.substring (skey.lastIndexOf ("."))]); -}if ((value !== javax.swing.UIDefaults.PENDING) && !(Clazz_instanceOf (value, javax.swing.UIDefaults.ActiveValue)) && !(Clazz_instanceOf (value, javax.swing.UIDefaults.LazyValue))) { -return value; -}if (!(Clazz_instanceOf (value, javax.swing.UIDefaults.ActiveValue))) { -return value; -}if (Clazz_instanceOf (value, javax.swing.UIDefaults.LazyValue)) { -try { -value = (value).createValue (this); -} finally { -if (value == null) { -Clazz_superCall (this, javax.swing.UIDefaults, "remove", [key]); -} else { -Clazz_superCall (this, javax.swing.UIDefaults, "put", [key, value]); -}} -} else { -value = (value).createValue (this); -}return value; -}, "~O"); -Clazz_defineMethod (c$, "get", -function (key, l) { -var value = this.getFromHashtable (key); -return (value != null) ? value : this.getFromResourceBundle (key, l); -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getFromResourceBundle", - function (key, l) { -if (this.resourceBundles == null || this.resourceBundles.isEmpty () || !(Clazz_instanceOf (key, String))) { -return null; -}if (l == null) { -if (this.defaultLocale == null) return null; - else l = this.defaultLocale; -}{ -return this.getResourceCache (l).get (key); -}}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getResourceCache", - function (l) { -return null; -}, "java.util.Locale"); -Clazz_defineMethod (c$, "put", -function (key, value) { -var oldValue = (value == null) ? Clazz_superCall (this, javax.swing.UIDefaults, "remove", [key]) : Clazz_superCall (this, javax.swing.UIDefaults, "put", [key, value]); -if (Clazz_instanceOf (key, String)) { -this.firePropertyChange (key, oldValue, value); -}return oldValue; -}, "~O,~O"); -Clazz_defineMethod (c$, "putDefaults", -function (keyValueList) { -for (var i = 0, max = keyValueList.length; i < max; i += 2) { -var value = keyValueList[i + 1]; -if (value == null) { -Clazz_superCall (this, javax.swing.UIDefaults, "remove", [keyValueList[i]]); -} else { -Clazz_superCall (this, javax.swing.UIDefaults, "put", [keyValueList[i], value]); -}} -this.firePropertyChange ("UIDefaults", null, null); -}, "~A"); -Clazz_defineMethod (c$, "getFont", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, java.awt.Font)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getFont", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, java.awt.Font)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getColor", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, java.awt.Color)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getColor", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, java.awt.Color)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getIcon", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, javax.swing.Icon)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getIcon", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, javax.swing.Icon)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getBorder", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, javax.swing.border.Border)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getBorder", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, javax.swing.border.Border)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getString", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, String)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getString", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, String)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getInt", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, Integer)) ? (value).intValue () : 0; -}, "~O"); -Clazz_defineMethod (c$, "getInt", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, Integer)) ? (value).intValue () : 0; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getBoolean", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, Boolean)) ? (value).booleanValue () : false; -}, "~O"); -Clazz_defineMethod (c$, "getBoolean", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, Boolean)) ? (value).booleanValue () : false; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getInsets", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, java.awt.Insets)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getInsets", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, java.awt.Insets)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getDimension", -function (key) { -var value = this.get (key); -return (Clazz_instanceOf (value, java.awt.Dimension)) ? value : null; -}, "~O"); -Clazz_defineMethod (c$, "getDimension", -function (key, l) { -var value = this.get (key, l); -return (Clazz_instanceOf (value, java.awt.Dimension)) ? value : null; -}, "~O,java.util.Locale"); -Clazz_defineMethod (c$, "getUIClass", -function (uiClassID, uiClassLoader) { -try { -var className = this.get (uiClassID); -if (className != null) { -var cls = this.get (className); -if (cls == null) { -if (uiClassLoader == null) { -cls = javax.swing.SwingUtilities.loadSystemClass (className); -} else { -cls = uiClassLoader.loadClass (className); -}if (cls != null) { -this.put (className, cls); -}}return cls; -}} catch (e$$) { -if (Clazz_exceptionOf (e$$, ClassNotFoundException)) { -var e = e$$; -{ -return null; -} -} else if (Clazz_exceptionOf (e$$, ClassCastException)) { -var e = e$$; -{ -return null; -} -} else { -throw e$$; -} -} -return null; -}, "~S,ClassLoader"); -Clazz_defineMethod (c$, "getUIClass", -function (uiClassID) { -return this.getUIClass (uiClassID, null); -}, "~S"); -Clazz_defineMethod (c$, "getUIError", -function (msg) { -System.err.println ("UIDefaults.getUI() failed: " + msg); -try { -throw new Error (); -} catch (e) { -e.printStackTrace (); -} -}, "~S"); -Clazz_defineMethod (c$, "getUI", -function (target) { -return swingjs.JSToolkit.getComponentUI (target); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "addPropertyChangeListener", -function (listener) { -if (this.changeSupport == null) { -this.changeSupport = new javax.swing.event.SwingPropertyChangeSupport (this); -}this.changeSupport.addPropertyChangeListener (listener); -}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "removePropertyChangeListener", -function (listener) { -if (this.changeSupport != null) { -this.changeSupport.removePropertyChangeListener (listener); -}}, "java.beans.PropertyChangeListener"); -Clazz_defineMethod (c$, "getPropertyChangeListeners", -function () { -if (this.changeSupport == null) { -return new Array (0); -}return this.changeSupport.getPropertyChangeListeners (); -}); -Clazz_defineMethod (c$, "firePropertyChange", -function (propertyName, oldValue, newValue) { -if (this.changeSupport != null) { -this.changeSupport.firePropertyChange (propertyName, oldValue, newValue); -}}, "~S,~O,~O"); -Clazz_defineMethod (c$, "addResourceBundle", -function (bundleName) { -if (bundleName == null) { -return; -}if (this.resourceBundles == null) { -this.resourceBundles = new java.util.Vector (5); -}if (!this.resourceBundles.contains (bundleName)) { -this.resourceBundles.add (bundleName); -this.resourceCache.clear (); -}}, "~S"); -Clazz_defineMethod (c$, "removeResourceBundle", -function (bundleName) { -if (this.resourceBundles != null) { -this.resourceBundles.remove (bundleName); -}this.resourceCache.clear (); -}, "~S"); -Clazz_defineMethod (c$, "setDefaultLocale", -function (l) { -this.defaultLocale = l; -}, "java.util.Locale"); -Clazz_defineMethod (c$, "getDefaultLocale", -function () { -return this.defaultLocale; -}); -Clazz_declareInterface (javax.swing.UIDefaults, "LazyValue"); -Clazz_declareInterface (javax.swing.UIDefaults, "ActiveValue"); -c$.PENDING = c$.prototype.PENDING = String.instantialize ("Pending"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (null, "javax.swing.LookAndFeel", ["javax.swing.JPasswordField", "$.UIManager", "javax.swing.plaf.UIResource", "jssun.swing.DefaultLayoutStyle", "swingjs.JSToolkit"], function () { -c$ = Clazz_declareType (javax.swing, "LookAndFeel"); -c$.installColors = Clazz_defineMethod (c$, "installColors", -function (c, defaultBgName, defaultFgName) { -var bg = c.getBackground (); -if (bg == null || Clazz_instanceOf (bg, javax.swing.plaf.UIResource)) c.setBackground (javax.swing.UIManager.getColor (defaultBgName)); -var fg = c.getForeground (); -if (fg == null || Clazz_instanceOf (fg, javax.swing.plaf.UIResource)) c.setForeground (javax.swing.UIManager.getColor (defaultFgName)); -}, "javax.swing.JComponent,~S,~S"); -c$.installColorsAndFont = Clazz_defineMethod (c$, "installColorsAndFont", -function (c, defaultBgName, defaultFgName, defaultFontName) { -var f = c.getFont (); -if (f == null || Clazz_instanceOf (f, javax.swing.plaf.UIResource)) { -c.setFont (javax.swing.UIManager.getFont (defaultFontName)); -}javax.swing.LookAndFeel.installColors (c, defaultBgName, defaultFgName); -}, "javax.swing.JComponent,~S,~S,~S"); -c$.installBorder = Clazz_defineMethod (c$, "installBorder", -function (c, defaultBorderName) { -swingjs.JSToolkit.notImplemented (null); -}, "javax.swing.JComponent,~S"); -c$.uninstallBorder = Clazz_defineMethod (c$, "uninstallBorder", -function (c) { -swingjs.JSToolkit.notImplemented (null); -}, "javax.swing.JComponent"); -c$.installProperty = Clazz_defineMethod (c$, "installProperty", -function (c, propertyName, propertyValue) { -if (Clazz_instanceOf (c, javax.swing.JPasswordField)) { -if (!(c).customSetUIProperty (propertyName, propertyValue)) { -c.setUIProperty (propertyName, propertyValue); -}} else { -c.setUIProperty (propertyName, propertyValue); -}}, "javax.swing.JComponent,~S,~O"); -c$.makeKeyBindings = Clazz_defineMethod (c$, "makeKeyBindings", -function (keyBindingList) { -swingjs.JSToolkit.notImplemented (null); -return null; -}, "~A"); -c$.makeInputMap = Clazz_defineMethod (c$, "makeInputMap", -function (keys) { -swingjs.JSToolkit.notImplemented (null); -return null; -}, "~A"); -c$.makeComponentInputMap = Clazz_defineMethod (c$, "makeComponentInputMap", -function (c, keys) { -swingjs.JSToolkit.notImplemented (null); -return null; -}, "javax.swing.JComponent,~A"); -c$.loadKeyBindings = Clazz_defineMethod (c$, "loadKeyBindings", -function (retMap, keys) { -swingjs.JSToolkit.notImplemented (null); -}, "javax.swing.InputMap,~A"); -c$.makeIcon = Clazz_defineMethod (c$, "makeIcon", -function (baseClass, gifFile) { -swingjs.JSToolkit.notImplemented (null); -return null; -}, "Class,~S"); -Clazz_defineMethod (c$, "getLayoutStyle", -function () { -return jssun.swing.DefaultLayoutStyle.getInstance (); -}); -Clazz_defineMethod (c$, "provideErrorFeedback", -function (component) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.Component"); -c$.getDesktopPropertyValue = Clazz_defineMethod (c$, "getDesktopPropertyValue", -function (systemPropertyName, fallbackValue) { -swingjs.JSToolkit.notImplemented (null); -return fallbackValue; -}, "~S,~O"); -Clazz_defineMethod (c$, "getDisabledIcon", -function (component, icon) { -swingjs.JSToolkit.notImplemented (null); -return null; -}, "javax.swing.JComponent,javax.swing.Icon"); -Clazz_defineMethod (c$, "getDisabledSelectedIcon", -function (component, icon) { -return this.getDisabledIcon (component, icon); -}, "javax.swing.JComponent,javax.swing.Icon"); -Clazz_defineMethod (c$, "getSupportsWindowDecorations", -function () { -return false; -}); -Clazz_defineMethod (c$, "initialize", -function () { -}); -Clazz_defineMethod (c$, "uninitialize", -function () { -}); -Clazz_defineMethod (c$, "getDefaults", -function () { -return null; -}); -Clazz_overrideMethod (c$, "toString", -function () { -return "[" + this.getDescription () + " - " + this.getClass ().getName () + "]"; -}); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.lang.Enum"], "javax.swing.DropMode", null, function () { -c$ = Clazz_declareType (javax.swing, "DropMode", Enum); -Clazz_defineEnumConstant (c$, "USE_SELECTION", 0, []); -Clazz_defineEnumConstant (c$, "ON", 1, []); -Clazz_defineEnumConstant (c$, "INSERT", 2, []); -Clazz_defineEnumConstant (c$, "INSERT_ROWS", 3, []); -Clazz_defineEnumConstant (c$, "INSERT_COLS", 4, []); -Clazz_defineEnumConstant (c$, "ON_OR_INSERT", 5, []); -Clazz_defineEnumConstant (c$, "ON_OR_INSERT_ROWS", 6, []); -Clazz_defineEnumConstant (c$, "ON_OR_INSERT_COLS", 7, []); -}); -Clazz_declarePackage ("java.awt.font"); -Clazz_load (null, "java.awt.font.FontRenderContext", ["java.awt.RenderingHints", "java.awt.geom.AffineTransform"], function () { -c$ = Clazz_decorateAsClass (function () { -this.tx = null; -this.aaHintValue = null; -this.fmHintValue = null; -this.defaulting = false; -Clazz_instantialize (this, arguments); -}, java.awt.font, "FontRenderContext"); -Clazz_makeConstructor (c$, -function () { -this.defaulting = true; -}); -Clazz_makeConstructor (c$, -function (tx, isAntiAliased, usesFractionalMetrics) { -if (tx != null && !tx.isIdentity ()) { -this.tx = new java.awt.geom.AffineTransform (tx); -}}, "java.awt.geom.AffineTransform,~B,~B"); -Clazz_makeConstructor (c$, -function (tx, aaHint, fmHint) { -if (tx != null && !tx.isIdentity ()) { -this.tx = new java.awt.geom.AffineTransform (tx); -}this.aaHintValue = aaHint; -this.fmHintValue = fmHint; -}, "java.awt.geom.AffineTransform,~O,~O"); -Clazz_defineMethod (c$, "isTransformed", -function () { -if (!this.defaulting) { -return this.tx != null; -} else { -return !this.getTransform ().isIdentity (); -}}); -Clazz_defineMethod (c$, "getTransformType", -function () { -if (!this.defaulting) { -if (this.tx == null) { -return 0; -} else { -return this.tx.getType (); -}} else { -return this.getTransform ().getType (); -}}); -Clazz_defineMethod (c$, "getTransform", -function () { -return (this.tx == null) ? new java.awt.geom.AffineTransform () : new java.awt.geom.AffineTransform (this.tx); -}); -Clazz_defineMethod (c$, "isAntiAliased", -function () { -return !(this.aaHintValue === java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF || this.aaHintValue === java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT); -}); -Clazz_defineMethod (c$, "usesFractionalMetrics", -function () { -return !(this.fmHintValue === java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_OFF || this.fmHintValue === java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT); -}); -Clazz_defineMethod (c$, "getAntiAliasingHint", -function () { -if (this.defaulting) { -if (this.isAntiAliased ()) { -return java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON; -} else { -return java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF; -}}return this.aaHintValue; -}); -Clazz_defineMethod (c$, "getFractionalMetricsHint", -function () { -if (this.defaulting) { -if (this.usesFractionalMetrics ()) { -return java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_ON; -} else { -return java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_OFF; -}}return this.fmHintValue; -}); -Clazz_defineMethod (c$, "equals", -function (obj) { -try { -return this.equals (obj); -} catch (e) { -if (Clazz_exceptionOf (e, ClassCastException)) { -return false; -} else { -throw e; -} -} -}, "~O"); -Clazz_defineMethod (c$, "equals", -function (rhs) { -if (this === rhs) { -return true; -}if (rhs == null) { -return false; -}if (!rhs.defaulting && !this.defaulting) { -if (rhs.aaHintValue === this.aaHintValue && rhs.fmHintValue === this.fmHintValue) { -return this.tx == null ? rhs.tx == null : this.tx.equals (rhs.tx); -}return false; -} else { -return rhs.getAntiAliasingHint () === this.getAntiAliasingHint () && rhs.getFractionalMetricsHint () === this.getFractionalMetricsHint () && rhs.getTransform ().equals (this.getTransform ()); -}}, "java.awt.font.FontRenderContext"); -Clazz_defineMethod (c$, "hashCode", -function () { -var hash = this.tx == null ? 0 : this.tx.hashCode (); -if (this.defaulting) { -hash += this.getAntiAliasingHint ().hashCode (); -hash += this.getFractionalMetricsHint ().hashCode (); -} else { -hash += this.aaHintValue.hashCode (); -hash += this.fmHintValue.hashCode (); -}return hash; -}); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.AWTEvent"], "java.awt.event.InputMethodEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.when = 0; -this.text = null; -this.committedCharacterCount = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "InputMethodEvent", java.awt.AWTEvent); -Clazz_defineMethod (c$, "getText", -function () { -return this.text; -}); -Clazz_defineMethod (c$, "getCommittedCharacterCount", -function () { -return this.committedCharacterCount; -}); -Clazz_defineMethod (c$, "getWhen", -function () { -return this.when; -}); -Clazz_defineStatics (c$, -"INPUT_METHOD_FIRST", 1100, -"INPUT_METHOD_TEXT_CHANGED", 1100, -"CARET_POSITION_CHANGED", 1101, -"INPUT_METHOD_LAST", 1101); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.event.ComponentAdapter", "javax.swing.JComponent"], "javax.swing.JViewport", ["java.lang.IllegalArgumentException", "java.applet.Applet", "java.awt.Dimension", "$.Insets", "$.Point", "$.Rectangle", "$.Window", "javax.swing.CellRendererPane", "$.RepaintManager", "$.SwingUtilities", "$.UIManager", "$.ViewportLayout", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.isViewSizeSet = false; -this.lastPaintPosition = null; -this.backingStore = false; -this.backingStoreImage = null; -this.scrollUnderway = false; -this.viewListener = null; -this.changeEvent = null; -this.scrollMode = 1; -this.repaintAll = false; -this.waitingForRepaint = false; -this.inBlitPaint = false; -this.hasHadValidView = false; -if (!Clazz_isClassDefined ("javax.swing.JViewport.ViewListener")) { -javax.swing.JViewport.$JViewport$ViewListener$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "JViewport", javax.swing.JComponent); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JViewport); -this.setLayout (this.createLayoutManager ()); -this.setOpaque (true); -this.updateUI (); -this.setInheritsPopupMenu (true); -}); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "ViewportUI"; -}); -Clazz_overrideMethod (c$, "addImpl", -function (child, constraints, index) { -this.setView (child); -return child; -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "remove", -function (child) { -child.removeComponentListener (this.viewListener); -this.removeChild (child); -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "scrollRectToVisible", -function (contentRect) { -var view = this.getView (); -if (view == null) { -return; -} else { -if (!view.isValid ()) { -this.validateView (); -}var dx = 0; -var dy = 0; -dx = this.positionAdjustment (this.getWidth (), contentRect.width, contentRect.x); -dy = this.positionAdjustment (this.getHeight (), contentRect.height, contentRect.y); -if (dx != 0 || dy != 0) { -var viewPosition = this.getViewPosition (); -var viewSize = view.getSize (); -var startX = viewPosition.x; -var startY = viewPosition.y; -var extent = this.getExtentSize (); -viewPosition.x -= dx; -viewPosition.y -= dy; -if (view.isValid ()) { -if (this.getParent ().getComponentOrientation ().isLeftToRight ()) { -if (viewPosition.x + extent.width > viewSize.width) { -viewPosition.x = Math.max (0, viewSize.width - extent.width); -} else if (viewPosition.x < 0) { -viewPosition.x = 0; -}} else { -if (extent.width > viewSize.width) { -viewPosition.x = viewSize.width - extent.width; -} else { -viewPosition.x = Math.max (0, Math.min (viewSize.width - extent.width, viewPosition.x)); -}}if (viewPosition.y + extent.height > viewSize.height) { -viewPosition.y = Math.max (0, viewSize.height - extent.height); -} else if (viewPosition.y < 0) { -viewPosition.y = 0; -}}if (viewPosition.x != startX || viewPosition.y != startY) { -this.setViewPosition (viewPosition); -this.scrollUnderway = false; -}}}}, "java.awt.Rectangle"); -Clazz_defineMethod (c$, "validateView", - function () { -var validateRoot = null; -for (var c = this; c != null; c = c.getParent ()) { -if ((Clazz_instanceOf (c, javax.swing.CellRendererPane)) || !c.isLightweight ()) { -return; -}if ((Clazz_instanceOf (c, javax.swing.JComponent)) && ((c).isValidateRoot ())) { -validateRoot = c; -break; -}} -if (validateRoot == null) { -return; -}var root = null; -for (var c = validateRoot; c != null; c = c.getParent ()) { -if (!c.isLightweight ()) { -return; -}if ((Clazz_instanceOf (c, java.awt.Window)) || (Clazz_instanceOf (c, java.applet.Applet))) { -root = c; -break; -}} -if (root == null) { -return; -}validateRoot.validate (); -var rm = javax.swing.RepaintManager.currentManager (this); -if (rm != null) { -rm.removeInvalidComponent (validateRoot); -}}); -Clazz_defineMethod (c$, "positionAdjustment", - function (parentWidth, childWidth, childAt) { -if (childAt >= 0 && childWidth + childAt <= parentWidth) { -return 0; -}if (childAt <= 0 && childWidth + childAt >= parentWidth) { -return 0; -}if (childAt > 0 && childWidth <= parentWidth) { -return -childAt + parentWidth - childWidth; -}if (childAt >= 0 && childWidth >= parentWidth) { -return -childAt; -}if (childAt <= 0 && childWidth <= parentWidth) { -return -childAt; -}if (childAt < 0 && childWidth >= parentWidth) { -return -childAt + parentWidth - childWidth; -}return 0; -}, "~N,~N,~N"); -Clazz_overrideMethod (c$, "setBorder", -function (border) { -if (border != null) { -throw new IllegalArgumentException ("JViewport.setBorder() not supported"); -}}, "javax.swing.border.Border"); -Clazz_defineMethod (c$, "getInsets", -function () { -return new java.awt.Insets (0, 0, 0, 0); -}); -Clazz_defineMethod (c$, "getInsets", -function (insets) { -insets.left = insets.top = insets.right = insets.bottom = 0; -return insets; -}, "java.awt.Insets"); -Clazz_defineMethod (c$, "getBackingStoreGraphics", - function (g) { -var bsg = this.backingStoreImage.getGraphics (); -bsg.setColor (g.getColor ()); -bsg.setFont (g.getFont ()); -bsg.setClip (g.getClipBounds ()); -return bsg; -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintViaBackingStore", - function (g) { -var bsg = this.getBackingStoreGraphics (g); -try { -Clazz_superCall (this, javax.swing.JViewport, "paint", [bsg]); -g.drawImage (this.backingStoreImage, 0, 0, this); -} finally { -bsg.dispose (); -} -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "paintViaBackingStore", - function (g, oClip) { -var bsg = this.getBackingStoreGraphics (g); -try { -Clazz_superCall (this, javax.swing.JViewport, "paint", [bsg]); -g.setClip (oClip); -g.drawImage (this.backingStoreImage, 0, 0, this); -} finally { -bsg.dispose (); -} -}, "java.awt.Graphics,java.awt.Rectangle"); -Clazz_defineMethod (c$, "isOptimizedDrawingEnabled", -function () { -return false; -}); -Clazz_overrideMethod (c$, "isPaintingOrigin", -function () { -if (this.scrollMode == 2) { -return true; -}return false; -}); -Clazz_defineMethod (c$, "getViewLocation", - function () { -var view = this.getView (); -if (view != null) { -return view.getLocation (); -} else { -return new java.awt.Point (0, 0); -}}); -Clazz_defineMethod (c$, "paint", -function (g) { -var width = this.getWidth (); -var height = this.getHeight (); -if ((width <= 0) || (height <= 0)) { -return; -}if (this.inBlitPaint) { -Clazz_superCall (this, javax.swing.JViewport, "paint", [g]); -return; -}if (this.repaintAll) { -this.repaintAll = false; -var clipB = g.getClipBounds (); -} else if (this.waitingForRepaint) { -var clipB = g.getClipBounds (); -if (clipB.width >= this.getWidth () && clipB.height >= this.getHeight ()) { -this.waitingForRepaint = false; -}}if (!this.backingStore || this.isBlitting () || this.getView () == null) { -Clazz_superCall (this, javax.swing.JViewport, "paint", [g]); -this.lastPaintPosition = this.getViewLocation (); -return; -}var viewBounds = this.getView ().getBounds (); -if (!this.isOpaque ()) { -g.clipRect (0, 0, viewBounds.width, viewBounds.height); -}if (this.backingStoreImage == null) { -this.backingStoreImage = this.createImage (width, height); -var clip = g.getClipBounds (); -if (clip.width != width || clip.height != height) { -if (!this.isOpaque ()) { -g.setClip (0, 0, Math.min (viewBounds.width, width), Math.min (viewBounds.height, height)); -} else { -g.setClip (0, 0, width, height); -}this.paintViaBackingStore (g, clip); -} else { -this.paintViaBackingStore (g); -}} else { -if (!this.scrollUnderway || this.lastPaintPosition.equals (this.getViewLocation ())) { -this.paintViaBackingStore (g); -} else { -var blitFrom = new java.awt.Point (); -var blitTo = new java.awt.Point (); -var blitSize = new java.awt.Dimension (); -var blitPaint = new java.awt.Rectangle (); -var newLocation = this.getViewLocation (); -var dx = newLocation.x - this.lastPaintPosition.x; -var dy = newLocation.y - this.lastPaintPosition.y; -var canBlit = this.computeBlit (dx, dy, blitFrom, blitTo, blitSize, blitPaint); -if (!canBlit) { -this.paintViaBackingStore (g); -} else { -var bdx = blitTo.x - blitFrom.x; -var bdy = blitTo.y - blitFrom.y; -var clip = g.getClipBounds (); -g.setClip (0, 0, width, height); -var bsg = this.getBackingStoreGraphics (g); -try { -bsg.copyArea (blitFrom.x, blitFrom.y, blitSize.width, blitSize.height, bdx, bdy); -g.setClip (clip.x, clip.y, clip.width, clip.height); -var r = viewBounds.intersection (blitPaint); -bsg.setClip (r); -Clazz_superCall (this, javax.swing.JViewport, "paint", [bsg]); -g.drawImage (this.backingStoreImage, 0, 0, this); -} finally { -bsg.dispose (); -} -}}}this.lastPaintPosition = this.getViewLocation (); -this.scrollUnderway = false; -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "reshape", -function (x, y, w, h) { -var sizeChanged = (this.getWidth () != w) || (this.getHeight () != h); -if (sizeChanged) { -this.backingStoreImage = null; -}Clazz_superCall (this, javax.swing.JViewport, "reshape", [x, y, w, h]); -if (sizeChanged) { -this.fireStateChanged (); -}}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setScrollMode", -function (mode) { -this.scrollMode = mode; -if (mode == 2) { -this.backingStore = true; -} else { -this.backingStore = false; -}}, "~N"); -Clazz_defineMethod (c$, "getScrollMode", -function () { -return this.scrollMode; -}); -Clazz_defineMethod (c$, "isBackingStoreEnabled", -function () { -return this.scrollMode == 2; -}); -Clazz_defineMethod (c$, "setBackingStoreEnabled", -function (enabled) { -if (enabled) { -this.setScrollMode (2); -} else { -this.setScrollMode (1); -}}, "~B"); -Clazz_defineMethod (c$, "isBlitting", - function () { -var view = this.getView (); -return (this.scrollMode == 1) && (Clazz_instanceOf (view, javax.swing.JComponent)) && (view).isOpaque (); -}); -Clazz_defineMethod (c$, "getView", -function () { -return (this.getComponentCount () > 0) ? this.getComponent (0) : null; -}); -Clazz_defineMethod (c$, "setView", -function (view) { -var n = this.getComponentCount (); -for (var i = n - 1; i >= 0; i--) { -this.remove (this.getComponent (i)); -} -this.isViewSizeSet = false; -if (view != null) { -this.addImplSAEM (view, null, -1); -this.viewListener = this.createViewListener (); -view.addComponentListener (this.viewListener); -}if (this.hasHadValidView) { -this.fireStateChanged (); -} else if (view != null) { -this.hasHadValidView = true; -}this.revalidate (); -this.repaint (); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getViewSize", -function () { -var view = this.getView (); -if (view == null) { -return new java.awt.Dimension (0, 0); -} else if (this.isViewSizeSet) { -return view.getSize (); -} else { -return view.getPreferredSize (); -}}); -Clazz_defineMethod (c$, "setViewSize", -function (newSize) { -var view = this.getView (); -if (view != null) { -var oldSize = view.getSize (); -if (!newSize.equals (oldSize)) { -this.scrollUnderway = false; -view.setSize (newSize); -this.isViewSizeSet = true; -this.fireStateChanged (); -}}}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "getViewPosition", -function () { -var view = this.getView (); -if (view != null) { -var p = view.getLocation (); -p.x = -p.x; -p.y = -p.y; -return p; -} else { -return new java.awt.Point (0, 0); -}}); -Clazz_defineMethod (c$, "setViewPosition", -function (p) { -var view = this.getView (); -if (view == null) { -return; -}var oldX; -var oldY; -var x = p.x; -var y = p.y; -if (Clazz_instanceOf (view, javax.swing.JComponent)) { -var c = view; -oldX = c.getX (); -oldY = c.getY (); -} else { -var r = view.getBounds (); -oldX = r.x; -oldY = r.y; -}var newX = -x; -var newY = -y; -if ((oldX != newX) || (oldY != newY)) { -if (!this.waitingForRepaint && this.isBlitting () && this.canUseWindowBlitter ()) { -var rm = javax.swing.RepaintManager.currentManager (this); -var jview = view; -var dirty = rm.getDirtyRegion (jview); -if (dirty == null || !dirty.contains (jview.getVisibleRect ())) { -rm.beginPaint (); -try { -var g = javax.swing.JComponent.safelyGetGraphics (this, javax.swing.SwingUtilities.getRoot (this)); -this.flushViewDirtyRegion (g, dirty); -view.setLocation (newX, newY); -g.setClip (0, 0, this.getWidth (), Math.min (this.getHeight (), jview.getHeight ())); -this.repaintAll = (this.windowBlitPaint (g) && this.needsRepaintAfterBlit ()); -g.dispose (); -rm.markCompletelyClean (this.getParent ()); -rm.markCompletelyClean (this); -rm.markCompletelyClean (jview); -} finally { -rm.endPaint (); -} -} else { -view.setLocation (newX, newY); -this.repaintAll = false; -}} else { -this.scrollUnderway = true; -view.setLocation (newX, newY); -this.repaintAll = false; -}this.fireStateChanged (); -}}, "java.awt.Point"); -Clazz_defineMethod (c$, "getViewRect", -function () { -return new java.awt.Rectangle (this.getViewPosition (), this.getExtentSize ()); -}); -Clazz_defineMethod (c$, "computeBlit", -function (dx, dy, blitFrom, blitTo, blitSize, blitPaint) { -var dxAbs = Math.abs (dx); -var dyAbs = Math.abs (dy); -var extentSize = this.getExtentSize (); -if ((dx == 0) && (dy != 0) && (dyAbs < extentSize.height)) { -if (dy < 0) { -blitFrom.y = -dy; -blitTo.y = 0; -blitPaint.y = extentSize.height + dy; -} else { -blitFrom.y = 0; -blitTo.y = dy; -blitPaint.y = 0; -}blitPaint.x = blitFrom.x = blitTo.x = 0; -blitSize.width = extentSize.width; -blitSize.height = extentSize.height - dyAbs; -blitPaint.width = extentSize.width; -blitPaint.height = dyAbs; -return true; -} else if ((dy == 0) && (dx != 0) && (dxAbs < extentSize.width)) { -if (dx < 0) { -blitFrom.x = -dx; -blitTo.x = 0; -blitPaint.x = extentSize.width + dx; -} else { -blitFrom.x = 0; -blitTo.x = dx; -blitPaint.x = 0; -}blitPaint.y = blitFrom.y = blitTo.y = 0; -blitSize.width = extentSize.width - dxAbs; -blitSize.height = extentSize.height; -blitPaint.width = dxAbs; -blitPaint.height = extentSize.height; -return true; -} else { -return false; -}}, "~N,~N,java.awt.Point,java.awt.Point,java.awt.Dimension,java.awt.Rectangle"); -Clazz_defineMethod (c$, "getExtentSize", -function () { -return this.getSize (); -}); -Clazz_defineMethod (c$, "toViewCoordinates", -function (size) { -return new java.awt.Dimension (size); -}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "toViewCoordinates", -function (p) { -return new java.awt.Point (p); -}, "java.awt.Point"); -Clazz_defineMethod (c$, "setExtentSize", -function (newExtent) { -var oldExtent = this.getExtentSize (); -if (!newExtent.equals (oldExtent)) { -this.setSize (newExtent); -this.fireStateChanged (); -}}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "createViewListener", -function () { -return Clazz_innerTypeInstance (javax.swing.JViewport.ViewListener, this, null); -}); -Clazz_defineMethod (c$, "createLayoutManager", -function () { -return javax.swing.ViewportLayout.SHARED_INSTANCE; -}); -Clazz_defineMethod (c$, "addChangeListener", -function (l) { -this.listenerList.add (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "removeChangeListener", -function (l) { -this.listenerList.remove (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "getChangeListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.ChangeListener); -}); -Clazz_defineMethod (c$, "fireStateChanged", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.ChangeListener) { -if (this.changeEvent == null) { -this.changeEvent = new javax.swing.event.ChangeEvent (this); -}(listeners[i + 1]).stateChanged (this.changeEvent); -}} -}); -Clazz_defineMethod (c$, "repaint", -function (tm, x, y, w, h) { -var parent = this.getParent (); -if (parent != null) parent.repaint (tm, x + this.getX (), y + this.getY (), w, h); - else Clazz_superCall (this, javax.swing.JViewport, "repaint", [tm, x, y, w, h]); -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paramString", -function () { -var isViewSizeSetString = (this.isViewSizeSet ? "true" : "false"); -var lastPaintPositionString = (this.lastPaintPosition != null ? this.lastPaintPosition.toString () : ""); -var scrollUnderwayString = (this.scrollUnderway ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JViewport, "paramString", []) + ",isViewSizeSet=" + isViewSizeSetString + ",lastPaintPosition=" + lastPaintPositionString + ",scrollUnderway=" + scrollUnderwayString; -}); -Clazz_defineMethod (c$, "firePropertyChangeObject", -function (propertyName, oldValue, newValue) { -Clazz_superCall (this, javax.swing.JViewport, "firePropertyChangeObject", [propertyName, oldValue, newValue]); -if (propertyName.equals (javax.swing.JViewport.EnableWindowBlit)) { -if (newValue != null) { -this.setScrollMode (1); -} else { -this.setScrollMode (0); -}}}, "~S,~O,~O"); -Clazz_defineMethod (c$, "needsRepaintAfterBlit", - function () { -var heavyParent = this.getParent (); -while (heavyParent != null && heavyParent.isLightweight ()) { -heavyParent = heavyParent.getParent (); -} -if (heavyParent != null) { -}return true; -}); -Clazz_defineMethod (c$, "flushViewDirtyRegion", - function (g, dirty) { -var view = this.getView (); -if (dirty != null && dirty.width > 0 && dirty.height > 0) { -dirty.x += view.getX (); -dirty.y += view.getY (); -var clip = g.getClipBounds (); -if (clip == null) { -g.setClip (0, 0, this.getWidth (), this.getHeight ()); -}g.clipRect (dirty.x, dirty.y, dirty.width, dirty.height); -clip = g.getClipBounds (); -if (clip.width > 0 && clip.height > 0) { -this.paintView (g); -}}}, "java.awt.Graphics,java.awt.Rectangle"); -Clazz_defineMethod (c$, "windowBlitPaint", - function (g) { -var width = this.getWidth (); -var height = this.getHeight (); -if ((width == 0) || (height == 0)) { -return false; -}var retValue; -var rm = javax.swing.RepaintManager.currentManager (this); -var view = this.getView (); -if (this.lastPaintPosition == null || this.lastPaintPosition.equals (this.getViewLocation ())) { -this.paintView (g); -retValue = false; -} else { -var blitFrom = new java.awt.Point (); -var blitTo = new java.awt.Point (); -var blitSize = new java.awt.Dimension (); -var blitPaint = new java.awt.Rectangle (); -var newLocation = this.getViewLocation (); -var dx = newLocation.x - this.lastPaintPosition.x; -var dy = newLocation.y - this.lastPaintPosition.y; -var canBlit = this.computeBlit (dx, dy, blitFrom, blitTo, blitSize, blitPaint); -if (!canBlit) { -this.paintView (g); -retValue = false; -} else { -var r = view.getBounds ().intersection (blitPaint); -r.x -= view.getX (); -r.y -= view.getY (); -this.blitDoubleBuffered (view, g, r.x, r.y, r.width, r.height, blitFrom.x, blitFrom.y, blitTo.x, blitTo.y, blitSize.width, blitSize.height); -retValue = true; -}}this.lastPaintPosition = this.getViewLocation (); -return retValue; -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "blitDoubleBuffered", - function (view, g, clipX, clipY, clipW, clipH, blitFromX, blitFromY, blitToX, blitToY, blitW, blitH) { -var rm = javax.swing.RepaintManager.currentManager (this); -var bdx = blitToX - blitFromX; -var bdy = blitToY - blitFromY; -var x = view.getX (); -var y = view.getY (); -g.translate (x, y); -g.setClip (clipX, clipY, clipW, clipH); -view.paintForceDoubleBuffered (g); -g.translate (-x, -y); -}, "javax.swing.JComponent,java.awt.Graphics,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paintView", - function (g) { -var clip = g.getClipBounds (); -var view = this.getView (); -if (view.getWidth () >= this.getWidth ()) { -var x = view.getX (); -var y = view.getY (); -g.translate (x, y); -g.setClip (clip.x - x, clip.y - y, clip.width, clip.height); -view.paintForceDoubleBuffered (g); -g.translate (-x, -y); -g.setClip (clip.x, clip.y, clip.width, clip.height); -} else { -try { -this.inBlitPaint = true; -this.paintForceDoubleBuffered (g); -} finally { -this.inBlitPaint = false; -} -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "canUseWindowBlitter", - function () { -if (!this.isShowing () || (!(Clazz_instanceOf (this.getParent (), javax.swing.JComponent)) && !(Clazz_instanceOf (this.getView (), javax.swing.JComponent)))) { -return false; -}if (this.isPainting ()) { -return false; -}var dirtyRegion = javax.swing.RepaintManager.currentManager (this).getDirtyRegion (this.getParent ()); -if (dirtyRegion != null && dirtyRegion.width > 0 && dirtyRegion.height > 0) { -return false; -}var clip = new java.awt.Rectangle (0, 0, this.getWidth (), this.getHeight ()); -var oldClip = new java.awt.Rectangle (); -var tmp2 = null; -var parent; -var lastParent = null; -var x; -var y; -var w; -var h; -for (parent = this; parent != null && javax.swing.JComponent.isLightweightComponent (parent); parent = parent.getParent ()) { -x = parent.getX (); -y = parent.getY (); -w = parent.getWidth (); -h = parent.getHeight (); -oldClip.setBounds (clip); -javax.swing.SwingUtilities.computeIntersection (0, 0, w, h, clip); -if (!clip.equals (oldClip)) return false; -if (lastParent != null && Clazz_instanceOf (parent, javax.swing.JComponent) && !(parent).isOptimizedDrawingEnabled ()) { -var comps = parent.getComponents (); -var index = 0; -for (var i = comps.length - 1; i >= 0; i--) { -if (comps[i] === lastParent) { -index = i - 1; -break; -}} -while (index >= 0) { -tmp2 = comps[index].getBounds (tmp2); -if (tmp2.intersects (clip)) return false; -index--; -} -}clip.x += x; -clip.y += y; -lastParent = parent; -} -if (parent == null) { -return false; -}return true; -}); -c$.$JViewport$ViewListener$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -Clazz_instantialize (this, arguments); -}, javax.swing.JViewport, "ViewListener", java.awt.event.ComponentAdapter); -Clazz_overrideMethod (c$, "componentResized", -function (a) { -this.b$["javax.swing.JViewport"].fireStateChanged (); -this.b$["javax.swing.JViewport"].revalidate (); -}, "java.awt.event.ComponentEvent"); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"$uiClassID", "ViewportUI", -"EnableWindowBlit", "EnableWindowBlit", -"BLIT_SCROLL_MODE", 1, -"BACKINGSTORE_SCROLL_MODE", 2, -"SIMPLE_SCROLL_MODE", 0); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.ComponentListener"], "java.awt.event.ComponentAdapter", null, function () { -c$ = Clazz_declareType (java.awt.event, "ComponentAdapter", null, java.awt.event.ComponentListener); -Clazz_overrideMethod (c$, "componentResized", -function (e) { -}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "componentMoved", -function (e) { -}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "componentShown", -function (e) { -}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "componentHidden", -function (e) { -}, "java.awt.event.ComponentEvent"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Container"], "javax.swing.CellRendererPane", null, function () { -c$ = Clazz_declareType (javax.swing, "CellRendererPane", java.awt.Container); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.CellRendererPane); -this.setLayout (null); -this.setVisible (false); -}); -Clazz_overrideMethod (c$, "invalidate", -function () { -}); -Clazz_overrideMethod (c$, "paint", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "update", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "addImpl", -function (x, constraints, index) { -if (x.getParent () === this) { -return null; -} else { -return this.addImplSAEM (x, constraints, index); -}}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "paintComponent", -function (g, c, p, x, y, w, h, shouldValidate) { -if (c == null) { -if (p != null) { -var oldColor = g.getColor (); -g.setColor (p.getBackground ()); -g.fillRect (x, y, w, h); -g.setColor (oldColor); -}return; -}if (c.getParent () !== this) { -this.add (c); -}c.setBounds (x, y, w, h); -if (shouldValidate) { -c.validate (); -}var cg = g.create4 (x, y, w, h); -try { -c.paint (cg); -} finally { -cg.dispose (); -} -c.setBounds (-w, -h, 0, 0); -}, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N,~B"); -Clazz_defineMethod (c$, "paintComponent", -function (g, c, p, x, y, w, h) { -this.paintComponent (g, c, p, x, y, w, h, false); -}, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paintComponent", -function (g, c, p, r) { -this.paintComponent (g, c, p, r.x, r.y, r.width, r.height); -}, "java.awt.Graphics,java.awt.Component,java.awt.Container,java.awt.Rectangle"); -}); -Clazz_declarePackage ("jssun.awt"); -c$ = Clazz_declareType (jssun.awt, "AWTAccessor"); -c$.setWindowAccessor = Clazz_defineMethod (c$, "setWindowAccessor", -function (wa) { -jssun.awt.AWTAccessor.windowAccessor = wa; -}, "jssun.awt.AWTAccessor.WindowAccessor"); -c$.getWindowAccessor = Clazz_defineMethod (c$, "getWindowAccessor", -function () { -return jssun.awt.AWTAccessor.windowAccessor; -}); -c$.setComponentAccessor = Clazz_defineMethod (c$, "setComponentAccessor", -function (ca) { -jssun.awt.AWTAccessor.componentAccessor = ca; -}, "jssun.awt.AWTAccessor.ComponentAccessor"); -c$.getComponentAccessor = Clazz_defineMethod (c$, "getComponentAccessor", -function () { -return jssun.awt.AWTAccessor.componentAccessor; -}); -c$.setAWTEventAccessor = Clazz_defineMethod (c$, "setAWTEventAccessor", -function (aea) { -jssun.awt.AWTAccessor.awtEventAccessor = aea; -}, "jssun.awt.AWTAccessor.AWTEventAccessor"); -c$.getAWTEventAccessor = Clazz_defineMethod (c$, "getAWTEventAccessor", -function () { -return jssun.awt.AWTAccessor.awtEventAccessor; -}); -c$.setEventQueueAccessor = Clazz_defineMethod (c$, "setEventQueueAccessor", -function (eqa) { -jssun.awt.AWTAccessor.eventQueueAccessor = eqa; -}, "jssun.awt.AWTAccessor.EventQueueAccessor"); -c$.getEventQueueAccessor = Clazz_defineMethod (c$, "getEventQueueAccessor", -function () { -return jssun.awt.AWTAccessor.eventQueueAccessor; -}); -Clazz_declareInterface (jssun.awt.AWTAccessor, "WindowAccessor"); -Clazz_declareInterface (jssun.awt.AWTAccessor, "ComponentAccessor"); -Clazz_declareInterface (jssun.awt.AWTAccessor, "KeyboardFocusManagerAccessor"); -Clazz_declareInterface (jssun.awt.AWTAccessor, "AWTEventAccessor"); -Clazz_declareInterface (jssun.awt.AWTAccessor, "EventQueueAccessor"); -Clazz_declareInterface (jssun.awt.AWTAccessor, "CursorAccessor"); -Clazz_declareInterface (jssun.awt.AWTAccessor, "ClientPropertyKeyAccessor"); -Clazz_defineStatics (c$, -"componentAccessor", null, -"windowAccessor", null, -"awtEventAccessor", null, -"eventQueueAccessor", null); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.LayoutManager"], "javax.swing.ViewportLayout", ["java.awt.Dimension", "javax.swing.Scrollable"], function () { -c$ = Clazz_declareType (javax.swing, "ViewportLayout", null, java.awt.LayoutManager); -Clazz_overrideMethod (c$, "addLayoutComponent", -function (name, c) { -}, "~S,java.awt.Component"); -Clazz_overrideMethod (c$, "removeLayoutComponent", -function (c) { -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "preferredLayoutSize", -function (parent) { -var view = (parent).getView (); -if (view == null) { -return new java.awt.Dimension (0, 0); -} else if (Clazz_instanceOf (view, javax.swing.Scrollable)) { -return (view).getPreferredScrollableViewportSize (); -} else { -return view.getPreferredSize (); -}}, "java.awt.Container"); -Clazz_overrideMethod (c$, "minimumLayoutSize", -function (parent) { -return new java.awt.Dimension (4, 4); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "layoutContainer", -function (parent) { -var vp = parent; -var view = vp.getView (); -var scrollableView = null; -if (view == null) { -return; -} else if (Clazz_instanceOf (view, javax.swing.Scrollable)) { -scrollableView = view; -}var insets = vp.getInsets (); -var viewPrefSize = view.getPreferredSize (); -var vpSize = vp.getSize (); -var extentSize = vp.toViewCoordinates (vpSize); -var viewSize = new java.awt.Dimension (viewPrefSize); -if (scrollableView != null) { -if (scrollableView.getScrollableTracksViewportWidth ()) { -viewSize.width = vpSize.width; -}if (scrollableView.getScrollableTracksViewportHeight ()) { -viewSize.height = vpSize.height; -}}var viewPosition = vp.getViewPosition (); -if (scrollableView == null || vp.getParent () == null || vp.getParent ().getComponentOrientation ().isLeftToRight ()) { -if ((viewPosition.x + extentSize.width) > viewSize.width) { -viewPosition.x = Math.max (0, viewSize.width - extentSize.width); -}} else { -if (extentSize.width > viewSize.width) { -viewPosition.x = viewSize.width - extentSize.width; -} else { -viewPosition.x = Math.max (0, Math.min (viewSize.width - extentSize.width, viewPosition.x)); -}}if ((viewPosition.y + extentSize.height) > viewSize.height) { -viewPosition.y = Math.max (0, viewSize.height - extentSize.height); -}if (scrollableView == null) { -if ((viewPosition.x == 0) && (vpSize.width > viewPrefSize.width)) { -viewSize.width = vpSize.width; -}if ((viewPosition.y == 0) && (vpSize.height > viewPrefSize.height)) { -viewSize.height = vpSize.height; -}}vp.setViewPosition (viewPosition); -vp.setViewSize (viewSize); -}, "java.awt.Container"); -c$.SHARED_INSTANCE = c$.prototype.SHARED_INSTANCE = new javax.swing.ViewportLayout (); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.CaretListener", null, function () { -Clazz_declareInterface (javax.swing.event, "CaretListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.BoundedRangeModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultBoundedRangeModel", ["java.lang.IllegalArgumentException", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.changeEvent = null; -this.listenerList = null; -this.value = 0; -this.extent = 0; -this.min = 0; -this.max = 100; -this.isAdjusting = false; -Clazz_instantialize (this, arguments); -}, javax.swing, "DefaultBoundedRangeModel", null, javax.swing.BoundedRangeModel); -Clazz_prepareFields (c$, function () { -this.listenerList = new javax.swing.event.EventListenerList (); -}); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_makeConstructor (c$, -function (value, extent, min, max) { -if ((max >= min) && (value >= min) && ((value + extent) >= value) && ((value + extent) <= max)) { -this.value = value; -this.extent = extent; -this.min = min; -this.max = max; -} else { -throw new IllegalArgumentException ("invalid range properties"); -}}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getValue", -function () { -return this.value; -}); -Clazz_overrideMethod (c$, "getExtent", -function () { -return this.extent; -}); -Clazz_overrideMethod (c$, "getMinimum", -function () { -return this.min; -}); -Clazz_overrideMethod (c$, "getMaximum", -function () { -return this.max; -}); -Clazz_overrideMethod (c$, "setValue", -function (n) { -n = Math.min (n, 2147483647 - this.extent); -var newValue = Math.max (n, this.min); -if (newValue + this.extent > this.max) { -newValue = this.max - this.extent; -}this.setRangeProperties (newValue, this.extent, this.min, this.max, this.isAdjusting); -}, "~N"); -Clazz_overrideMethod (c$, "setExtent", -function (n) { -var newExtent = Math.max (0, n); -if (this.value + newExtent > this.max) { -newExtent = this.max - this.value; -}this.setRangeProperties (this.value, newExtent, this.min, this.max, this.isAdjusting); -}, "~N"); -Clazz_overrideMethod (c$, "setMinimum", -function (n) { -var newMax = Math.max (n, this.max); -var newValue = Math.max (n, this.value); -var newExtent = Math.min (newMax - newValue, this.extent); -this.setRangeProperties (newValue, newExtent, n, newMax, this.isAdjusting); -}, "~N"); -Clazz_overrideMethod (c$, "setMaximum", -function (n) { -var newMin = Math.min (n, this.min); -var newExtent = Math.min (n - newMin, this.extent); -var newValue = Math.min (n - newExtent, this.value); -this.setRangeProperties (newValue, newExtent, newMin, n, this.isAdjusting); -}, "~N"); -Clazz_overrideMethod (c$, "setValueIsAdjusting", -function (b) { -this.setRangeProperties (this.value, this.extent, this.min, this.max, b); -}, "~B"); -Clazz_overrideMethod (c$, "getValueIsAdjusting", -function () { -return this.isAdjusting; -}); -Clazz_overrideMethod (c$, "setRangeProperties", -function (newValue, newExtent, newMin, newMax, adjusting) { -if (newMin > newMax) { -newMin = newMax; -}if (newValue > newMax) { -newMax = newValue; -}if (newValue < newMin) { -newMin = newValue; -}if ((newExtent + newValue) > newMax) { -newExtent = newMax - newValue; -}if (newExtent < 0) { -newExtent = 0; -}var isChange = (newValue != this.value) || (newExtent != this.extent) || (newMin != this.min) || (newMax != this.max) || (adjusting != this.isAdjusting); -if (isChange) { -this.value = newValue; -this.extent = newExtent; -this.min = newMin; -this.max = newMax; -this.isAdjusting = adjusting; -this.fireStateChanged (); -}}, "~N,~N,~N,~N,~B"); -Clazz_overrideMethod (c$, "addChangeListener", -function (l) { -this.listenerList.add (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_overrideMethod (c$, "removeChangeListener", -function (l) { -this.listenerList.remove (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "getChangeListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.ChangeListener); -}); -Clazz_defineMethod (c$, "fireStateChanged", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.ChangeListener) { -if (this.changeEvent == null) { -this.changeEvent = new javax.swing.event.ChangeEvent (this); -}(listeners[i + 1]).stateChanged (this.changeEvent); -}} -}); -Clazz_overrideMethod (c$, "toString", -function () { -var modelString = "value=" + this.getValue () + ", " + "extent=" + this.getExtent () + ", " + "min=" + this.getMinimum () + ", " + "max=" + this.getMaximum () + ", " + "adj=" + this.getValueIsAdjusting (); -return this.getClass ().getName () + "[" + modelString + "]"; -}); -Clazz_defineMethod (c$, "getListeners", -function (listenerType) { -return this.listenerList.getListeners (listenerType); -}, "Class"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "BoundedRangeModel"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.AWTKeyStroke"], "javax.swing.KeyStroke", null, function () { -c$ = Clazz_declareType (javax.swing, "KeyStroke", java.awt.AWTKeyStroke); -c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", -function (keyChar) { -{ -java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); -return java.awt.AWTKeyStroke.getAWTKeyStroke (keyChar); -}}, "~S"); -c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", -function (keyChar, onKeyRelease) { -return new javax.swing.KeyStroke (keyChar, 0, 0, onKeyRelease); -}, "~S,~B"); -c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", -function (keyChar, modifiers) { -{ -java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); -return java.awt.AWTKeyStroke.getAWTKeyStroke (keyChar, modifiers); -}}, "Character,~N"); -c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", -function (keyCode, modifiers, onKeyRelease) { -{ -java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); -return java.awt.AWTKeyStroke.getAWTKeyStroke (keyCode, modifiers, onKeyRelease); -}}, "~N,~N,~B"); -c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", -function (keyCode, modifiers) { -{ -java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); -return java.awt.AWTKeyStroke.getAWTKeyStroke (keyCode, modifiers); -}}, "~N,~N"); -c$.getKeyStrokeForEvent = Clazz_defineMethod (c$, "getKeyStrokeForEvent", -function (anEvent) { -{ -java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); -return java.awt.AWTKeyStroke.getAWTKeyStrokeForEvent (anEvent); -}}, "java.awt.event.KeyEvent"); -c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", -function (s) { -if (s == null || s.length == 0) { -return null; -}{ -java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); -try { -return java.awt.AWTKeyStroke.getAWTKeyStroke (s); -} catch (e) { -if (Clazz_exceptionOf (e, IllegalArgumentException)) { -return null; -} else { -throw e; -} -} -}}, "~S"); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (null, ["java.awt.AWTKeyStroke", "$.VKCollection"], ["java.io.ObjectStreamException", "java.lang.IllegalArgumentException", "$.StringBuilder", "java.util.Collections", "$.HashMap", "$.StringTokenizer", "java.awt.event.KeyEvent", "jssun.awt.AppContext"], function () { -c$ = Clazz_decorateAsClass (function () { -this.keyChar = '\uffff'; -this.keyCode = 0; -this.modifiers = 0; -this.onKeyRelease = false; -Clazz_instantialize (this, arguments); -}, java.awt, "AWTKeyStroke"); -c$.getAWTKeyStrokeClass = Clazz_defineMethod (c$, "getAWTKeyStrokeClass", - function () { -var clazz = jssun.awt.AppContext.getAppContext ().get (java.awt.AWTKeyStroke); -if (clazz == null) { -clazz = java.awt.AWTKeyStroke; -jssun.awt.AppContext.getAppContext ().put (java.awt.AWTKeyStroke, java.awt.AWTKeyStroke); -}return clazz; -}); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_makeConstructor (c$, -function (keyChar, keyCode, modifiers, onKeyRelease) { -this.keyChar = keyChar; -this.keyCode = keyCode; -this.modifiers = modifiers; -this.onKeyRelease = onKeyRelease; -}, "~S,~N,~N,~B"); -c$.registerSubclass = Clazz_defineMethod (c$, "registerSubclass", -function (subclass) { -}, "Class"); -c$.getCachedStroke = Clazz_defineMethod (c$, "getCachedStroke", - function (keyChar, keyCode, modifiers, onKeyRelease) { -return null; -}, "~S,~N,~N,~B"); -c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", -function (keyChar) { -return java.awt.AWTKeyStroke.getCachedStroke (keyChar, 0, 0, false); -}, "~S"); -c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", -function (keyChar, modifiers) { -if (keyChar == null) { -throw new IllegalArgumentException ("keyChar cannot be null"); -}return java.awt.AWTKeyStroke.getCachedStroke (keyChar.charValue (), 0, modifiers, false); -}, "Character,~N"); -c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", -function (keyCode, modifiers, onKeyRelease) { -return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', keyCode, modifiers, onKeyRelease); -}, "~N,~N,~B"); -c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", -function (keyCode, modifiers) { -return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', keyCode, modifiers, false); -}, "~N,~N"); -c$.getAWTKeyStrokeForEvent = Clazz_defineMethod (c$, "getAWTKeyStrokeForEvent", -function (anEvent) { -var id = anEvent.getID (); -switch (id) { -case 401: -case 402: -return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', anEvent.getKeyCode (), anEvent.getModifiers (), (id == 402)); -case 400: -return java.awt.AWTKeyStroke.getCachedStroke (anEvent.getKeyChar (), 0, anEvent.getModifiers (), false); -default: -return null; -} -}, "java.awt.event.KeyEvent"); -c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", -function (s) { -if (s == null) { -throw new IllegalArgumentException ("String cannot be null"); -}var errmsg = "String formatted incorrectly"; -var st = new java.util.StringTokenizer (s, " "); -var mask = 0; -var released = false; -var typed = false; -var pressed = false; -{ -if (java.awt.AWTKeyStroke.modifierKeywords == null) { -var uninitializedMap = new java.util.HashMap (8, 1.0); -uninitializedMap.put ("shift", Integer.$valueOf (65)); -uninitializedMap.put ("control", Integer.$valueOf (130)); -uninitializedMap.put ("ctrl", Integer.$valueOf (130)); -uninitializedMap.put ("meta", Integer.$valueOf (260)); -uninitializedMap.put ("alt", Integer.$valueOf (520)); -uninitializedMap.put ("altGraph", Integer.$valueOf (8224)); -uninitializedMap.put ("button1", Integer.$valueOf (1024)); -uninitializedMap.put ("button2", Integer.$valueOf (2048)); -uninitializedMap.put ("button3", Integer.$valueOf (4096)); -java.awt.AWTKeyStroke.modifierKeywords = java.util.Collections.synchronizedMap (uninitializedMap); -}}var count = st.countTokens (); -for (var i = 1; i <= count; i++) { -var token = st.nextToken (); -if (typed) { -if (token.length != 1 || i != count) { -throw new IllegalArgumentException ("String formatted incorrectly"); -}return java.awt.AWTKeyStroke.getCachedStroke (token.charAt (0), 0, mask, false); -}if (pressed || released || i == count) { -if (i != count) { -throw new IllegalArgumentException ("String formatted incorrectly"); -}var keyCodeName = "VK_" + token; -var keyCode = java.awt.AWTKeyStroke.getVKValue (keyCodeName); -return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', keyCode, mask, released); -}if (token.equals ("released")) { -released = true; -continue; -}if (token.equals ("pressed")) { -pressed = true; -continue; -}if (token.equals ("typed")) { -typed = true; -continue; -}var tokenMask = java.awt.AWTKeyStroke.modifierKeywords.get (token); -if (tokenMask != null) { -mask |= tokenMask.intValue (); -} else { -throw new IllegalArgumentException ("String formatted incorrectly"); -}} -throw new IllegalArgumentException ("String formatted incorrectly"); -}, "~S"); -c$.getVKCollection = Clazz_defineMethod (c$, "getVKCollection", - function () { -if (java.awt.AWTKeyStroke.vks == null) { -java.awt.AWTKeyStroke.vks = new java.awt.VKCollection (); -}return java.awt.AWTKeyStroke.vks; -}); -c$.getVKValue = Clazz_defineMethod (c$, "getVKValue", - function (key) { -var vkCollect = java.awt.AWTKeyStroke.getVKCollection (); -var value = vkCollect.findCode (key); -if (value == null) { -var keyCode = 0; -var errmsg = "String formatted incorrectly"; -try { -keyCode = java.awt.event.KeyEvent.getField (key).getInt (java.awt.event.KeyEvent); -} catch (e$$) { -if (Clazz_exceptionOf (e$$, NoSuchFieldException)) { -var nsfe = e$$; -{ -throw new IllegalArgumentException ("String formatted incorrectly"); -} -} else if (Clazz_exceptionOf (e$$, IllegalAccessException)) { -var iae = e$$; -{ -throw new IllegalArgumentException ("String formatted incorrectly"); -} -} else { -throw e$$; -} -} -value = Integer.$valueOf (keyCode); -vkCollect.put (key, value); -}return value.intValue (); -}, "~S"); -Clazz_defineMethod (c$, "getKeyChar", -function () { -return this.keyChar; -}); -Clazz_defineMethod (c$, "getKeyCode", -function () { -return this.keyCode; -}); -Clazz_defineMethod (c$, "getModifiers", -function () { -return this.modifiers; -}); -Clazz_defineMethod (c$, "isOnKeyRelease", -function () { -return this.onKeyRelease; -}); -Clazz_defineMethod (c$, "getKeyEventType", -function () { -if (this.keyCode == 0) { -return 400; -} else { -return (this.onKeyRelease) ? 402 : 401; -}}); -Clazz_overrideMethod (c$, "hashCode", -function () { -return (((this.keyChar).charCodeAt (0)) + 1) * (2 * (this.keyCode + 1)) * (this.modifiers + 1) + (this.onKeyRelease ? 1 : 2); -}); -Clazz_defineMethod (c$, "equals", -function (anObject) { -if (Clazz_instanceOf (anObject, java.awt.AWTKeyStroke)) { -var ks = anObject; -return (ks.keyChar == this.keyChar && ks.keyCode == this.keyCode && ks.onKeyRelease == this.onKeyRelease && ks.modifiers == this.modifiers); -}return false; -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -if (this.keyCode == 0) { -return java.awt.AWTKeyStroke.getModifiersText (this.modifiers) + "typed " + this.keyChar; -} else { -return java.awt.AWTKeyStroke.getModifiersText (this.modifiers) + (this.onKeyRelease ? "released" : "pressed") + " " + java.awt.AWTKeyStroke.getVKText (this.keyCode); -}}); -c$.getModifiersText = Clazz_defineMethod (c$, "getModifiersText", -function (modifiers) { -var buf = new StringBuilder (); -if ((modifiers & 64) != 0) { -buf.append ("shift "); -}if ((modifiers & 128) != 0) { -buf.append ("ctrl "); -}if ((modifiers & 256) != 0) { -buf.append ("meta "); -}if ((modifiers & 512) != 0) { -buf.append ("alt "); -}if ((modifiers & 8192) != 0) { -buf.append ("altGraph "); -}if ((modifiers & 1024) != 0) { -buf.append ("button1 "); -}if ((modifiers & 2048) != 0) { -buf.append ("button2 "); -}if ((modifiers & 4096) != 0) { -buf.append ("button3 "); -}return buf.toString (); -}, "~N"); -c$.getVKText = Clazz_defineMethod (c$, "getVKText", -function (keyCode) { -return "UNKNOWN"; -}, "~N"); -Clazz_defineMethod (c$, "readResolve", -function () { -{ -var newClass = this.getClass (); -var awtKeyStrokeClass = java.awt.AWTKeyStroke.getAWTKeyStrokeClass (); -if (!newClass.equals (awtKeyStrokeClass)) { -java.awt.AWTKeyStroke.registerSubclass (newClass); -}return java.awt.AWTKeyStroke.getCachedStroke (this.keyChar, this.keyCode, this.modifiers, this.onKeyRelease); -}}); -Clazz_defineStatics (c$, -"modifierKeywords", null, -"vks", null); -c$ = Clazz_decorateAsClass (function () { -this.code2name = null; -this.name2code = null; -Clazz_instantialize (this, arguments); -}, java.awt, "VKCollection"); -Clazz_makeConstructor (c$, -function () { -this.code2name = new java.util.HashMap (); -this.name2code = new java.util.HashMap (); -}); -Clazz_defineMethod (c$, "put", -function (name, code) { -this.code2name.put (code, name); -this.name2code.put (name, code); -}, "~S,Integer"); -Clazz_defineMethod (c$, "findCode", -function (name) { -return this.name2code.get (name); -}, "~S"); -Clazz_defineMethod (c$, "findName", -function (code) { -return this.code2name.get (code); -}, "Integer"); -}); -Clazz_load(["java.util.Enumeration"],"java.util.StringTokenizer",["java.lang.NullPointerException","java.util.NoSuchElementException"],function(){ -c$=Clazz_decorateAsClass(function(){ -this.string=null; -this.delimiters=null; -this.returnDelimiters=false; -this.position=0; -Clazz_instantialize(this,arguments); -},java.util,"StringTokenizer",null,java.util.Enumeration); -Clazz_makeConstructor(c$, -function(string){ -this.construct(string," \t\n\r\f",false); -},"~S"); -Clazz_makeConstructor(c$, -function(string,delimiters){ -this.construct(string,delimiters,false); -},"~S,~S"); -Clazz_makeConstructor(c$, -function(string,delimiters,returnDelimiters){ -if(string!=null){ -this.string=string; -this.delimiters=delimiters; -this.returnDelimiters=returnDelimiters; -this.position=0; -}else throw new NullPointerException(); -},"~S,~S,~B"); -Clazz_defineMethod(c$,"countTokens", -function(){ -var count=0; -var inToken=false; -for(var i=this.position,length=this.string.length;i=0){ -if(this.returnDelimiters)count++; -if(inToken){ -count++; -inToken=false; -}}else{ -inToken=true; -}} -if(inToken)count++; -return count; -}); -Clazz_overrideMethod(c$,"hasMoreElements", -function(){ -return this.hasMoreTokens(); -}); -Clazz_defineMethod(c$,"hasMoreTokens", -function(){ -var length=this.string.length; -if(this.position=0)return String.valueOf(this.string.charAt(this.position++)); -for(this.position++;this.position=0)return this.string.substring(i,this.position); - -return this.string.substring(i); -}while(i=0)i++; - -this.position=i; -if(i=0)return this.string.substring(i,this.position); - -return this.string.substring(i); -}}throw new java.util.NoSuchElementException(); -}); -Clazz_defineMethod(c$,"nextToken", -function(delims){ -this.delimiters=delims; -return this.nextToken(); -},"~S"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.InputMap"], "javax.swing.ComponentInputMap", ["java.lang.IllegalArgumentException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.component = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "ComponentInputMap", javax.swing.InputMap); -Clazz_makeConstructor (c$, -function (component) { -Clazz_superConstructor (this, javax.swing.ComponentInputMap, []); -this.component = component; -if (component == null) { -throw new IllegalArgumentException ("ComponentInputMaps must be associated with a non-null JComponent"); -}}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "setParent", -function (map) { -if (this.getParent () === map) { -return; -}if (map != null && (!(Clazz_instanceOf (map, javax.swing.ComponentInputMap)) || (map).getComponent () !== this.getComponent ())) { -throw new IllegalArgumentException ("ComponentInputMaps must have a parent ComponentInputMap associated with the same component"); -}Clazz_superCall (this, javax.swing.ComponentInputMap, "setParent", [map]); -this.getComponent ().componentInputMapChanged (this); -}, "javax.swing.InputMap"); -Clazz_defineMethod (c$, "getComponent", -function () { -return this.component; -}); -Clazz_defineMethod (c$, "put", -function (keyStroke, actionMapKey) { -Clazz_superCall (this, javax.swing.ComponentInputMap, "put", [keyStroke, actionMapKey]); -if (this.getComponent () != null) { -this.getComponent ().componentInputMapChanged (this); -}}, "javax.swing.KeyStroke,~O"); -Clazz_defineMethod (c$, "remove", -function (key) { -Clazz_superCall (this, javax.swing.ComponentInputMap, "remove", [key]); -if (this.getComponent () != null) { -this.getComponent ().componentInputMapChanged (this); -}}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "clear", -function () { -var oldSize = this.size (); -Clazz_superCall (this, javax.swing.ComponentInputMap, "clear", []); -if (oldSize > 0 && this.getComponent () != null) { -this.getComponent ().componentInputMapChanged (this); -}}); -}); -Clazz_declarePackage ("jssun.swing"); -Clazz_load (["javax.swing.LayoutStyle"], "jssun.swing.DefaultLayoutStyle", ["java.lang.IllegalArgumentException", "$.NullPointerException", "javax.swing.Icon", "$.JCheckBox", "$.JLabel", "$.JRadioButton", "$.UIManager", "javax.swing.plaf.UIResource"], function () { -c$ = Clazz_declareType (jssun.swing, "DefaultLayoutStyle", javax.swing.LayoutStyle); -c$.getInstance = Clazz_overrideMethod (c$, "getInstance", -function () { -return jssun.swing.DefaultLayoutStyle.INSTANCE; -}); -Clazz_overrideMethod (c$, "getPreferredGap", -function (component1, component2, type, position, parent) { -if (component1 == null || component2 == null || type == null) { -throw new NullPointerException (); -}this.checkPosition (position); -if (type === javax.swing.LayoutStyle.ComponentPlacement.INDENT && (position == 3 || position == 7)) { -var indent = this.getIndent (component1, position); -if (indent > 0) { -return indent; -}}return (type === javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) ? 12 : 6; -}, "javax.swing.JComponent,javax.swing.JComponent,javax.swing.LayoutStyle.ComponentPlacement,~N,java.awt.Container"); -Clazz_overrideMethod (c$, "getContainerGap", -function (component, position, parent) { -if (component == null) { -throw new NullPointerException (); -}this.checkPosition (position); -return 6; -}, "javax.swing.JComponent,~N,java.awt.Container"); -Clazz_defineMethod (c$, "isLabelAndNonlabel", -function (c1, c2, position) { -if (position == 3 || position == 7) { -var c1Label = (Clazz_instanceOf (c1, javax.swing.JLabel)); -var c2Label = (Clazz_instanceOf (c2, javax.swing.JLabel)); -return ((c1Label || c2Label) && (c1Label != c2Label)); -}return false; -}, "javax.swing.JComponent,javax.swing.JComponent,~N"); -Clazz_defineMethod (c$, "getButtonGap", -function (source, target, position, offset) { -offset -= this.getButtonGap (source, position); -if (offset > 0) { -offset -= this.getButtonGap (target, this.flipDirection (position)); -}if (offset < 0) { -return 0; -}return offset; -}, "javax.swing.JComponent,javax.swing.JComponent,~N,~N"); -Clazz_defineMethod (c$, "getButtonGap", -function (source, position, offset) { -offset -= this.getButtonGap (source, position); -return Math.max (offset, 0); -}, "javax.swing.JComponent,~N,~N"); -Clazz_defineMethod (c$, "getButtonGap", -function (c, position) { -var classID = c.getUIClassID (); -if ((classID === "CheckBoxUI" || classID === "RadioButtonUI") && !(c).isBorderPainted ()) { -var border = c.getBorder (); -if (Clazz_instanceOf (border, javax.swing.plaf.UIResource)) { -return this.getInset (c, position); -}}return 0; -}, "javax.swing.JComponent,~N"); -Clazz_defineMethod (c$, "checkPosition", - function (position) { -if (position != 1 && position != 5 && position != 7 && position != 3) { -throw new IllegalArgumentException (); -}}, "~N"); -Clazz_defineMethod (c$, "flipDirection", -function (position) { -switch (position) { -case 1: -return 5; -case 5: -return 1; -case 3: -return 7; -case 7: -return 3; -} -return 0; -}, "~N"); -Clazz_defineMethod (c$, "getIndent", -function (c, position) { -var classID = c.getUIClassID (); -if (classID === "CheckBoxUI" || classID === "RadioButtonUI") { -var button = c; -var insets = c.getInsets (); -var icon = this.getIcon (button); -var gap = button.getIconTextGap (); -if (this.isLeftAligned (button, position)) { -return insets.left + icon.getIconWidth () + gap; -} else if (this.isRightAligned (button, position)) { -return insets.right + icon.getIconWidth () + gap; -}}return 0; -}, "javax.swing.JComponent,~N"); -Clazz_defineMethod (c$, "getIcon", - function (button) { -var icon = button.getIcon (); -if (icon != null) { -return icon; -}var key = null; -if (Clazz_instanceOf (button, javax.swing.JCheckBox)) { -key = "CheckBox.icon"; -} else if (Clazz_instanceOf (button, javax.swing.JRadioButton)) { -key = "RadioButton.icon"; -}if (key != null) { -var oIcon = javax.swing.UIManager.get (key); -if (Clazz_instanceOf (oIcon, javax.swing.Icon)) { -return oIcon; -}}return null; -}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "isLeftAligned", - function (button, position) { -if (position == 7) { -var ltr = button.getComponentOrientation ().isLeftToRight (); -var hAlign = button.getHorizontalAlignment (); -return ((ltr && (hAlign == 2 || hAlign == 10)) || (!ltr && (hAlign == 11))); -}return false; -}, "javax.swing.AbstractButton,~N"); -Clazz_defineMethod (c$, "isRightAligned", - function (button, position) { -if (position == 3) { -var ltr = button.getComponentOrientation ().isLeftToRight (); -var hAlign = button.getHorizontalAlignment (); -return ((ltr && (hAlign == 4 || hAlign == 11)) || (!ltr && (hAlign == 10))); -}return false; -}, "javax.swing.AbstractButton,~N"); -Clazz_defineMethod (c$, "getInset", - function (c, position) { -return this.getInset (c.getInsets (), position); -}, "javax.swing.JComponent,~N"); -Clazz_defineMethod (c$, "getInset", - function (insets, position) { -if (insets == null) { -return 0; -}switch (position) { -case 1: -return insets.top; -case 5: -return insets.bottom; -case 3: -return insets.right; -case 7: -return insets.left; -} -return 0; -}, "java.awt.Insets,~N"); -c$.INSTANCE = c$.prototype.INSTANCE = new jssun.swing.DefaultLayoutStyle (); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.lang.Enum"], "javax.swing.LayoutStyle", ["javax.swing.UIManager", "jssun.awt.AppContext"], function () { -c$ = Clazz_declareType (javax.swing, "LayoutStyle"); -c$.setInstance = Clazz_defineMethod (c$, "setInstance", -function (style) { -{ -if (style == null) { -jssun.awt.AppContext.getAppContext ().remove (javax.swing.LayoutStyle); -} else { -jssun.awt.AppContext.getAppContext ().put (javax.swing.LayoutStyle, style); -}}}, "javax.swing.LayoutStyle"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function () { -var style; -{ -style = jssun.awt.AppContext.getAppContext ().get (javax.swing.LayoutStyle); -}if (style == null) { -return javax.swing.UIManager.getLookAndFeel ().getLayoutStyle (); -}return style; -}); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.LayoutStyle, "ComponentPlacement", Enum); -Clazz_defineEnumConstant (c$, "RELATED", 0, []); -Clazz_defineEnumConstant (c$, "UNRELATED", 1, []); -Clazz_defineEnumConstant (c$, "INDENT", 2, []); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JToggleButton"], "javax.swing.JCheckBox", ["java.lang.Boolean", "javax.swing.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.flat = false; -Clazz_instantialize (this, arguments); -}, javax.swing, "JCheckBox", javax.swing.JToggleButton); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, false); -}); -Clazz_makeConstructor (c$, -function (icon) { -this.construct (null, icon, false); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (icon, selected) { -this.construct (null, icon, selected); -}, "javax.swing.Icon,~B"); -Clazz_makeConstructor (c$, -function (text) { -this.construct (text, null, false); -}, "~S"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (text, selected) { -this.construct (text, null, selected); -}, "~S,~B"); -Clazz_makeConstructor (c$, -function (text, icon) { -this.construct (text, icon, false); -}, "~S,javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text, icon, selected) { -Clazz_superConstructor (this, javax.swing.JCheckBox, [text, icon, selected]); -this.setUIProperty ("borderPainted", Boolean.FALSE); -this.setHorizontalAlignment (10); -}, "~S,javax.swing.Icon,~B"); -Clazz_defineMethod (c$, "setBorderPaintedFlat", -function (b) { -var oldValue = this.flat; -this.flat = b; -this.firePropertyChangeBool ("borderPaintedFlat", oldValue, this.flat); -if (b != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "isBorderPaintedFlat", -function () { -return this.flat; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "CheckBoxUI"; -}); -Clazz_overrideMethod (c$, "setIconFromAction", -function (a) { -}, "javax.swing.Action"); -Clazz_defineStatics (c$, -"BORDER_PAINTED_FLAT_CHANGED_PROPERTY", "borderPaintedFlat", -"$$uiClassID", "CheckBoxUI"); -}); -Clazz_declarePackage ("java.awt"); -Clazz_declareInterface (java.awt, "ItemSelectable"); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.AWTEvent"], "java.awt.event.ItemEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.item = null; -this.stateChange = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "ItemEvent", java.awt.AWTEvent); -Clazz_makeConstructor (c$, -function (source, id, item, stateChange) { -Clazz_superConstructor (this, java.awt.event.ItemEvent, [source, id]); -this.item = item; -this.stateChange = stateChange; -}, "java.awt.ItemSelectable,~N,~O,~N"); -Clazz_defineMethod (c$, "getItemSelectable", -function () { -return this.source; -}); -Clazz_defineMethod (c$, "getItem", -function () { -return this.item; -}); -Clazz_defineMethod (c$, "getStateChange", -function () { -return this.stateChange; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 701: -typeStr = "ITEM_STATE_CHANGED"; -break; -default: -typeStr = "unknown type"; -} -var stateStr; -switch (this.stateChange) { -case 1: -stateStr = "SELECTED"; -break; -case 2: -stateStr = "DESELECTED"; -break; -default: -stateStr = "unknown type"; -} -return typeStr + ",item=" + this.item + ",stateChange=" + stateStr; -}); -Clazz_defineStatics (c$, -"ITEM_FIRST", 701, -"ITEM_LAST", 701, -"ITEM_STATE_CHANGED", 701, -"SELECTED", 1, -"DESELECTED", 2); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.ButtonModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultButtonModel", ["java.awt.EventQueue", "java.awt.event.ActionEvent", "$.ActionListener", "$.InputEvent", "$.ItemEvent", "$.ItemListener", "javax.swing.UIManager", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.stateMask = 0; -this.actionCommand = null; -this.group = null; -this.mnemonic = 0; -this.changeEvent = null; -this.listenerList = null; -this.menuItem = false; -Clazz_instantialize (this, arguments); -}, javax.swing, "DefaultButtonModel", null, javax.swing.ButtonModel); -Clazz_prepareFields (c$, function () { -this.listenerList = new javax.swing.event.EventListenerList (); -}); -Clazz_makeConstructor (c$, -function () { -this.stateMask = 0; -this.setEnabled (true); -}); -Clazz_overrideMethod (c$, "setActionCommand", -function (actionCommand) { -this.actionCommand = actionCommand; -}, "~S"); -Clazz_overrideMethod (c$, "getActionCommand", -function () { -return this.actionCommand; -}); -Clazz_overrideMethod (c$, "isArmed", -function () { -return (this.stateMask & 1) != 0; -}); -Clazz_overrideMethod (c$, "isSelected", -function () { -return (this.stateMask & 2) != 0; -}); -Clazz_overrideMethod (c$, "isEnabled", -function () { -return (this.stateMask & 8) != 0; -}); -Clazz_overrideMethod (c$, "isPressed", -function () { -return (this.stateMask & 4) != 0; -}); -Clazz_overrideMethod (c$, "isRollover", -function () { -return (this.stateMask & 16) != 0; -}); -Clazz_overrideMethod (c$, "setArmed", -function (b) { -if (this.isMenuItem () && javax.swing.UIManager.getBoolean ("MenuItem.disabledAreNavigable")) { -if ((this.isArmed () == b)) { -return; -}} else { -if ((this.isArmed () == b) || !this.isEnabled ()) { -return; -}}if (b) { -this.stateMask |= 1; -} else { -this.stateMask &= -2; -}this.fireStateChanged (); -}, "~B"); -Clazz_overrideMethod (c$, "setEnabled", -function (b) { -if (this.isEnabled () == b) { -return; -}if (b) { -this.stateMask |= 8; -} else { -this.stateMask &= -9; -this.stateMask &= -2; -this.stateMask &= -5; -}this.fireStateChanged (); -}, "~B"); -Clazz_overrideMethod (c$, "setSelected", -function (b) { -if (this.isSelected () == b) { -return; -}if (b) { -this.stateMask |= 2; -} else { -this.stateMask &= -3; -}this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this, b ? 1 : 2)); -this.fireStateChanged (); -}, "~B"); -Clazz_overrideMethod (c$, "setPressed", -function (b) { -if ((this.isPressed () == b) || !this.isEnabled ()) { -return; -}if (b) { -this.stateMask |= 4; -} else { -this.stateMask &= -5; -}if (!this.isPressed () && this.isArmed ()) { -var modifiers = 0; -var currentEvent = java.awt.EventQueue.getCurrentEvent (); -if (Clazz_instanceOf (currentEvent, java.awt.event.InputEvent)) { -modifiers = (currentEvent).getModifiers (); -} else if (Clazz_instanceOf (currentEvent, java.awt.event.ActionEvent)) { -modifiers = (currentEvent).getModifiers (); -}this.fireActionPerformed ( new java.awt.event.ActionEvent (this, 1001, this.getActionCommand (), java.awt.EventQueue.getMostRecentEventTime (), modifiers)); -}this.fireStateChanged (); -}, "~B"); -Clazz_overrideMethod (c$, "setRollover", -function (b) { -if ((this.isRollover () == b) || !this.isEnabled ()) { -return; -}if (b) { -this.stateMask |= 16; -} else { -this.stateMask &= -17; -}this.fireStateChanged (); -}, "~B"); -Clazz_overrideMethod (c$, "setMnemonic", -function (key) { -this.mnemonic = key; -this.fireStateChanged (); -}, "~N"); -Clazz_overrideMethod (c$, "getMnemonic", -function () { -return this.mnemonic; -}); -Clazz_overrideMethod (c$, "addChangeListener", -function (l) { -this.listenerList.add (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_overrideMethod (c$, "removeChangeListener", -function (l) { -this.listenerList.remove (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "getChangeListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.ChangeListener); -}); -Clazz_defineMethod (c$, "fireStateChanged", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.ChangeListener) { -if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); -(listeners[i + 1]).stateChanged (this.changeEvent); -}} -}); -Clazz_overrideMethod (c$, "addActionListener", -function (l) { -this.listenerList.add (java.awt.event.ActionListener, l); -}, "java.awt.event.ActionListener"); -Clazz_overrideMethod (c$, "removeActionListener", -function (l) { -this.listenerList.remove (java.awt.event.ActionListener, l); -}, "java.awt.event.ActionListener"); -Clazz_defineMethod (c$, "getActionListeners", -function () { -return this.listenerList.getListeners (java.awt.event.ActionListener); -}); -Clazz_defineMethod (c$, "fireActionPerformed", -function (e) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === java.awt.event.ActionListener) { -(listeners[i + 1]).actionPerformed (e); -}} -}, "java.awt.event.ActionEvent"); -Clazz_overrideMethod (c$, "addItemListener", -function (l) { -this.listenerList.add (java.awt.event.ItemListener, l); -}, "java.awt.event.ItemListener"); -Clazz_overrideMethod (c$, "removeItemListener", -function (l) { -this.listenerList.remove (java.awt.event.ItemListener, l); -}, "java.awt.event.ItemListener"); -Clazz_defineMethod (c$, "getItemListeners", -function () { -return this.listenerList.getListeners (java.awt.event.ItemListener); -}); -Clazz_defineMethod (c$, "fireItemStateChanged", -function (e) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === java.awt.event.ItemListener) { -(listeners[i + 1]).itemStateChanged (e); -}} -}, "java.awt.event.ItemEvent"); -Clazz_defineMethod (c$, "getListeners", -function (listenerType) { -return this.listenerList.getListeners (listenerType); -}, "Class"); -Clazz_overrideMethod (c$, "getSelectedObjects", -function () { -return null; -}); -Clazz_overrideMethod (c$, "setGroup", -function (group) { -this.group = group; -}, "javax.swing.ButtonGroup"); -Clazz_defineMethod (c$, "getGroup", -function () { -return this.group; -}); -Clazz_defineMethod (c$, "isMenuItem", -function () { -return this.menuItem; -}); -Clazz_defineMethod (c$, "setMenuItem", -function (menuItem) { -this.menuItem = menuItem; -}, "~B"); -Clazz_defineStatics (c$, -"ARMED", 1, -"SELECTED", 2, -"PRESSED", 4, -"ENABLED", 8, -"ROLLOVER", 16); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.LayoutManager2"], "javax.swing.OverlayLayout", ["java.awt.AWTError", "$.Dimension", "javax.swing.SizeRequirements"], function () { -c$ = Clazz_decorateAsClass (function () { -this.target = null; -this.xChildren = null; -this.yChildren = null; -this.xTotal = null; -this.yTotal = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "OverlayLayout", null, java.awt.LayoutManager2); -Clazz_makeConstructor (c$, -function (target) { -this.target = target; -}, "java.awt.Container"); -Clazz_defineMethod (c$, "getTarget", -function () { -return this.target; -}); -Clazz_overrideMethod (c$, "invalidateLayout", -function (target) { -this.checkContainer (target); -this.xChildren = null; -this.yChildren = null; -this.xTotal = null; -this.yTotal = null; -}, "java.awt.Container"); -Clazz_defineMethod (c$, "addLayoutComponent", -function (name, comp) { -this.invalidateLayout (comp.getParent ()); -}, "~S,java.awt.Component"); -Clazz_overrideMethod (c$, "removeLayoutComponent", -function (comp) { -this.invalidateLayout (comp.getParent ()); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "addLayoutComponent", -function (comp, constraints) { -this.invalidateLayout (comp.getParent ()); -}, "java.awt.Component,~O"); -Clazz_overrideMethod (c$, "preferredLayoutSize", -function (target) { -this.checkContainer (target); -this.checkRequests (); -var size = new java.awt.Dimension (this.xTotal.preferred, this.yTotal.preferred); -var insets = target.getInsets (); -size.width += insets.left + insets.right; -size.height += insets.top + insets.bottom; -return size; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "minimumLayoutSize", -function (target) { -this.checkContainer (target); -this.checkRequests (); -var size = new java.awt.Dimension (this.xTotal.minimum, this.yTotal.minimum); -var insets = target.getInsets (); -size.width += insets.left + insets.right; -size.height += insets.top + insets.bottom; -return size; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "maximumLayoutSize", -function (target) { -this.checkContainer (target); -this.checkRequests (); -var size = new java.awt.Dimension (this.xTotal.maximum, this.yTotal.maximum); -var insets = target.getInsets (); -size.width += insets.left + insets.right; -size.height += insets.top + insets.bottom; -return size; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayoutAlignmentX", -function (target) { -this.checkContainer (target); -this.checkRequests (); -return this.xTotal.alignment; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayoutAlignmentY", -function (target) { -this.checkContainer (target); -this.checkRequests (); -return this.yTotal.alignment; -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "layoutContainer", -function (target) { -this.checkContainer (target); -this.checkRequests (); -var nChildren = target.getComponentCount (); -var xOffsets = Clazz_newIntArray (nChildren, 0); -var xSpans = Clazz_newIntArray (nChildren, 0); -var yOffsets = Clazz_newIntArray (nChildren, 0); -var ySpans = Clazz_newIntArray (nChildren, 0); -var alloc = target.getSize (); -var $in = target.getInsets (); -alloc.width -= $in.left + $in.right; -alloc.height -= $in.top + $in.bottom; -javax.swing.SizeRequirements.calculateAlignedPositions (alloc.width, this.xTotal, this.xChildren, xOffsets, xSpans); -javax.swing.SizeRequirements.calculateAlignedPositions (alloc.height, this.yTotal, this.yChildren, yOffsets, ySpans); -for (var i = 0; i < nChildren; i++) { -var c = target.getComponent (i); -c.setBounds ($in.left + xOffsets[i], $in.top + yOffsets[i], xSpans[i], ySpans[i]); -} -}, "java.awt.Container"); -Clazz_defineMethod (c$, "checkContainer", -function (target) { -if (this.target !== target) { -throw new java.awt.AWTError ("OverlayLayout can't be shared"); -}}, "java.awt.Container"); -Clazz_defineMethod (c$, "checkRequests", -function () { -if (this.xChildren == null || this.yChildren == null) { -var n = this.target.getComponentCount (); -this.xChildren = new Array (n); -this.yChildren = new Array (n); -for (var i = 0; i < n; i++) { -var c = this.target.getComponent (i); -var min = c.getMinimumSize (); -var typ = c.getPreferredSize (); -var max = c.getMaximumSize (); -this.xChildren[i] = new javax.swing.SizeRequirements (min.width, typ.width, max.width, c.getAlignmentX ()); -this.yChildren[i] = new javax.swing.SizeRequirements (min.height, typ.height, max.height, c.getAlignmentY ()); -} -this.xTotal = javax.swing.SizeRequirements.getAlignedSizeRequirements (this.xChildren); -this.yTotal = javax.swing.SizeRequirements.getAlignedSizeRequirements (this.yChildren); -}}); -}); -Clazz_declarePackage ("javax.swing"); -c$ = Clazz_decorateAsClass (function () { -this.minimum = 0; -this.preferred = 0; -this.maximum = 0; -this.alignment = 0; -Clazz_instantialize (this, arguments); -}, javax.swing, "SizeRequirements"); -Clazz_makeConstructor (c$, -function () { -this.minimum = 0; -this.preferred = 0; -this.maximum = 0; -this.alignment = 0.5; -}); -Clazz_makeConstructor (c$, -function (min, pref, max, a) { -this.minimum = min; -this.preferred = pref; -this.maximum = max; -this.alignment = a > 1.0 ? 1.0 : a < 0.0 ? 0.0 : a; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "toString", -function () { -return "[" + this.minimum + "," + this.preferred + "," + this.maximum + "]@" + this.alignment; -}); -c$.getTiledSizeRequirements = Clazz_defineMethod (c$, "getTiledSizeRequirements", -function (children) { -var total = new javax.swing.SizeRequirements (); -for (var i = 0; i < children.length; i++) { -var req = children[i]; -total.minimum = Math.min (total.minimum + req.minimum, 2147483647); -total.preferred = Math.min (total.preferred + req.preferred, 2147483647); -total.maximum = Math.min (total.maximum + req.maximum, 2147483647); -} -return total; -}, "~A"); -c$.getAlignedSizeRequirements = Clazz_defineMethod (c$, "getAlignedSizeRequirements", -function (children) { -var totalAscent = new javax.swing.SizeRequirements (); -var totalDescent = new javax.swing.SizeRequirements (); -for (var i = 0; i < children.length; i++) { -var req = children[i]; -var ascent = Clazz_floatToInt (req.alignment * req.minimum); -var descent = req.minimum - ascent; -totalAscent.minimum = Math.max (ascent, totalAscent.minimum); -totalDescent.minimum = Math.max (descent, totalDescent.minimum); -ascent = Clazz_floatToInt (req.alignment * req.preferred); -descent = req.preferred - ascent; -totalAscent.preferred = Math.max (ascent, totalAscent.preferred); -totalDescent.preferred = Math.max (descent, totalDescent.preferred); -ascent = Clazz_floatToInt (req.alignment * req.maximum); -descent = req.maximum - ascent; -totalAscent.maximum = Math.max (ascent, totalAscent.maximum); -totalDescent.maximum = Math.max (descent, totalDescent.maximum); -} -var min = Math.min (totalAscent.minimum + totalDescent.minimum, 2147483647); -var pref = Math.min (totalAscent.preferred + totalDescent.preferred, 2147483647); -var max = Math.min (totalAscent.maximum + totalDescent.maximum, 2147483647); -var alignment = 0.0; -if (min > 0) { -alignment = totalAscent.minimum / min; -alignment = alignment > 1.0 ? 1.0 : alignment < 0.0 ? 0.0 : alignment; -}return new javax.swing.SizeRequirements (min, pref, max, alignment); -}, "~A"); -c$.calculateTiledPositions = Clazz_defineMethod (c$, "calculateTiledPositions", -function (allocated, total, children, offsets, spans) { -javax.swing.SizeRequirements.calcTiled (allocated, total, children, offsets, spans, true); -}, "~N,javax.swing.SizeRequirements,~A,~A,~A"); -c$.calculateTiledPositions = Clazz_defineMethod (c$, "calculateTiledPositions", -function (allocated, total, children, offsets, spans, forward) { -javax.swing.SizeRequirements.calcTiled (allocated, total, children, offsets, spans, forward); -}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); -c$.calcTiled = Clazz_defineMethod (c$, "calcTiled", -function (allocated, total, children, offsets, spans, forward) { -var min = 0; -var pref = 0; -var max = 0; -for (var i = 0; i < children.length; i++) { -min += children[i].minimum; -pref += children[i].preferred; -max += children[i].maximum; -} -if (allocated >= pref) { -javax.swing.SizeRequirements.expandedTile (allocated, min, pref, max, children, offsets, spans, forward); -} else { -javax.swing.SizeRequirements.compressedTile (allocated, min, pref, max, children, offsets, spans, forward); -}}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); -c$.compressedTile = Clazz_defineMethod (c$, "compressedTile", - function (allocated, min, pref, max, request, offsets, spans, forward) { -var totalPlay = Math.min (pref - allocated, pref - min); -var factor = (pref - min == 0) ? 0.0 : totalPlay / (pref - min); -var totalOffset; -if (forward) { -totalOffset = 0; -for (var i = 0; i < spans.length; i++) { -offsets[i] = totalOffset; -var req = request[i]; -var play = factor * (req.preferred - req.minimum); -spans[i] = Clazz_floatToInt (req.preferred - play); -totalOffset = Math.min (totalOffset + spans[i], 2147483647); -} -} else { -totalOffset = allocated; -for (var i = 0; i < spans.length; i++) { -var req = request[i]; -var play = factor * (req.preferred - req.minimum); -spans[i] = Clazz_floatToInt (req.preferred - play); -offsets[i] = totalOffset - spans[i]; -totalOffset = Math.max (totalOffset - spans[i], 0); -} -}}, "~N,~N,~N,~N,~A,~A,~A,~B"); -c$.expandedTile = Clazz_defineMethod (c$, "expandedTile", - function (allocated, min, pref, max, request, offsets, spans, forward) { -var totalPlay = Math.min (allocated - pref, max - pref); -var factor = (max - pref == 0) ? 0.0 : totalPlay / (max - pref); -var totalOffset; -if (forward) { -totalOffset = 0; -for (var i = 0; i < spans.length; i++) { -offsets[i] = totalOffset; -var req = request[i]; -var play = Clazz_floatToInt (factor * (req.maximum - req.preferred)); -spans[i] = Math.min (req.preferred + play, 2147483647); -totalOffset = Math.min (totalOffset + spans[i], 2147483647); -} -} else { -totalOffset = allocated; -for (var i = 0; i < spans.length; i++) { -var req = request[i]; -var play = Clazz_floatToInt (factor * (req.maximum - req.preferred)); -spans[i] = Math.min (req.preferred + play, 2147483647); -offsets[i] = totalOffset - spans[i]; -totalOffset = Math.max (totalOffset - spans[i], 0); -} -}}, "~N,~N,~N,~N,~A,~A,~A,~B"); -c$.calculateAlignedPositions = Clazz_defineMethod (c$, "calculateAlignedPositions", -function (allocated, total, children, offsets, spans) { -javax.swing.SizeRequirements.calcAligned (allocated, total, children, offsets, spans, true); -}, "~N,javax.swing.SizeRequirements,~A,~A,~A"); -c$.calcAligned = Clazz_defineMethod (c$, "calcAligned", -function (allocated, total, children, offsets, spans, normal) { -var totalAlignment = normal ? total.alignment : 1.0 - total.alignment; -var totalAscent = Clazz_floatToInt (allocated * totalAlignment); -var totalDescent = allocated - totalAscent; -for (var i = 0; i < children.length; i++) { -var req = children[i]; -var alignment = normal ? req.alignment : 1.0 - req.alignment; -var maxAscent = Clazz_floatToInt (req.maximum * alignment); -var maxDescent = req.maximum - maxAscent; -var ascent = Math.min (totalAscent, maxAscent); -var descent = Math.min (totalDescent, maxDescent); -offsets[i] = totalAscent - ascent; -spans[i] = Math.min (ascent + descent, 2147483647); -} -}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); -c$.calculateAlignedPositions = Clazz_defineMethod (c$, "calculateAlignedPositions", -function (allocated, total, children, offsets, spans, normal) { -javax.swing.SizeRequirements.calcAligned (allocated, total, children, offsets, spans, normal); -}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); -c$.adjustSizes = Clazz_defineMethod (c$, "adjustSizes", -function (delta, children) { -return Clazz_newIntArray (0, 0); -}, "~N,~A"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent", "$.SwingConstants"], "javax.swing.JLabel", ["java.lang.IllegalArgumentException", "javax.swing.SwingUtilities", "$.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.mnemonic = '\0'; -this.mnemonicIndex = -1; -this.text = ""; -this.defaultIcon = null; -this.disabledIcon = null; -this.disabledIconSet = false; -this.verticalAlignment = 0; -this.horizontalAlignment = 10; -this.verticalTextPosition = 0; -this.horizontalTextPosition = 11; -this.iconTextGap = 4; -this.labelFor = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JLabel", javax.swing.JComponent, javax.swing.SwingConstants); -Clazz_makeConstructor (c$, -function (text, icon, horizontalAlignment) { -Clazz_superConstructor (this, javax.swing.JLabel, []); -this.setText (text); -this.setIcon (icon); -this.setHorizontalAlignment (horizontalAlignment); -this.updateUI (); -this.setAlignmentX (0.0); -}, "~S,javax.swing.Icon,~N"); -Clazz_makeConstructor (c$, -function (text, horizontalAlignment) { -this.construct (text, null, horizontalAlignment); -}, "~S,~N"); -Clazz_makeConstructor (c$, -function (text) { -this.construct (text, null, 10); -}, "~S"); -Clazz_makeConstructor (c$, -function (image, horizontalAlignment) { -this.construct (null, image, horizontalAlignment); -}, "javax.swing.Icon,~N"); -Clazz_makeConstructor (c$, -function (image) { -this.construct (null, image, 0); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function () { -this.construct ("", null, 10); -}); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_defineMethod (c$, "setUI", -function (ui) { -Clazz_superCall (this, javax.swing.JLabel, "setUI", [ui]); -if (!this.disabledIconSet && this.disabledIcon != null) { -this.setDisabledIcon (null); -}}, "javax.swing.plaf.LabelUI"); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "LabelUI"; -}); -Clazz_defineMethod (c$, "getText", -function () { -return this.text; -}); -Clazz_defineMethod (c$, "setText", -function (text) { -var oldValue = this.text; -this.text = text; -this.firePropertyChangeObject ("text", oldValue, text); -this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (text, this.getDisplayedMnemonic ())); -if (text == null || oldValue == null || !text.equals (oldValue)) { -this.revalidate (); -this.repaint (); -}}, "~S"); -Clazz_defineMethod (c$, "getIcon", -function () { -return this.defaultIcon; -}); -Clazz_defineMethod (c$, "setIcon", -function (icon) { -var oldValue = this.defaultIcon; -this.defaultIcon = icon; -if ((this.defaultIcon !== oldValue) && !this.disabledIconSet) { -this.disabledIcon = null; -}this.firePropertyChangeObject ("icon", oldValue, this.defaultIcon); -if (this.defaultIcon !== oldValue) { -if ((this.defaultIcon == null) || (oldValue == null) || (this.defaultIcon.getIconWidth () != oldValue.getIconWidth ()) || (this.defaultIcon.getIconHeight () != oldValue.getIconHeight ())) { -this.revalidate (); -}this.repaint (); -}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "getDisabledIcon", -function () { -if (!this.disabledIconSet && this.disabledIcon == null && this.defaultIcon != null) { -this.disabledIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledIcon (this, this.defaultIcon); -if (this.disabledIcon != null) { -this.firePropertyChangeObject ("disabledIcon", null, this.disabledIcon); -}}return this.disabledIcon; -}); -Clazz_defineMethod (c$, "setDisabledIcon", -function (disabledIcon) { -var oldValue = this.disabledIcon; -this.disabledIcon = disabledIcon; -this.disabledIconSet = (disabledIcon != null); -this.firePropertyChangeObject ("disabledIcon", oldValue, disabledIcon); -if (disabledIcon !== oldValue) { -if (disabledIcon == null || oldValue == null || disabledIcon.getIconWidth () != oldValue.getIconWidth () || disabledIcon.getIconHeight () != oldValue.getIconHeight ()) { -this.revalidate (); -}if (!this.isEnabled ()) { -this.repaint (); -}}}, "javax.swing.Icon"); -Clazz_defineMethod (c$, "setDisplayedMnemonic", -function (key) { -var oldKey = this.mnemonic; -this.mnemonic = key; -this.firePropertyChangeInt ("displayedMnemonic", oldKey, this.mnemonic); -this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (this.getText (), this.mnemonic)); -if (key != oldKey) { -this.revalidate (); -this.repaint (); -}}, "~N"); -Clazz_defineMethod (c$, "setDisplayedMnemonic", -function (aChar) { -var vk = (aChar).charCodeAt (0); -if (vk >= 97 && vk <= 122) vk -= (32); -this.setDisplayedMnemonic (vk); -}, "~S"); -Clazz_defineMethod (c$, "getDisplayedMnemonic", -function () { -return this.mnemonic; -}); -Clazz_defineMethod (c$, "setDisplayedMnemonicIndex", -function (index) { -var oldValue = this.mnemonicIndex; -if (index == -1) { -this.mnemonicIndex = -1; -} else { -var text = this.getText (); -var textLength = (text == null) ? 0 : text.length; -if (index < -1 || index >= textLength) { -throw new IllegalArgumentException ("index == " + index); -}}this.mnemonicIndex = index; -this.firePropertyChangeInt ("displayedMnemonicIndex", oldValue, index); -if (index != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~N"); -Clazz_defineMethod (c$, "getDisplayedMnemonicIndex", -function () { -return this.mnemonicIndex; -}); -Clazz_defineMethod (c$, "checkHorizontalKey", -function (key, message) { -if ((key == 2) || (key == 0) || (key == 4) || (key == 10) || (key == 11)) { -return key; -} else { -throw new IllegalArgumentException (message); -}}, "~N,~S"); -Clazz_defineMethod (c$, "checkVerticalKey", -function (key, message) { -if ((key == 1) || (key == 0) || (key == 3)) { -return key; -} else { -throw new IllegalArgumentException (message); -}}, "~N,~S"); -Clazz_defineMethod (c$, "getIconTextGap", -function () { -return this.iconTextGap; -}); -Clazz_defineMethod (c$, "setIconTextGap", -function (iconTextGap) { -var oldValue = this.iconTextGap; -this.iconTextGap = iconTextGap; -this.firePropertyChangeInt ("iconTextGap", oldValue, iconTextGap); -if (iconTextGap != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~N"); -Clazz_defineMethod (c$, "getVerticalAlignment", -function () { -return this.verticalAlignment; -}); -Clazz_defineMethod (c$, "setVerticalAlignment", -function (alignment) { -if (alignment == this.verticalAlignment) return; -var oldValue = this.verticalAlignment; -this.verticalAlignment = this.checkVerticalKey (alignment, "verticalAlignment"); -this.firePropertyChangeInt ("verticalAlignment", oldValue, this.verticalAlignment); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getHorizontalAlignment", -function () { -return this.horizontalAlignment; -}); -Clazz_defineMethod (c$, "setHorizontalAlignment", -function (alignment) { -if (alignment == this.horizontalAlignment) return; -var oldValue = this.horizontalAlignment; -this.horizontalAlignment = this.checkHorizontalKey (alignment, "horizontalAlignment"); -this.firePropertyChangeInt ("horizontalAlignment", oldValue, this.horizontalAlignment); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getVerticalTextPosition", -function () { -return this.verticalTextPosition; -}); -Clazz_defineMethod (c$, "setVerticalTextPosition", -function (textPosition) { -if (textPosition == this.verticalTextPosition) return; -var old = this.verticalTextPosition; -this.verticalTextPosition = this.checkVerticalKey (textPosition, "verticalTextPosition"); -this.firePropertyChangeInt ("verticalTextPosition", old, this.verticalTextPosition); -this.revalidate (); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "getHorizontalTextPosition", -function () { -return this.horizontalTextPosition; -}); -Clazz_defineMethod (c$, "setHorizontalTextPosition", -function (textPosition) { -var old = this.horizontalTextPosition; -this.horizontalTextPosition = this.checkHorizontalKey (textPosition, "horizontalTextPosition"); -this.firePropertyChangeInt ("horizontalTextPosition", old, this.horizontalTextPosition); -this.revalidate (); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "imageUpdate", -function (img, infoflags, x, y, w, h) { -if (!this.isShowing () || !javax.swing.SwingUtilities.doesIconReferenceImage (this.getIcon (), img) && !javax.swing.SwingUtilities.doesIconReferenceImage (this.disabledIcon, img)) { -return false; -}return Clazz_superCall (this, javax.swing.JLabel, "imageUpdate", [img, infoflags, x, y, w, h]); -}, "java.awt.Image,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paramString", -function () { -var textString = (this.text != null ? this.text : ""); -var defaultIconString = ((this.defaultIcon != null) && (this.defaultIcon !== this) ? this.defaultIcon.toString () : ""); -var disabledIconString = ((this.disabledIcon != null) && (this.disabledIcon !== this) ? this.disabledIcon.toString () : ""); -var labelForString = (this.labelFor != null ? this.labelFor.toString () : ""); -var verticalAlignmentString; -if (this.verticalAlignment == 1) { -verticalAlignmentString = "TOP"; -} else if (this.verticalAlignment == 0) { -verticalAlignmentString = "CENTER"; -} else if (this.verticalAlignment == 3) { -verticalAlignmentString = "BOTTOM"; -} else verticalAlignmentString = ""; -var horizontalAlignmentString; -if (this.horizontalAlignment == 2) { -horizontalAlignmentString = "LEFT"; -} else if (this.horizontalAlignment == 0) { -horizontalAlignmentString = "CENTER"; -} else if (this.horizontalAlignment == 4) { -horizontalAlignmentString = "RIGHT"; -} else if (this.horizontalAlignment == 10) { -horizontalAlignmentString = "LEADING"; -} else if (this.horizontalAlignment == 11) { -horizontalAlignmentString = "TRAILING"; -} else horizontalAlignmentString = ""; -var verticalTextPositionString; -if (this.verticalTextPosition == 1) { -verticalTextPositionString = "TOP"; -} else if (this.verticalTextPosition == 0) { -verticalTextPositionString = "CENTER"; -} else if (this.verticalTextPosition == 3) { -verticalTextPositionString = "BOTTOM"; -} else verticalTextPositionString = ""; -var horizontalTextPositionString; -if (this.horizontalTextPosition == 2) { -horizontalTextPositionString = "LEFT"; -} else if (this.horizontalTextPosition == 0) { -horizontalTextPositionString = "CENTER"; -} else if (this.horizontalTextPosition == 4) { -horizontalTextPositionString = "RIGHT"; -} else if (this.horizontalTextPosition == 10) { -horizontalTextPositionString = "LEADING"; -} else if (this.horizontalTextPosition == 11) { -horizontalTextPositionString = "TRAILING"; -} else horizontalTextPositionString = ""; -return Clazz_superCall (this, javax.swing.JLabel, "paramString", []) + ",defaultIcon=" + defaultIconString + ",disabledIcon=" + disabledIconString + ",horizontalAlignment=" + horizontalAlignmentString + ",horizontalTextPosition=" + horizontalTextPositionString + ",iconTextGap=" + this.iconTextGap + ",labelFor=" + labelForString + ",text=" + textString + ",verticalAlignment=" + verticalAlignmentString + ",verticalTextPosition=" + verticalTextPositionString; -}); -Clazz_defineMethod (c$, "getLabelFor", -function () { -return this.labelFor; -}); -Clazz_defineMethod (c$, "setLabelFor", -function (c) { -var oldC = this.labelFor; -this.labelFor = c; -this.firePropertyChangeObject ("labelFor", oldC, c); -if (Clazz_instanceOf (oldC, javax.swing.JComponent)) { -(oldC).putClientProperty ("labeledBy", null); -}if (Clazz_instanceOf (c, javax.swing.JComponent)) { -(c).putClientProperty ("labeledBy", this); -}}, "java.awt.Component"); -Clazz_defineStatics (c$, -"$uiClassID", "LabelUI", -"LABELED_BY_PROPERTY", "labeledBy"); -}); -Clazz_declarePackage ("javax.swing.border"); -Clazz_declareInterface (javax.swing.border, "Border"); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "RootPaneContainer"); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.awt.event.MouseEvent"], "javax.swing.event.MenuDragMouseEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.path = null; -this.manager = null; -Clazz_instantialize (this, arguments); -}, javax.swing.event, "MenuDragMouseEvent", java.awt.event.MouseEvent); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, clickCount, popupTrigger, p, m) { -Clazz_superConstructor (this, javax.swing.event.MenuDragMouseEvent, [source, id, when, modifiers, x, y, clickCount, popupTrigger]); -this.path = p; -this.manager = m; -}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B,~A,javax.swing.MenuSelectionManager"); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, p, m) { -Clazz_superConstructor (this, javax.swing.event.MenuDragMouseEvent, [source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, 0]); -this.path = p; -this.manager = m; -}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~N,~N,~B,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "getPath", -function () { -return this.path; -}); -Clazz_defineMethod (c$, "getMenuSelectionManager", -function () { -return this.manager; -}); -}); -Clazz_declarePackage ("jssun.swing"); -Clazz_load (["javax.swing.Action"], "jssun.swing.UIAction", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.name = null; -Clazz_instantialize (this, arguments); -}, jssun.swing, "UIAction", null, javax.swing.Action); -Clazz_makeConstructor (c$, -function (name) { -this.name = name; -}, "~S"); -Clazz_defineMethod (c$, "getName", -function () { -return this.name; -}); -Clazz_overrideMethod (c$, "getValue", -function (key) { -if (key === "Name") { -return this.name; -}return null; -}, "~S"); -Clazz_overrideMethod (c$, "putValue", -function (key, value) { -}, "~S,~O"); -Clazz_overrideMethod (c$, "setEnabled", -function (b) { -}, "~B"); -Clazz_defineMethod (c$, "isEnabled", -function () { -return this.isEnabled (null); -}); -Clazz_defineMethod (c$, "isEnabled", -function (sender) { -return true; -}, "~O"); -Clazz_overrideMethod (c$, "addPropertyChangeListener", -function (listener) { -}, "java.beans.PropertyChangeListener"); -Clazz_overrideMethod (c$, "removePropertyChangeListener", -function (listener) { -}, "java.beans.PropertyChangeListener"); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_declareInterface (jssun.awt, "RequestFocusController"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.event.ComponentListener", "java.beans.PropertyChangeListener", "javax.swing.event.EventListenerList"], "javax.swing.AncestorNotifier", ["java.awt.Window", "javax.swing.JComponent", "javax.swing.event.AncestorEvent", "$.AncestorListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.firstInvisibleAncestor = null; -this.listenerList = null; -this.root = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "AncestorNotifier", null, [java.awt.event.ComponentListener, java.beans.PropertyChangeListener]); -Clazz_prepareFields (c$, function () { -this.listenerList = new javax.swing.event.EventListenerList (); -}); -Clazz_makeConstructor (c$, -function (root) { -this.root = root; -this.addListeners (root, true); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "addAncestorListener", -function (l) { -this.listenerList.add (javax.swing.event.AncestorListener, l); -}, "javax.swing.event.AncestorListener"); -Clazz_defineMethod (c$, "removeAncestorListener", -function (l) { -this.listenerList.remove (javax.swing.event.AncestorListener, l); -}, "javax.swing.event.AncestorListener"); -Clazz_defineMethod (c$, "getAncestorListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.AncestorListener); -}); -Clazz_defineMethod (c$, "fireAncestorAdded", -function (source, id, ancestor, ancestorParent) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.AncestorListener) { -var ancestorEvent = new javax.swing.event.AncestorEvent (source, id, ancestor, ancestorParent); -(listeners[i + 1]).ancestorAdded (ancestorEvent); -}} -}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); -Clazz_defineMethod (c$, "fireAncestorRemoved", -function (source, id, ancestor, ancestorParent) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.AncestorListener) { -var ancestorEvent = new javax.swing.event.AncestorEvent (source, id, ancestor, ancestorParent); -(listeners[i + 1]).ancestorRemoved (ancestorEvent); -}} -}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); -Clazz_defineMethod (c$, "fireAncestorMoved", -function (source, id, ancestor, ancestorParent) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.AncestorListener) { -var ancestorEvent = new javax.swing.event.AncestorEvent (source, id, ancestor, ancestorParent); -(listeners[i + 1]).ancestorMoved (ancestorEvent); -}} -}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); -Clazz_defineMethod (c$, "removeAllListeners", -function () { -this.removeListeners (this.root); -}); -Clazz_defineMethod (c$, "addListeners", -function (ancestor, addToFirst) { -var a; -this.firstInvisibleAncestor = null; -for (a = ancestor; this.firstInvisibleAncestor == null; a = a.getParent ()) { -if (addToFirst || a !== ancestor) { -a.addComponentListener (this); -if (Clazz_instanceOf (a, javax.swing.JComponent)) { -var jAncestor = a; -jAncestor.addPropertyChangeListener (this); -}}if (!a.isVisible () || a.getParent () == null || Clazz_instanceOf (a, java.awt.Window)) { -this.firstInvisibleAncestor = a; -}} -if (Clazz_instanceOf (this.firstInvisibleAncestor, java.awt.Window) && this.firstInvisibleAncestor.isVisible ()) { -this.firstInvisibleAncestor = null; -}}, "java.awt.Component,~B"); -Clazz_defineMethod (c$, "removeListeners", -function (ancestor) { -var a; -for (a = ancestor; a != null; a = a.getParent ()) { -a.removeComponentListener (this); -if (Clazz_instanceOf (a, javax.swing.JComponent)) { -var jAncestor = a; -jAncestor.removePropertyChangeListener (this); -}if (a === this.firstInvisibleAncestor || Clazz_instanceOf (a, java.awt.Window)) { -break; -}} -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "componentResized", -function (e) { -}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "componentMoved", -function (e) { -var source = e.getComponent (); -this.fireAncestorMoved (this.root, 3, source, source.getParent ()); -}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "componentShown", -function (e) { -var ancestor = e.getComponent (); -if (ancestor === this.firstInvisibleAncestor) { -this.addListeners (ancestor, false); -if (this.firstInvisibleAncestor == null) { -this.fireAncestorAdded (this.root, 1, ancestor, ancestor.getParent ()); -}}}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "componentHidden", -function (e) { -var ancestor = e.getComponent (); -var needsNotify = this.firstInvisibleAncestor == null; -if (!(Clazz_instanceOf (ancestor, java.awt.Window))) { -this.removeListeners (ancestor.getParent ()); -}this.firstInvisibleAncestor = ancestor; -if (needsNotify) { -this.fireAncestorRemoved (this.root, 2, ancestor, ancestor.getParent ()); -}}, "java.awt.event.ComponentEvent"); -Clazz_overrideMethod (c$, "propertyChange", -function (evt) { -var s = evt.getPropertyName (); -if (s != null && (s.equals ("parent") || s.equals ("ancestor"))) { -var component = evt.getSource (); -if (evt.getNewValue () != null) { -if (component === this.firstInvisibleAncestor) { -this.addListeners (component, false); -if (this.firstInvisibleAncestor == null) { -this.fireAncestorAdded (this.root, 1, component, component.getParent ()); -}}} else { -var needsNotify = this.firstInvisibleAncestor == null; -var oldParent = evt.getOldValue (); -this.removeListeners (oldParent); -this.firstInvisibleAncestor = component; -if (needsNotify) { -this.fireAncestorRemoved (this.root, 2, component, oldParent); -}}}}, "java.beans.PropertyChangeEvent"); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.awt.AWTEvent"], "javax.swing.event.AncestorEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.ancestor = null; -this.ancestorParent = null; -Clazz_instantialize (this, arguments); -}, javax.swing.event, "AncestorEvent", java.awt.AWTEvent); -Clazz_makeConstructor (c$, -function (source, id, ancestor, ancestorParent) { -Clazz_superConstructor (this, javax.swing.event.AncestorEvent, [source, id]); -this.ancestor = ancestor; -this.ancestorParent = ancestorParent; -}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); -Clazz_defineMethod (c$, "getAncestor", -function () { -return this.ancestor; -}); -Clazz_defineMethod (c$, "getAncestorParent", -function () { -return this.ancestorParent; -}); -Clazz_defineMethod (c$, "getComponent", -function () { -return this.getSource (); -}); -Clazz_defineStatics (c$, -"ANCESTOR_ADDED", 1, -"ANCESTOR_REMOVED", 2, -"ANCESTOR_MOVED", 3); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.AncestorListener", null, function () { -Clazz_declareInterface (javax.swing.event, "AncestorListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.lang.Enum"], "javax.swing.ClientPropertyKey", null, function () { -c$ = Clazz_declareType (javax.swing, "ClientPropertyKey", Enum); -Clazz_makeConstructor (c$, - function (reportValueNotSerializable) { -}, "~B"); -Clazz_defineEnumConstant (c$, "JComponent_INPUT_VERIFIER", 0, [true]); -Clazz_defineEnumConstant (c$, "JComponent_TRANSFER_HANDLER", 1, [true]); -Clazz_defineEnumConstant (c$, "JComponent_ANCESTOR_NOTIFIER", 2, [true]); -Clazz_defineEnumConstant (c$, "PopupFactory_FORCE_HEAVYWEIGHT_POPUP", 3, [true]); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Dialog", "javax.swing.RootPaneContainer", "$.WindowConstants"], "javax.swing.JDialog", ["java.lang.Boolean", "$.IllegalArgumentException", "javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities", "$.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.defaultCloseOperation = 1; -this.rootPane = null; -this.rootPaneCheckingEnabled = false; -this.transferHandler = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JDialog", java.awt.Dialog, [javax.swing.WindowConstants, javax.swing.RootPaneContainer]); -Clazz_makeConstructor (c$, -function () { -this.construct (Clazz_castNullAs ("java.awt.Frame"), false); -}); -Clazz_makeConstructor (c$, -function (owner) { -this.construct (owner, false); -}, "java.awt.Frame"); -Clazz_makeConstructor (c$, -function (owner, modal) { -this.construct (owner, null, modal); -}, "java.awt.Frame,~B"); -Clazz_makeConstructor (c$, -function (owner, title) { -this.construct (owner, title, false); -}, "java.awt.Frame,~S"); -Clazz_makeConstructor (c$, -function (owner, title, modal) { -Clazz_superConstructor (this, javax.swing.JDialog, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner, title, modal]); -if (owner == null) { -var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); -this.addWindowListener (ownerShutdownListener); -}this.dialogInit (); -}, "java.awt.Frame,~S,~B"); -Clazz_makeConstructor (c$, -function (owner, title, modal, gc) { -Clazz_superConstructor (this, javax.swing.JDialog, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner, title, modal, gc]); -if (owner == null) { -var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); -this.addWindowListener (ownerShutdownListener); -}this.dialogInit (); -}, "java.awt.Frame,~S,~B,java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (owner) { -this.construct (owner, false); -}, "java.awt.Dialog"); -Clazz_makeConstructor (c$, -function (owner, modal) { -this.construct (owner, null, modal); -}, "java.awt.Dialog,~B"); -Clazz_makeConstructor (c$, -function (owner, title) { -this.construct (owner, title, false); -}, "java.awt.Dialog,~S"); -Clazz_makeConstructor (c$, -function (owner, title, modal) { -Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modal]); -this.dialogInit (); -}, "java.awt.Dialog,~S,~B"); -Clazz_makeConstructor (c$, -function (owner, title, modal, gc) { -Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modal, gc]); -this.dialogInit (); -}, "java.awt.Dialog,~S,~B,java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (owner) { -this.construct (owner, java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Window"); -Clazz_makeConstructor (c$, -function (owner, modalityType) { -this.construct (owner, null, modalityType); -}, "java.awt.Window,java.awt.Dialog.ModalityType"); -Clazz_makeConstructor (c$, -function (owner, title) { -this.construct (owner, title, java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Window,~S"); -Clazz_makeConstructor (c$, -function (owner, title, modalityType) { -Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modalityType]); -this.dialogInit (); -}, "java.awt.Window,~S,java.awt.Dialog.ModalityType"); -Clazz_makeConstructor (c$, -function (owner, title, modalityType, gc) { -Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modalityType, gc]); -this.dialogInit (); -}, "java.awt.Window,~S,java.awt.Dialog.ModalityType,java.awt.GraphicsConfiguration"); -Clazz_defineMethod (c$, "dialogInit", -function () { -this.enableEvents (72); -this.setLocale (javax.swing.JComponent.getDefaultLocale ()); -this.setRootPane (this.createRootPane ()); -this.setRootPaneCheckingEnabled (true); -if (javax.swing.JDialog.isDefaultLookAndFeelDecorated ()) { -var supportsWindowDecorations = javax.swing.UIManager.getLookAndFeel ().getSupportsWindowDecorations (); -if (supportsWindowDecorations) { -this.setUndecorated (true); -this.getRootPane ().setWindowDecorationStyle (2); -}}}); -Clazz_defineMethod (c$, "createRootPane", -function () { -var rp = new javax.swing.JRootPane (); -rp.setOpaque (true); -return rp; -}); -Clazz_defineMethod (c$, "processWindowEvent", -function (e) { -Clazz_superCall (this, javax.swing.JDialog, "processWindowEvent", [e]); -if (e.getID () == 201) { -switch (this.defaultCloseOperation) { -case 1: -this.setVisible (false); -break; -case 2: -this.dispose (); -break; -case 0: -default: -break; -} -}}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "setDefaultCloseOperation", -function (operation) { -if (operation != 0 && operation != 1 && operation != 2) { -throw new IllegalArgumentException ("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE"); -}var oldValue = this.defaultCloseOperation; -this.defaultCloseOperation = operation; -this.firePropertyChangeInt ("defaultCloseOperation", oldValue, operation); -}, "~N"); -Clazz_defineMethod (c$, "getDefaultCloseOperation", -function () { -return this.defaultCloseOperation; -}); -Clazz_defineMethod (c$, "setTransferHandler", -function (newHandler) { -var oldHandler = this.transferHandler; -this.transferHandler = newHandler; -javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); -this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); -}, "javax.swing.TransferHandler"); -Clazz_defineMethod (c$, "getTransferHandler", -function () { -return this.transferHandler; -}); -Clazz_overrideMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "setJMenuBar", -function (menu) { -this.getRootPane ().setMenuBar (menu); -}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "getJMenuBar", -function () { -return this.getRootPane ().getMenuBar (); -}); -Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", -function () { -return this.rootPaneCheckingEnabled; -}); -Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", -function (enabled) { -this.rootPaneCheckingEnabled = enabled; -}, "~B"); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -if (this.isRootPaneCheckingEnabled ()) { -return this.getContentPane ().add (comp, constraints, index); -}return this.addImplSAEM (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "remove", -function (comp) { -if (comp === this.rootPane) { -this.removeChild (comp); -} else { -this.getContentPane ().removeChild (comp); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "setLayout", -function (manager) { -if (this.isRootPaneCheckingEnabled ()) { -this.getContentPane ().setLayout (manager); -} else { -Clazz_superCall (this, javax.swing.JDialog, "setLayout", [manager]); -}}, "java.awt.LayoutManager"); -Clazz_overrideMethod (c$, "getRootPane", -function () { -return this.rootPane; -}); -Clazz_defineMethod (c$, "setRootPane", -function (root) { -if (this.rootPane != null) { -this.remove (this.rootPane); -}this.rootPane = root; -if (this.rootPane != null) { -var checkingEnabled = this.isRootPaneCheckingEnabled (); -try { -this.setRootPaneCheckingEnabled (false); -this.add (this.rootPane, "Center"); -} finally { -this.setRootPaneCheckingEnabled (checkingEnabled); -} -}}, "javax.swing.JRootPane"); -Clazz_overrideMethod (c$, "getContentPane", -function () { -return this.getRootPane ().getContentPane (); -}); -Clazz_overrideMethod (c$, "setContentPane", -function (contentPane) { -this.getRootPane ().setContentPane (contentPane); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayeredPane", -function () { -return this.getRootPane ().getLayeredPane (); -}); -Clazz_overrideMethod (c$, "setLayeredPane", -function (layeredPane) { -this.getRootPane ().setLayeredPane (layeredPane); -}, "javax.swing.JLayeredPane"); -Clazz_overrideMethod (c$, "getGlassPane", -function () { -return this.getRootPane ().getGlassPane (); -}); -Clazz_overrideMethod (c$, "setGlassPane", -function (glassPane) { -this.getRootPane ().setGlassPane (glassPane); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getGraphics", -function () { -javax.swing.JComponent.getGraphicsInvoked (this); -return Clazz_superCall (this, javax.swing.JDialog, "getGraphics", []); -}); -Clazz_defineMethod (c$, "repaint", -function (time, x, y, width, height) { -if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { -javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); -} else { -Clazz_superCall (this, javax.swing.JDialog, "repaint", [time, x, y, width, height]); -}}, "~N,~N,~N,~N,~N"); -c$.setDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "setDefaultLookAndFeelDecorated", -function (defaultLookAndFeelDecorated) { -if (defaultLookAndFeelDecorated) { -javax.swing.SwingUtilities.appContextPut (javax.swing.JDialog.defaultLookAndFeelDecoratedKey, Boolean.TRUE); -} else { -javax.swing.SwingUtilities.appContextPut (javax.swing.JDialog.defaultLookAndFeelDecoratedKey, Boolean.FALSE); -}}, "~B"); -c$.isDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "isDefaultLookAndFeelDecorated", -function () { -var defaultLookAndFeelDecorated = javax.swing.SwingUtilities.appContextGet (javax.swing.JDialog.defaultLookAndFeelDecoratedKey); -if (defaultLookAndFeelDecorated == null) { -defaultLookAndFeelDecorated = Boolean.FALSE; -}return defaultLookAndFeelDecorated.booleanValue (); -}); -Clazz_defineMethod (c$, "paramString", -function () { -var defaultCloseOperationString; -if (this.defaultCloseOperation == 1) { -defaultCloseOperationString = "HIDE_ON_CLOSE"; -} else if (this.defaultCloseOperation == 2) { -defaultCloseOperationString = "DISPOSE_ON_CLOSE"; -} else if (this.defaultCloseOperation == 0) { -defaultCloseOperationString = "DO_NOTHING_ON_CLOSE"; -} else defaultCloseOperationString = ""; -var rootPaneString = (this.rootPane != null ? this.rootPane.toString () : ""); -var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JDialog, "paramString", []) + ",defaultCloseOperation=" + defaultCloseOperationString + ",rootPane=" + rootPaneString + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; -}); -c$.defaultLookAndFeelDecoratedKey = c$.prototype.defaultLookAndFeelDecoratedKey = new Clazz._O (); -}); -Clazz_declarePackage ("java.awt"); -Clazz_load (["java.lang.Enum", "java.awt.Window"], "java.awt.Dialog", ["java.lang.IllegalArgumentException", "java.awt.Frame", "$.IllegalComponentStateException"], function () { -c$ = Clazz_decorateAsClass (function () { -this.resizable = true; -this.undecorated = false; -this.modal = false; -this.modalityType = null; -this.title = null; -this.isInHide = false; -this.isInDispose = false; -Clazz_instantialize (this, arguments); -}, java.awt, "Dialog", java.awt.Window); -Clazz_makeConstructor (c$, -function (owner) { -this.construct (owner, "", false); -}, "java.awt.Frame"); -Clazz_makeConstructor (c$, -function (owner, modal) { -this.construct (owner, "", modal); -}, "java.awt.Frame,~B"); -Clazz_makeConstructor (c$, -function (owner, title) { -this.construct (owner, title, false); -}, "java.awt.Frame,~S"); -Clazz_makeConstructor (c$, -function (owner, title, modal) { -this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Frame,~S,~B"); -Clazz_makeConstructor (c$, -function (owner, title, modal, gc) { -this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, gc); -}, "java.awt.Frame,~S,~B,java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (owner) { -this.construct (owner, "", false); -}, "java.awt.Dialog"); -Clazz_makeConstructor (c$, -function (owner, title) { -this.construct (owner, title, false); -}, "java.awt.Dialog,~S"); -Clazz_makeConstructor (c$, -function (owner, title, modal) { -this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Dialog,~S,~B"); -Clazz_makeConstructor (c$, -function (owner, title, modal, gc) { -this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, gc); -}, "java.awt.Dialog,~S,~B,java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (owner) { -this.construct (owner, null, java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Window"); -Clazz_makeConstructor (c$, -function (owner, title) { -this.construct (owner, title, java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Window,~S"); -Clazz_makeConstructor (c$, -function (owner, modalityType) { -this.construct (owner, null, modalityType); -}, "java.awt.Window,java.awt.Dialog.ModalityType"); -Clazz_makeConstructor (c$, -function (owner, title, modalityType) { -Clazz_superConstructor (this, java.awt.Dialog, [owner]); -if ((owner != null) && !(Clazz_instanceOf (owner, java.awt.Frame)) && !(Clazz_instanceOf (owner, java.awt.Dialog))) { -throw new IllegalArgumentException ("Wrong parent window"); -}this.title = title; -this.setModalityType (modalityType); -}, "java.awt.Window,~S,java.awt.Dialog.ModalityType"); -Clazz_makeConstructor (c$, -function (owner, title, modalityType, gc) { -Clazz_superConstructor (this, java.awt.Dialog, [owner, gc]); -if ((owner != null) && !(Clazz_instanceOf (owner, java.awt.Frame)) && !(Clazz_instanceOf (owner, java.awt.Dialog))) { -throw new IllegalArgumentException ("wrong owner window"); -}this.title = title; -this.setModalityType (modalityType); -}, "java.awt.Window,~S,java.awt.Dialog.ModalityType,java.awt.GraphicsConfiguration"); -Clazz_overrideMethod (c$, "constructComponentName", -function () { -{ -return "dialog" + java.awt.Dialog.$nameCounter++; -}}); -Clazz_defineMethod (c$, "addNotify", -function () { -{ -if (this.parent != null) { -this.parent.addNotify (); -}Clazz_superCall (this, java.awt.Dialog, "addNotify", []); -}}); -Clazz_defineMethod (c$, "isModal", -function () { -return this.isModal_NoClientCode (); -}); -Clazz_defineMethod (c$, "isModal_NoClientCode", -function () { -return this.modalityType !== java.awt.Dialog.ModalityType.MODELESS; -}); -Clazz_defineMethod (c$, "setModal", -function (modal) { -this.modal = modal; -this.setModalityType (modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS); -}, "~B"); -Clazz_defineMethod (c$, "getModalityType", -function () { -return this.modalityType; -}); -Clazz_defineMethod (c$, "setModalityType", -function (type) { -if (type == null) { -type = java.awt.Dialog.ModalityType.MODELESS; -}if (this.modalityType === type) { -return; -}this.checkModalityPermission (type); -this.modalityType = type; -this.modal = (this.modalityType !== java.awt.Dialog.ModalityType.MODELESS); -}, "java.awt.Dialog.ModalityType"); -Clazz_defineMethod (c$, "getTitle", -function () { -return this.title; -}); -Clazz_defineMethod (c$, "setTitle", -function (title) { -var oldTitle = this.title; -{ -this.title = title; -}this.firePropertyChangeObject ("title", oldTitle, title); -}, "~S"); -Clazz_defineMethod (c$, "show", -function () { -}); -Clazz_defineMethod (c$, "modalityPushed", -function () { -}); -Clazz_defineMethod (c$, "modalityPopped", -function () { -}); -Clazz_defineMethod (c$, "interruptBlocking", -function () { -if (this.isModal ()) { -this.disposeImpl (); -} else if (this.windowClosingException != null) { -this.windowClosingException.fillInStackTrace (); -this.windowClosingException.printStackTrace (); -this.windowClosingException = null; -}}); -Clazz_defineMethod (c$, "hideAndDisposePreHandler", - function () { -this.isInHide = true; -}); -Clazz_defineMethod (c$, "hideAndDisposeHandler", - function () { -this.isInHide = false; -}); -Clazz_defineMethod (c$, "hide", -function () { -this.hideAndDisposePreHandler (); -Clazz_superCall (this, java.awt.Dialog, "hide", []); -if (!this.isInDispose) { -this.hideAndDisposeHandler (); -}}); -Clazz_defineMethod (c$, "doDispose", -function () { -this.isInDispose = true; -Clazz_superCall (this, java.awt.Dialog, "doDispose", []); -this.hideAndDisposeHandler (); -this.isInDispose = false; -}); -Clazz_defineMethod (c$, "isResizable", -function () { -return this.resizable; -}); -Clazz_defineMethod (c$, "setResizable", -function (resizable) { -var testvalid = false; -{ -this.resizable = resizable; -}if (testvalid) { -this.invalidateIfValid (); -}}, "~B"); -Clazz_defineMethod (c$, "setUndecorated", -function (undecorated) { -{ -if (this.isDisplayable ()) { -throw new java.awt.IllegalComponentStateException ("The dialog is displayable."); -}this.undecorated = undecorated; -}}, "~B"); -Clazz_defineMethod (c$, "isUndecorated", -function () { -return this.undecorated; -}); -Clazz_defineMethod (c$, "paramString", -function () { -var str = Clazz_superCall (this, java.awt.Dialog, "paramString", []) + "," + this.modalityType; -if (this.title != null) { -str += ",title=" + this.title; -}return str; -}); -Clazz_defineMethod (c$, "modalShow", -function () { -}); -Clazz_defineMethod (c$, "modalHide", -function () { -}); -Clazz_defineMethod (c$, "shouldBlock", -function (w) { -if (!this.isVisible_NoClientCode () || (!w.isVisible_NoClientCode () && !w.isInShow) || this.isInHide || (w === this) || !this.isModal_NoClientCode ()) { -return false; -}if ((Clazz_instanceOf (w, java.awt.Dialog)) && (w).isInHide) { -return false; -}var blockerToCheck = this; -while (blockerToCheck != null) { -var c = w; -while ((c != null) && (c !== blockerToCheck)) { -c = c.getParent_NoClientCode (); -} -if (c === blockerToCheck) { -return false; -}blockerToCheck = blockerToCheck.getModalBlocker (); -} -switch (this.modalityType) { -case java.awt.Dialog.ModalityType.MODELESS: -return false; -case java.awt.Dialog.ModalityType.DOCUMENT_MODAL: -if (w.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { -var c = this; -while ((c != null) && (c !== w)) { -c = c.getParent_NoClientCode (); -} -return c === w; -} else { -return this.getDocumentRoot () === w.getDocumentRoot (); -}case java.awt.Dialog.ModalityType.APPLICATION_MODAL: -return !w.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE) && (this.appContext === w.appContext); -case java.awt.Dialog.ModalityType.TOOLKIT_MODAL: -return !w.isModalExcluded (java.awt.Dialog.ModalExclusionType.TOOLKIT_EXCLUDE); -} -return false; -}, "java.awt.Window"); -Clazz_defineMethod (c$, "checkModalityPermission", - function (mt) { -}, "java.awt.Dialog.ModalityType"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.Dialog, "ModalityType", Enum); -Clazz_defineEnumConstant (c$, "MODELESS", 0, []); -Clazz_defineEnumConstant (c$, "DOCUMENT_MODAL", 1, []); -Clazz_defineEnumConstant (c$, "APPLICATION_MODAL", 2, []); -Clazz_defineEnumConstant (c$, "TOOLKIT_MODAL", 3, []); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (java.awt.Dialog, "ModalExclusionType", Enum); -Clazz_defineEnumConstant (c$, "NO_EXCLUDE", 0, []); -Clazz_defineEnumConstant (c$, "APPLICATION_EXCLUDE", 1, []); -Clazz_defineEnumConstant (c$, "TOOLKIT_EXCLUDE", 2, []); -c$ = Clazz_p0p (); -c$.DEFAULT_MODALITY_TYPE = c$.prototype.DEFAULT_MODALITY_TYPE = java.awt.Dialog.ModalityType.APPLICATION_MODAL; -Clazz_defineStatics (c$, -"$base", "dialog", -"$nameCounter", 0); -}); -Clazz_declarePackage ("javax.swing"); -c$ = Clazz_declareInterface (javax.swing, "WindowConstants"); -Clazz_defineStatics (c$, -"DO_NOTHING_ON_CLOSE", 0, -"HIDE_ON_CLOSE", 1, -"DISPOSE_ON_CLOSE", 2, -"EXIT_ON_CLOSE", 3); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Frame", "javax.swing.RootPaneContainer", "$.WindowConstants"], "javax.swing.JFrame", ["java.lang.Boolean", "$.IllegalArgumentException", "javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities", "$.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.defaultCloseOperation = 1; -this.transferHandler = null; -this.rootPane = null; -this.rootPaneCheckingEnabled = false; -Clazz_instantialize (this, arguments); -}, javax.swing, "JFrame", java.awt.Frame, [javax.swing.WindowConstants, javax.swing.RootPaneContainer]); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JFrame); -this.frameInit (); -}); -Clazz_makeConstructor (c$, -function (gc) { -Clazz_superConstructor (this, javax.swing.JFrame, [gc]); -this.frameInit (); -}, "java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (title) { -Clazz_superConstructor (this, javax.swing.JFrame, [title]); -this.frameInit (); -}, "~S"); -Clazz_makeConstructor (c$, -function (title, gc) { -Clazz_superConstructor (this, javax.swing.JFrame, [title, gc]); -this.frameInit (); -}, "~S,java.awt.GraphicsConfiguration"); -Clazz_defineMethod (c$, "frameInit", -function () { -this.enableEvents (72); -this.setLocale (javax.swing.JComponent.getDefaultLocale ()); -this.setRootPane (this.createRootPane ()); -this.setBackground (javax.swing.UIManager.getColor ("control")); -this.setRootPaneCheckingEnabled (true); -if (javax.swing.JFrame.isDefaultLookAndFeelDecorated ()) { -var supportsWindowDecorations = javax.swing.UIManager.getLookAndFeel ().getSupportsWindowDecorations (); -if (supportsWindowDecorations) { -this.setUndecorated (true); -this.getRootPane ().setWindowDecorationStyle (1); -}}}); -Clazz_defineMethod (c$, "createRootPane", -function () { -var rp = new javax.swing.JRootPane (); -rp.setOpaque (true); -return rp; -}); -Clazz_defineMethod (c$, "processWindowEvent", -function (e) { -Clazz_superCall (this, javax.swing.JFrame, "processWindowEvent", [e]); -if (e.getID () == 201) { -switch (this.defaultCloseOperation) { -case 1: -this.setVisible (false); -break; -case 2: -this.dispose (); -break; -case 0: -default: -break; -case 3: -System.exit (0); -break; -} -}}, "java.awt.event.WindowEvent"); -Clazz_defineMethod (c$, "setDefaultCloseOperation", -function (operation) { -if (operation != 0 && operation != 1 && operation != 2 && operation != 3) { -throw new IllegalArgumentException ("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE"); -}if (this.defaultCloseOperation != operation) { -if (operation == 3) { -var security = System.getSecurityManager (); -if (security != null) { -security.checkExit (0); -}}var oldValue = this.defaultCloseOperation; -this.defaultCloseOperation = operation; -this.firePropertyChangeInt ("defaultCloseOperation", oldValue, operation); -}}, "~N"); -Clazz_defineMethod (c$, "getDefaultCloseOperation", -function () { -return this.defaultCloseOperation; -}); -Clazz_defineMethod (c$, "setTransferHandler", -function (newHandler) { -var oldHandler = this.transferHandler; -this.transferHandler = newHandler; -javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); -this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); -}, "javax.swing.TransferHandler"); -Clazz_defineMethod (c$, "getTransferHandler", -function () { -return this.transferHandler; -}); -Clazz_overrideMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "setJMenuBar", -function (menubar) { -this.getRootPane ().setMenuBar (menubar); -}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "getJMenuBar", -function () { -return this.getRootPane ().getMenuBar (); -}); -Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", -function () { -return this.rootPaneCheckingEnabled; -}); -Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", -function (enabled) { -this.rootPaneCheckingEnabled = enabled; -}, "~B"); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -if (this.isRootPaneCheckingEnabled ()) { -return this.getContentPane ().add (comp, constraints, index); -}return this.addImplSAEM (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "remove", -function (comp) { -if (comp === this.rootPane) { -this.removeChild (comp); -} else { -this.getContentPane ().removeChild (comp); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "setLayout", -function (manager) { -if (this.isRootPaneCheckingEnabled ()) { -this.getContentPane ().setLayout (manager); -} else { -Clazz_superCall (this, javax.swing.JFrame, "setLayout", [manager]); -}}, "java.awt.LayoutManager"); -Clazz_overrideMethod (c$, "getRootPane", -function () { -return this.rootPane; -}); -Clazz_defineMethod (c$, "setRootPane", -function (root) { -if (this.rootPane != null) { -this.remove (this.rootPane); -}this.rootPane = root; -if (this.rootPane != null) { -var checkingEnabled = this.isRootPaneCheckingEnabled (); -try { -this.setRootPaneCheckingEnabled (false); -this.add (this.rootPane, "Center"); -} finally { -this.setRootPaneCheckingEnabled (checkingEnabled); -} -}}, "javax.swing.JRootPane"); -Clazz_overrideMethod (c$, "getContentPane", -function () { -return this.getRootPane ().getContentPane (); -}); -Clazz_overrideMethod (c$, "setContentPane", -function (contentPane) { -this.getRootPane ().setContentPane (contentPane); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayeredPane", -function () { -return this.getRootPane ().getLayeredPane (); -}); -Clazz_overrideMethod (c$, "setLayeredPane", -function (layeredPane) { -this.getRootPane ().setLayeredPane (layeredPane); -}, "javax.swing.JLayeredPane"); -Clazz_overrideMethod (c$, "getGlassPane", -function () { -return this.getRootPane ().getGlassPane (); -}); -Clazz_overrideMethod (c$, "setGlassPane", -function (glassPane) { -this.getRootPane ().setGlassPane (glassPane); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getGraphics", -function () { -javax.swing.JComponent.getGraphicsInvoked (this); -return Clazz_superCall (this, javax.swing.JFrame, "getGraphics", []); -}); -Clazz_defineMethod (c$, "repaint", -function (time, x, y, width, height) { -if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { -javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); -} else { -Clazz_superCall (this, javax.swing.JFrame, "repaint", [time, x, y, width, height]); -}}, "~N,~N,~N,~N,~N"); -c$.setDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "setDefaultLookAndFeelDecorated", -function (defaultLookAndFeelDecorated) { -if (defaultLookAndFeelDecorated) { -javax.swing.SwingUtilities.appContextPut (javax.swing.JFrame.defaultLookAndFeelDecoratedKey, Boolean.TRUE); -} else { -javax.swing.SwingUtilities.appContextPut (javax.swing.JFrame.defaultLookAndFeelDecoratedKey, Boolean.FALSE); -}}, "~B"); -c$.isDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "isDefaultLookAndFeelDecorated", -function () { -var defaultLookAndFeelDecorated = javax.swing.SwingUtilities.appContextGet (javax.swing.JFrame.defaultLookAndFeelDecoratedKey); -if (defaultLookAndFeelDecorated == null) { -defaultLookAndFeelDecorated = Boolean.FALSE; -}return defaultLookAndFeelDecorated.booleanValue (); -}); -Clazz_defineMethod (c$, "paramString", -function () { -var defaultCloseOperationString; -if (this.defaultCloseOperation == 1) { -defaultCloseOperationString = "HIDE_ON_CLOSE"; -} else if (this.defaultCloseOperation == 2) { -defaultCloseOperationString = "DISPOSE_ON_CLOSE"; -} else if (this.defaultCloseOperation == 0) { -defaultCloseOperationString = "DO_NOTHING_ON_CLOSE"; -} else if (this.defaultCloseOperation == 3) { -defaultCloseOperationString = "EXIT_ON_CLOSE"; -} else defaultCloseOperationString = ""; -var rootPaneString = (this.rootPane != null ? this.rootPane.toString () : ""); -var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JFrame, "paramString", []) + ",defaultCloseOperation=" + defaultCloseOperationString + ",rootPane=" + rootPaneString + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; -}); -Clazz_defineStatics (c$, -"EXIT_ON_CLOSE", 3); -c$.defaultLookAndFeelDecoratedKey = c$.prototype.defaultLookAndFeelDecoratedKey = new Clazz._O (); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Window", "javax.swing.RootPaneContainer"], "javax.swing.JWindow", ["javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities"], function () { -c$ = Clazz_decorateAsClass (function () { -this.rootPane = null; -this.rootPaneCheckingEnabled = false; -this.transferHandler = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JWindow", java.awt.Window, javax.swing.RootPaneContainer); -Clazz_makeConstructor (c$, -function () { -this.construct (Clazz_castNullAs ("java.awt.Frame")); -}); -Clazz_makeConstructor (c$, -function (gc) { -this.construct (null, gc); -Clazz_superCall (this, javax.swing.JWindow, "setFocusableWindowState", [false]); -}, "java.awt.GraphicsConfiguration"); -Clazz_makeConstructor (c$, -function (owner) { -Clazz_superConstructor (this, javax.swing.JWindow, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner]); -if (owner == null) { -var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); -this.addWindowListener (ownerShutdownListener); -}this.windowInit (); -}, "java.awt.Frame"); -Clazz_makeConstructor (c$, -function (owner) { -Clazz_superConstructor (this, javax.swing.JWindow, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner]); -if (owner == null) { -var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); -this.addWindowListener (ownerShutdownListener); -}this.windowInit (); -}, "java.awt.Window"); -Clazz_makeConstructor (c$, -function (owner, gc) { -Clazz_superConstructor (this, javax.swing.JWindow, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner, gc]); -if (owner == null) { -var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); -this.addWindowListener (ownerShutdownListener); -}this.windowInit (); -}, "java.awt.Window,java.awt.GraphicsConfiguration"); -Clazz_defineMethod (c$, "windowInit", -function () { -this.setLocale (javax.swing.JComponent.getDefaultLocale ()); -this.setRootPane (this.createRootPane ()); -this.setRootPaneCheckingEnabled (true); -}); -Clazz_defineMethod (c$, "createRootPane", -function () { -var rp = new javax.swing.JRootPane (); -rp.setOpaque (true); -return rp; -}); -Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", -function () { -return this.rootPaneCheckingEnabled; -}); -Clazz_defineMethod (c$, "setTransferHandler", -function (newHandler) { -var oldHandler = this.transferHandler; -this.transferHandler = newHandler; -javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); -this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); -}, "javax.swing.TransferHandler"); -Clazz_defineMethod (c$, "getTransferHandler", -function () { -return this.transferHandler; -}); -Clazz_overrideMethod (c$, "update", -function (g) { -this.paint (g); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", -function (enabled) { -this.rootPaneCheckingEnabled = enabled; -}, "~B"); -Clazz_overrideMethod (c$, "addImpl", -function (comp, constraints, index) { -if (this.isRootPaneCheckingEnabled ()) { -return this.getContentPane ().add (comp, constraints, index); -}return this.addImplSAEM (comp, constraints, index); -}, "java.awt.Component,~O,~N"); -Clazz_defineMethod (c$, "remove", -function (comp) { -if (comp === this.rootPane) { -this.removeChild (comp); -} else { -this.getContentPane ().removeChild (comp); -}}, "java.awt.Component"); -Clazz_defineMethod (c$, "setLayout", -function (manager) { -if (this.isRootPaneCheckingEnabled ()) { -this.getContentPane ().setLayout (manager); -} else { -Clazz_superCall (this, javax.swing.JWindow, "setLayout", [manager]); -}}, "java.awt.LayoutManager"); -Clazz_overrideMethod (c$, "getRootPane", -function () { -return this.rootPane; -}); -Clazz_defineMethod (c$, "setRootPane", -function (root) { -if (this.rootPane != null) { -this.remove (this.rootPane); -}this.rootPane = root; -if (this.rootPane != null) { -var checkingEnabled = this.isRootPaneCheckingEnabled (); -try { -this.setRootPaneCheckingEnabled (false); -this.add (this.rootPane, "Center"); -} finally { -this.setRootPaneCheckingEnabled (checkingEnabled); -} -}}, "javax.swing.JRootPane"); -Clazz_overrideMethod (c$, "getContentPane", -function () { -return this.getRootPane ().getContentPane (); -}); -Clazz_overrideMethod (c$, "setContentPane", -function (contentPane) { -this.getRootPane ().setContentPane (contentPane); -}, "java.awt.Container"); -Clazz_overrideMethod (c$, "getLayeredPane", -function () { -return this.getRootPane ().getLayeredPane (); -}); -Clazz_overrideMethod (c$, "setLayeredPane", -function (layeredPane) { -this.getRootPane ().setLayeredPane (layeredPane); -}, "javax.swing.JLayeredPane"); -Clazz_overrideMethod (c$, "getGlassPane", -function () { -return this.getRootPane ().getGlassPane (); -}); -Clazz_overrideMethod (c$, "setGlassPane", -function (glassPane) { -this.getRootPane ().setGlassPane (glassPane); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getGraphics", -function () { -javax.swing.JComponent.getGraphicsInvoked (this); -return Clazz_superCall (this, javax.swing.JWindow, "getGraphics", []); -}); -Clazz_defineMethod (c$, "repaint", -function (time, x, y, width, height) { -if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { -javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); -} else { -Clazz_superCall (this, javax.swing.JWindow, "repaint", [time, x, y, width, height]); -}}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "paramString", -function () { -var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JWindow, "paramString", []) + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; -}); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.util.Hashtable"], "javax.swing.KeyboardManager", ["java.lang.Thread", "java.util.Vector", "java.applet.Applet", "java.awt.Window", "javax.swing.JComponent", "$.JMenuBar", "$.KeyStroke"], function () { -c$ = Clazz_decorateAsClass (function () { -this.containerMap = null; -this.componentKeyStrokeMap = null; -if (!Clazz_isClassDefined ("javax.swing.KeyboardManager.ComponentKeyStrokePair")) { -javax.swing.KeyboardManager.$KeyboardManager$ComponentKeyStrokePair$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "KeyboardManager"); -Clazz_prepareFields (c$, function () { -this.containerMap = new java.util.Hashtable (); -this.componentKeyStrokeMap = new java.util.Hashtable (); -}); -c$.getCurrentManager = Clazz_defineMethod (c$, "getCurrentManager", -function () { -return javax.swing.KeyboardManager.currentManager; -}); -c$.setCurrentManager = Clazz_defineMethod (c$, "setCurrentManager", -function (km) { -javax.swing.KeyboardManager.currentManager = km; -}, "javax.swing.KeyboardManager"); -Clazz_defineMethod (c$, "registerKeyStroke", -function (k, c) { -var topContainer = javax.swing.KeyboardManager.getTopAncestor (c); -if (topContainer == null) { -return; -}var keyMap = this.containerMap.get (topContainer); -if (keyMap == null) { -keyMap = this.registerNewTopContainer (topContainer); -}var tmp = keyMap.get (k); -if (tmp == null) { -keyMap.put (k, c); -} else if (Clazz_instanceOf (tmp, java.util.Vector)) { -var v = tmp; -if (!v.contains (c)) { -v.addElement (c); -}} else if (Clazz_instanceOf (tmp, javax.swing.JComponent)) { -if (tmp !== c) { -var v = new java.util.Vector (); -v.addElement (tmp); -v.addElement (c); -keyMap.put (k, v); -}} else { -System.out.println ("Unexpected condition in registerKeyStroke"); -Thread.dumpStack (); -}this.componentKeyStrokeMap.put (Clazz_innerTypeInstance (javax.swing.KeyboardManager.ComponentKeyStrokePair, this, null, c, k), topContainer); -}, "javax.swing.KeyStroke,javax.swing.JComponent"); -c$.getTopAncestor = Clazz_defineMethod (c$, "getTopAncestor", - function (c) { -for (var p = c.getParent (); p != null; p = p.getParent ()) { -if (Clazz_instanceOf (p, java.awt.Window) && (p).isFocusableWindow () || Clazz_instanceOf (p, java.applet.Applet)) { -return p; -}} -return null; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "unregisterKeyStroke", -function (ks, c) { -var ckp = Clazz_innerTypeInstance (javax.swing.KeyboardManager.ComponentKeyStrokePair, this, null, c, ks); -var topContainer = this.componentKeyStrokeMap.get (ckp); -if (topContainer == null) { -return; -}var keyMap = this.containerMap.get (topContainer); -if (keyMap == null) { -Thread.dumpStack (); -return; -}var tmp = keyMap.get (ks); -if (tmp == null) { -Thread.dumpStack (); -return; -}if (Clazz_instanceOf (tmp, javax.swing.JComponent) && tmp === c) { -keyMap.remove (ks); -} else if (Clazz_instanceOf (tmp, java.util.Vector)) { -var v = tmp; -v.removeElement (c); -if (v.isEmpty ()) { -keyMap.remove (ks); -}}if (keyMap.isEmpty ()) { -this.containerMap.remove (topContainer); -}this.componentKeyStrokeMap.remove (ckp); -}, "javax.swing.KeyStroke,javax.swing.JComponent"); -Clazz_defineMethod (c$, "fireKeyboardAction", -function (e, pressed, topAncestor) { -if (e.isConsumed ()) { -System.out.println ("Aquired pre-used event!"); -Thread.dumpStack (); -}var ks; -if (e.getID () == 400) { -ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ()); -} else { -ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), !pressed); -}var keyMap = this.containerMap.get (topAncestor); -if (keyMap != null) { -var tmp = keyMap.get (ks); -if (tmp == null) { -} else if (Clazz_instanceOf (tmp, javax.swing.JComponent)) { -var c = tmp; -if (c.isShowing () && c.isEnabled ()) { -this.fireBinding (c, ks, e, pressed); -}} else if (Clazz_instanceOf (tmp, java.util.Vector)) { -var v = tmp; -for (var counter = v.size () - 1; counter >= 0; counter--) { -var c = v.elementAt (counter); -if (c.isShowing () && c.isEnabled ()) { -this.fireBinding (c, ks, e, pressed); -if (e.isConsumed ()) return true; -}} -} else { -System.out.println ("Unexpected condition in fireKeyboardAction " + tmp); -Thread.dumpStack (); -}}if (e.isConsumed ()) { -return true; -}if (keyMap != null) { -var v = keyMap.get (javax.swing.JMenuBar); -if (v != null) { -var iter = v.elements (); -while (iter.hasMoreElements ()) { -var mb = iter.nextElement (); -if (mb.isShowing () && mb.isEnabled ()) { -this.fireBinding (mb, ks, e, pressed); -if (e.isConsumed ()) { -return true; -}}} -}}return e.isConsumed (); -}, "java.awt.event.KeyEvent,~B,java.awt.Container"); -Clazz_defineMethod (c$, "fireBinding", -function (c, ks, e, pressed) { -if (c.processKeyBinding (ks, e, 2, pressed)) { -e.consume (); -}}, "javax.swing.JComponent,javax.swing.KeyStroke,java.awt.event.KeyEvent,~B"); -Clazz_defineMethod (c$, "registerMenuBar", -function (mb) { -var top = javax.swing.KeyboardManager.getTopAncestor (mb); -if (top == null) { -return; -}var keyMap = this.containerMap.get (top); -if (keyMap == null) { -keyMap = this.registerNewTopContainer (top); -}var menuBars = keyMap.get (javax.swing.JMenuBar); -if (menuBars == null) { -menuBars = new java.util.Vector (); -keyMap.put (javax.swing.JMenuBar, menuBars); -}if (!menuBars.contains (mb)) { -menuBars.addElement (mb); -}}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "unregisterMenuBar", -function (mb) { -var topContainer = javax.swing.KeyboardManager.getTopAncestor (mb); -if (topContainer == null) { -return; -}var keyMap = this.containerMap.get (topContainer); -if (keyMap != null) { -var v = keyMap.get (javax.swing.JMenuBar); -if (v != null) { -v.removeElement (mb); -if (v.isEmpty ()) { -keyMap.remove (javax.swing.JMenuBar); -if (keyMap.isEmpty ()) { -this.containerMap.remove (topContainer); -}}}}}, "javax.swing.JMenuBar"); -Clazz_defineMethod (c$, "registerNewTopContainer", -function (topContainer) { -var keyMap = new java.util.Hashtable (); -this.containerMap.put (topContainer, keyMap); -return keyMap; -}, "java.awt.Container"); -c$.$KeyboardManager$ComponentKeyStrokePair$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -this.component = null; -this.keyStroke = null; -Clazz_instantialize (this, arguments); -}, javax.swing.KeyboardManager, "ComponentKeyStrokePair"); -Clazz_makeConstructor (c$, -function (a, b) { -this.component = a; -this.keyStroke = b; -}, "~O,~O"); -Clazz_defineMethod (c$, "equals", -function (a) { -if (!(Clazz_instanceOf (a, javax.swing.KeyboardManager.ComponentKeyStrokePair))) { -return false; -}var b = a; -return ((this.component.equals (b.component)) && (this.keyStroke.equals (b.keyStroke))); -}, "~O"); -Clazz_defineMethod (c$, "hashCode", -function () { -return this.component.hashCode () * this.keyStroke.hashCode (); -}); -c$ = Clazz_p0p (); -}; -c$.currentManager = c$.prototype.currentManager = new javax.swing.KeyboardManager (); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent", "$.MenuElement"], "javax.swing.JMenuBar", ["java.lang.Error", "java.util.Vector", "java.awt.Insets", "javax.swing.DefaultSingleSelectionModel", "$.JMenu", "$.JPopupMenu", "$.KeyboardManager", "$.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.selectionModel = null; -this.$paintBorder = true; -this.margin = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JMenuBar", javax.swing.JComponent, javax.swing.MenuElement); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JMenuBar); -this.setSelectionModel ( new javax.swing.DefaultSingleSelectionModel ()); -this.updateUI (); -}); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "MenuBarUI"; -}); -Clazz_defineMethod (c$, "getSelectionModel", -function () { -return this.selectionModel; -}); -Clazz_defineMethod (c$, "setSelectionModel", -function (model) { -var oldValue = this.selectionModel; -this.selectionModel = model; -this.firePropertyChangeObject ("selectionModel", oldValue, this.selectionModel); -}, "javax.swing.SingleSelectionModel"); -Clazz_defineMethod (c$, "add", -function (c) { -Clazz_superCall (this, javax.swing.JMenuBar, "add", [c]); -return c; -}, "javax.swing.JMenu"); -Clazz_defineMethod (c$, "getMenu", -function (index) { -var c = this.getComponentAtIndex (index); -if (Clazz_instanceOf (c, javax.swing.JMenu)) return c; -return null; -}, "~N"); -Clazz_defineMethod (c$, "getMenuCount", -function () { -return this.getComponentCount (); -}); -Clazz_defineMethod (c$, "setHelpMenu", -function (menu) { -throw new Error ("setHelpMenu() not yet implemented."); -}, "javax.swing.JMenu"); -Clazz_defineMethod (c$, "getHelpMenu", -function () { -throw new Error ("getHelpMenu() not yet implemented."); -}); -Clazz_defineMethod (c$, "getComponentAtIndex", -function (i) { -if (i < 0 || i >= this.getComponentCount ()) { -return null; -}return this.getComponent (i); -}, "~N"); -Clazz_defineMethod (c$, "getComponentIndex", -function (c) { -var ncomponents = this.getComponentCount (); -var component = this.getComponents (); -for (var i = 0; i < ncomponents; i++) { -var comp = component[i]; -if (comp === c) return i; -} -return -1; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "setSelected", -function (sel) { -var model = this.getSelectionModel (); -var index = this.getComponentIndex (sel); -model.setSelectedIndex (index); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "isSelected", -function () { -return this.selectionModel.isSelected (); -}); -Clazz_defineMethod (c$, "isBorderPainted", -function () { -return this.$paintBorder; -}); -Clazz_defineMethod (c$, "setBorderPainted", -function (b) { -var oldValue = this.$paintBorder; -this.$paintBorder = b; -this.firePropertyChangeBool ("borderPainted", oldValue, this.$paintBorder); -if (b != oldValue) { -this.revalidate (); -this.repaint (); -}}, "~B"); -Clazz_defineMethod (c$, "paintBorder", -function (g) { -if (this.isBorderPainted ()) { -Clazz_superCall (this, javax.swing.JMenuBar, "paintBorder", [g]); -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "setMargin", -function (m) { -var old = this.margin; -this.margin = m; -this.firePropertyChangeObject ("margin", old, m); -if (old == null || !old.equals (m)) { -this.revalidate (); -this.repaint (); -}}, "java.awt.Insets"); -Clazz_defineMethod (c$, "getMargin", -function () { -if (this.margin == null) { -return new java.awt.Insets (0, 0, 0, 0); -} else { -return this.margin; -}}); -Clazz_defineMethod (c$, "processMouseEvent", -function (event, path, manager) { -}, "java.awt.event.MouseEvent,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "processKeyEvent", -function (e, path, manager) { -}, "java.awt.event.KeyEvent,~A,javax.swing.MenuSelectionManager"); -Clazz_overrideMethod (c$, "menuSelectionChanged", -function (isIncluded) { -}, "~B"); -Clazz_defineMethod (c$, "getSubElements", -function () { -var result; -var tmp = new java.util.Vector (); -var c = this.getComponentCount (); -var i; -var m; -for (i = 0; i < c; i++) { -m = this.getComponent (i); -if (Clazz_instanceOf (m, javax.swing.MenuElement)) tmp.addElement (m); -} -result = new Array (tmp.size ()); -for (i = 0, c = tmp.size (); i < c; i++) result[i] = tmp.elementAt (i); - -return result; -}); -Clazz_defineMethod (c$, "getComponent", -function () { -return this; -}); -Clazz_defineMethod (c$, "paramString", -function () { -var paintBorderString = (this.$paintBorder ? "true" : "false"); -var marginString = (this.margin != null ? this.margin.toString () : ""); -return Clazz_superCall (this, javax.swing.JMenuBar, "paramString", []) + ",margin=" + marginString + ",paintBorder=" + paintBorderString; -}); -Clazz_defineMethod (c$, "processKeyBinding", -function (ks, e, condition, pressed) { -var retValue = Clazz_superCall (this, javax.swing.JMenuBar, "processKeyBinding", [ks, e, condition, pressed]); -if (!retValue) { -var subElements = this.getSubElements (); -for (var i = 0; i < subElements.length; i++) { -if (javax.swing.JMenuBar.processBindingForKeyStrokeRecursive (subElements[i], ks, e, condition, pressed)) { -return true; -}} -}return retValue; -}, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B"); -c$.processBindingForKeyStrokeRecursive = Clazz_defineMethod (c$, "processBindingForKeyStrokeRecursive", -function (elem, ks, e, condition, pressed) { -if (elem == null) { -return false; -}var c = elem.getComponent (); -if (!(c.isVisible () || (Clazz_instanceOf (c, javax.swing.JPopupMenu))) || !c.isEnabled ()) { -return false; -}if (c != null && Clazz_instanceOf (c, javax.swing.JComponent) && (c).processKeyBinding (ks, e, condition, pressed)) { -return true; -}var subElements = elem.getSubElements (); -for (var i = 0; i < subElements.length; i++) { -if (javax.swing.JMenuBar.processBindingForKeyStrokeRecursive (subElements[i], ks, e, condition, pressed)) { -return true; -}} -return false; -}, "javax.swing.MenuElement,javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B"); -Clazz_defineMethod (c$, "addNotify", -function () { -Clazz_superCall (this, javax.swing.JMenuBar, "addNotify", []); -javax.swing.KeyboardManager.getCurrentManager ().registerMenuBar (this); -}); -Clazz_defineMethod (c$, "removeNotify", -function () { -Clazz_superCall (this, javax.swing.JMenuBar, "removeNotify", []); -javax.swing.KeyboardManager.getCurrentManager ().unregisterMenuBar (this); -}); -Clazz_defineStatics (c$, -"$uiClassID", "MenuBarUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "MenuElement"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.SingleSelectionModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultSingleSelectionModel", ["javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.changeEvent = null; -this.listenerList = null; -this.index = -1; -Clazz_instantialize (this, arguments); -}, javax.swing, "DefaultSingleSelectionModel", null, javax.swing.SingleSelectionModel); -Clazz_prepareFields (c$, function () { -this.listenerList = new javax.swing.event.EventListenerList (); -}); -Clazz_overrideMethod (c$, "getSelectedIndex", -function () { -return this.index; -}); -Clazz_overrideMethod (c$, "setSelectedIndex", -function (index) { -if (this.index != index) { -this.index = index; -this.fireStateChanged (); -}}, "~N"); -Clazz_overrideMethod (c$, "clearSelection", -function () { -this.setSelectedIndex (-1); -}); -Clazz_overrideMethod (c$, "isSelected", -function () { -var ret = false; -if (this.getSelectedIndex () != -1) { -ret = true; -}return ret; -}); -Clazz_overrideMethod (c$, "addChangeListener", -function (l) { -this.listenerList.add (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_overrideMethod (c$, "removeChangeListener", -function (l) { -this.listenerList.remove (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "getChangeListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.ChangeListener); -}); -Clazz_defineMethod (c$, "fireStateChanged", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.ChangeListener) { -if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); -(listeners[i + 1]).stateChanged (this.changeEvent); -}} -}); -Clazz_defineMethod (c$, "getListeners", -function (listenerType) { -return this.listenerList.getListeners (listenerType); -}, "Class"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "SingleSelectionModel"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.event.WindowAdapter", "javax.swing.JMenuItem", "$.MenuElement", "javax.swing.event.ChangeListener"], "javax.swing.JMenu", ["java.lang.Error", "$.IllegalArgumentException", "java.util.Vector", "java.awt.Point", "$.Rectangle", "$.Toolkit", "javax.swing.JMenuBar", "$.JPopupMenu", "$.MenuSelectionManager", "$.SwingUtilities", "$.UIManager", "javax.swing.event.MenuEvent", "$.MenuListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.$popupMenu = null; -this.menuChangeListener = null; -this.menuEvent = null; -this.delay = 0; -this.customMenuLocation = null; -this.popupListener = null; -if (!Clazz_isClassDefined ("javax.swing.JMenu.MenuChangeListener")) { -javax.swing.JMenu.$JMenu$MenuChangeListener$ (); -} -if (!Clazz_isClassDefined ("javax.swing.JMenu.WinListener")) { -javax.swing.JMenu.$JMenu$WinListener$ (); -} -Clazz_instantialize (this, arguments); -}, javax.swing, "JMenu", javax.swing.JMenuItem, javax.swing.MenuElement); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JMenu, []); -this.init0 ("", null, -2147483648); -}); -Clazz_makeConstructor (c$, -function (s) { -Clazz_superConstructor (this, javax.swing.JMenu, []); -this.init0 (s, null, -2147483648); -}, "~S"); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, javax.swing.JMenu, []); -this.init0 ("", null, -2147483648); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (s, b) { -Clazz_superConstructor (this, javax.swing.JMenu, []); -this.init0 (s, null, -2147483648); -}, "~S,~B"); -Clazz_overrideMethod (c$, "initFocusability", -function () { -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -if (this.$popupMenu != null) { -this.$popupMenu.setUI (javax.swing.UIManager.getUI (this.$popupMenu)); -}}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "MenuUI"; -}); -Clazz_defineMethod (c$, "setModel", -function (newModel) { -var oldModel = this.getModel (); -Clazz_superCall (this, javax.swing.JMenu, "setModel", [newModel]); -if (oldModel != null && this.menuChangeListener != null) { -oldModel.removeChangeListener (this.menuChangeListener); -this.menuChangeListener = null; -}this.model = newModel; -if (newModel != null) { -this.menuChangeListener = this.createMenuChangeListener (); -newModel.addChangeListener (this.menuChangeListener); -}}, "javax.swing.ButtonModel"); -Clazz_overrideMethod (c$, "isSelected", -function () { -return this.getModel ().isSelected (); -}); -Clazz_overrideMethod (c$, "setSelected", -function (b) { -var model = this.getModel (); -if (b != model.isSelected ()) { -this.getModel ().setSelected (b); -}}, "~B"); -Clazz_defineMethod (c$, "isPopupMenuVisible", -function () { -this.ensurePopupMenuCreated (); -return this.$popupMenu.isVisible (); -}); -Clazz_defineMethod (c$, "setPopupMenuVisible", -function (b) { -var isVisible = this.isPopupMenuVisible (); -if (b != isVisible && (this.isEnabled () || !b)) { -this.ensurePopupMenuCreated (); -if ((b == true) && this.isShowing ()) { -var p = this.getCustomMenuLocation (); -if (p == null) { -p = this.getPopupMenuOrigin (); -}this.getPopupMenu ().show (this, p.x, p.y); -} else { -this.getPopupMenu ().setVisible (false); -}}}, "~B"); -Clazz_defineMethod (c$, "getPopupMenuOrigin", -function () { -var x = 0; -var y = 0; -var pm = this.getPopupMenu (); -var s = this.getSize (); -var pmSize = pm.getSize (); -if (pmSize.width == 0) { -pmSize = pm.getPreferredSize (); -}var position = this.getLocationOnScreen (); -var toolkit = java.awt.Toolkit.getDefaultToolkit (); -var gc = this.getGraphicsConfiguration (); -var screenBounds = new java.awt.Rectangle (toolkit.getScreenSize ()); -if (gc != null) { -screenBounds = gc.getBounds (); -var screenInsets = toolkit.getScreenInsets (gc); -screenBounds.width -= Math.abs (screenInsets.left + screenInsets.right); -screenBounds.height -= Math.abs (screenInsets.top + screenInsets.bottom); -position.x -= Math.abs (screenInsets.left); -position.y -= Math.abs (screenInsets.top); -}var parent = this.getParent (); -if (Clazz_instanceOf (parent, javax.swing.JPopupMenu)) { -var xOffset = javax.swing.UIManager.getInt ("Menu.submenuPopupOffsetX"); -var yOffset = javax.swing.UIManager.getInt ("Menu.submenuPopupOffsetY"); -if (javax.swing.SwingUtilities.isLeftToRight (this)) { -x = s.width + xOffset; -if (position.x + x + pmSize.width >= screenBounds.width + screenBounds.x && screenBounds.width - s.width < 2 * (position.x - screenBounds.x)) { -x = 0 - xOffset - pmSize.width; -}} else { -x = 0 - xOffset - pmSize.width; -if (position.x + x < screenBounds.x && screenBounds.width - s.width > 2 * (position.x - screenBounds.x)) { -x = s.width + xOffset; -}}y = yOffset; -if (position.y + y + pmSize.height >= screenBounds.height + screenBounds.y && screenBounds.height - s.height < 2 * (position.y - screenBounds.y)) { -y = s.height - yOffset - pmSize.height; -}} else { -var xOffset = javax.swing.UIManager.getInt ("Menu.menuPopupOffsetX"); -var yOffset = javax.swing.UIManager.getInt ("Menu.menuPopupOffsetY"); -if (javax.swing.SwingUtilities.isLeftToRight (this)) { -x = xOffset; -if (position.x + x + pmSize.width >= screenBounds.width + screenBounds.x && screenBounds.width - s.width < 2 * (position.x - screenBounds.x)) { -x = s.width - xOffset - pmSize.width; -}} else { -x = s.width - xOffset - pmSize.width; -if (position.x + x < screenBounds.x && screenBounds.width - s.width > 2 * (position.x - screenBounds.x)) { -x = xOffset; -}}y = s.height + yOffset; -if (position.y + y + pmSize.height >= screenBounds.height && screenBounds.height - s.height < 2 * (position.y - screenBounds.y)) { -y = 0 - yOffset - pmSize.height; -}}return new java.awt.Point (x, y); -}); -Clazz_defineMethod (c$, "getDelay", -function () { -return this.delay; -}); -Clazz_defineMethod (c$, "setDelay", -function (d) { -if (d < 0) throw new IllegalArgumentException ("Delay must be a positive integer"); -this.delay = d; -}, "~N"); -Clazz_defineMethod (c$, "ensurePopupMenuCreated", - function () { -if (this.$popupMenu == null) { -this.$popupMenu = new javax.swing.JPopupMenu (); -this.$popupMenu.setInvoker (this); -this.popupListener = this.createWinListener (this.$popupMenu); -}}); -Clazz_defineMethod (c$, "getCustomMenuLocation", - function () { -return this.customMenuLocation; -}); -Clazz_defineMethod (c$, "setMenuLocation", -function (x, y) { -this.customMenuLocation = new java.awt.Point (x, y); -if (this.$popupMenu != null) this.$popupMenu.setLocation (x, y); -}, "~N,~N"); -Clazz_defineMethod (c$, "add", -function (menuItem) { -this.ensurePopupMenuCreated (); -return this.$popupMenu.add (menuItem); -}, "javax.swing.JMenuItem"); -Clazz_defineMethod (c$, "add", -function (c) { -this.ensurePopupMenuCreated (); -this.$popupMenu.add (c); -return c; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "add", -function (c, index) { -this.ensurePopupMenuCreated (); -this.$popupMenu.add (c, index); -return c; -}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "add", -function (s) { -return this.add ( new javax.swing.JMenuItem (s)); -}, "~S"); -Clazz_defineMethod (c$, "add", -function (a) { -var mi = this.createActionComponent (a); -mi.setAction (a); -this.add (mi); -return mi; -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createActionComponent", -function (a) { -var mi = ((Clazz_isClassDefined ("javax.swing.JMenu$1") ? 0 : javax.swing.JMenu.$JMenu$1$ ()), Clazz_innerTypeInstance (javax.swing.JMenu$1, this, null)); -mi.setHorizontalTextPosition (11); -mi.setVerticalTextPosition (0); -return mi; -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createActionChangeListener", -function (b) { -return b.createActionPropertyChangeListener0 (b.getAction ()); -}, "javax.swing.JMenuItem"); -Clazz_defineMethod (c$, "addSeparator", -function () { -this.ensurePopupMenuCreated (); -this.$popupMenu.addSeparator (); -}); -Clazz_defineMethod (c$, "insert", -function (s, pos) { -if (pos < 0) { -throw new IllegalArgumentException ("index less than zero."); -}this.ensurePopupMenuCreated (); -this.$popupMenu.insert ( new javax.swing.JMenuItem (s), pos); -}, "~S,~N"); -Clazz_defineMethod (c$, "insert", -function (mi, pos) { -if (pos < 0) { -throw new IllegalArgumentException ("index less than zero."); -}this.ensurePopupMenuCreated (); -this.$popupMenu.insert (mi, pos); -return mi; -}, "javax.swing.JMenuItem,~N"); -Clazz_defineMethod (c$, "insert", -function (a, pos) { -if (pos < 0) { -throw new IllegalArgumentException ("index less than zero."); -}this.ensurePopupMenuCreated (); -var mi = new javax.swing.JMenuItem (a); -mi.setHorizontalTextPosition (11); -mi.setVerticalTextPosition (0); -this.$popupMenu.insert (mi, pos); -return mi; -}, "javax.swing.Action,~N"); -Clazz_defineMethod (c$, "insertSeparator", -function (index) { -if (index < 0) { -throw new IllegalArgumentException ("index less than zero."); -}this.ensurePopupMenuCreated (); -this.$popupMenu.insert ( new javax.swing.JPopupMenu.Separator (), index); -}, "~N"); -Clazz_defineMethod (c$, "getItem", -function (pos) { -if (pos < 0) { -throw new IllegalArgumentException ("index less than zero."); -}var c = this.getMenuComponent (pos); -if (Clazz_instanceOf (c, javax.swing.JMenuItem)) { -var mi = c; -return mi; -}return null; -}, "~N"); -Clazz_defineMethod (c$, "getItemCount", -function () { -return this.getMenuComponentCount (); -}); -Clazz_defineMethod (c$, "isTearOff", -function () { -throw new Error ("boolean isTearOff() {} not yet implemented"); -}); -Clazz_defineMethod (c$, "remove", -function (pos) { -if (pos < 0) { -throw new IllegalArgumentException ("index less than zero."); -}if (pos > this.getItemCount ()) { -throw new IllegalArgumentException ("index greater than the number of items."); -}if (this.$popupMenu != null) this.$popupMenu.remove (pos); -}, "~N"); -Clazz_defineMethod (c$, "remove", -function (c) { -if (Clazz_instanceOf (c, javax.swing.JMenuItem)) if (this.$popupMenu != null) this.$popupMenu.remove (c); -if (this.$popupMenu != null) this.$popupMenu.remove (c); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "removeAll", -function () { -if (this.$popupMenu != null) this.$popupMenu.removeAll (); -}); -Clazz_defineMethod (c$, "getMenuComponentCount", -function () { -var componentCount = 0; -if (this.$popupMenu != null) componentCount = this.$popupMenu.getComponentCount (); -return componentCount; -}); -Clazz_defineMethod (c$, "getMenuComponent", -function (n) { -if (this.$popupMenu != null) return this.$popupMenu.getComponent (n); -return null; -}, "~N"); -Clazz_defineMethod (c$, "getMenuComponents", -function () { -if (this.$popupMenu != null) return this.$popupMenu.getComponents (); -return new Array (0); -}); -Clazz_defineMethod (c$, "isTopLevelMenu", -function () { -if (Clazz_instanceOf (this.getParent (), javax.swing.JMenuBar)) return true; -return false; -}); -Clazz_defineMethod (c$, "isMenuComponent", -function (c) { -if (c === this) return true; -if (Clazz_instanceOf (c, javax.swing.JPopupMenu)) { -var comp = c; -if (comp === this.getPopupMenu ()) return true; -}var ncomponents = this.getMenuComponentCount (); -var component = this.getMenuComponents (); -for (var i = 0; i < ncomponents; i++) { -var comp = component[i]; -if (comp === c) return true; -if (Clazz_instanceOf (comp, javax.swing.JMenu)) { -var subMenu = comp; -if (subMenu.isMenuComponent (c)) return true; -}} -return false; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getPopupMenu", -function () { -this.ensurePopupMenuCreated (); -return this.$popupMenu; -}); -Clazz_defineMethod (c$, "addMenuListener", -function (l) { -this.listenerList.add (javax.swing.event.MenuListener, l); -}, "javax.swing.event.MenuListener"); -Clazz_defineMethod (c$, "removeMenuListener", -function (l) { -this.listenerList.remove (javax.swing.event.MenuListener, l); -}, "javax.swing.event.MenuListener"); -Clazz_defineMethod (c$, "getMenuListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.MenuListener); -}); -Clazz_defineMethod (c$, "fireMenuSelected", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuListener) { -if (listeners[i + 1] == null) { -throw new Error (this.getText () + " has a NULL Listener!! " + i); -} else { -if (this.menuEvent == null) this.menuEvent = new javax.swing.event.MenuEvent (this); -(listeners[i + 1]).menuSelected (this.menuEvent); -}}} -}); -Clazz_defineMethod (c$, "fireMenuDeselected", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuListener) { -if (listeners[i + 1] == null) { -throw new Error (this.getText () + " has a NULL Listener!! " + i); -} else { -if (this.menuEvent == null) this.menuEvent = new javax.swing.event.MenuEvent (this); -(listeners[i + 1]).menuDeselected (this.menuEvent); -}}} -}); -Clazz_defineMethod (c$, "fireMenuCanceled", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuListener) { -if (listeners[i + 1] == null) { -throw new Error (this.getText () + " has a NULL Listener!! " + i); -} else { -if (this.menuEvent == null) this.menuEvent = new javax.swing.event.MenuEvent (this); -(listeners[i + 1]).menuCanceled (this.menuEvent); -}}} -}); -Clazz_overrideMethod (c$, "configureAcceleratorFromAction", -function (a) { -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createMenuChangeListener", - function () { -return Clazz_innerTypeInstance (javax.swing.JMenu.MenuChangeListener, this, null); -}); -Clazz_defineMethod (c$, "createWinListener", -function (p) { -return Clazz_innerTypeInstance (javax.swing.JMenu.WinListener, this, null, p); -}, "javax.swing.JPopupMenu"); -Clazz_overrideMethod (c$, "menuSelectionChanged", -function (isIncluded) { -this.setSelected (isIncluded); -}, "~B"); -Clazz_overrideMethod (c$, "getSubElements", -function () { -if (this.$popupMenu == null) return new Array (0); - else { -var result = new Array (1); -result[0] = this.$popupMenu; -return result; -}}); -Clazz_defineMethod (c$, "getComponent", -function () { -return this; -}); -Clazz_defineMethod (c$, "applyComponentOrientation", -function (o) { -Clazz_superCall (this, javax.swing.JMenu, "applyComponentOrientation", [o]); -if (this.$popupMenu != null) { -var ncomponents = this.getMenuComponentCount (); -for (var i = 0; i < ncomponents; ++i) { -this.getMenuComponent (i).applyComponentOrientation (o); -} -this.$popupMenu.setComponentOrientation (o); -}}, "java.awt.ComponentOrientation"); -Clazz_defineMethod (c$, "setComponentOrientation", -function (o) { -Clazz_superCall (this, javax.swing.JMenu, "setComponentOrientation", [o]); -if (this.$popupMenu != null) { -this.$popupMenu.setComponentOrientation (o); -}}, "java.awt.ComponentOrientation"); -Clazz_overrideMethod (c$, "setAccelerator", -function (keyStroke) { -throw new Error ("setAccelerator() is not defined for JMenu. Use setMnemonic() instead."); -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "processKeyEvent", -function (evt) { -javax.swing.MenuSelectionManager.defaultManager ().processKeyEvent (evt); -if (evt.isConsumed ()) return; -Clazz_superCall (this, javax.swing.JMenu, "processKeyEvent", [evt]); -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "doClick", -function (pressTime) { -var me = this.buildMenuElementArray (this); -javax.swing.MenuSelectionManager.defaultManager ().setSelectedPath (me); -}, "~N"); -Clazz_defineMethod (c$, "buildMenuElementArray", - function (leaf) { -var elements = new java.util.Vector (); -var current = leaf.getPopupMenu (); -var pop; -var menu; -var bar; -while (true) { -if (Clazz_instanceOf (current, javax.swing.JPopupMenu)) { -pop = current; -elements.insertElementAt (pop, 0); -current = pop.getInvoker (); -} else if (Clazz_instanceOf (current, javax.swing.JMenu)) { -menu = current; -elements.insertElementAt (menu, 0); -current = menu.getParent (); -} else if (Clazz_instanceOf (current, javax.swing.JMenuBar)) { -bar = current; -elements.insertElementAt (bar, 0); -var me = new Array (elements.size ()); -elements.copyInto (me); -return me; -}} -}, "javax.swing.JMenu"); -c$.$JMenu$MenuChangeListener$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -this.isSelected = false; -Clazz_instantialize (this, arguments); -}, javax.swing.JMenu, "MenuChangeListener", null, javax.swing.event.ChangeListener); -Clazz_overrideMethod (c$, "stateChanged", -function (a) { -var b = a.getSource (); -var c = b.isSelected (); -if (c != this.isSelected) { -if (c == true) { -this.b$["javax.swing.JMenu"].fireMenuSelected (); -} else { -this.b$["javax.swing.JMenu"].fireMenuDeselected (); -}this.isSelected = c; -}}, "javax.swing.event.ChangeEvent"); -c$ = Clazz_p0p (); -}; -c$.$JMenu$WinListener$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -Clazz_prepareCallback (this, arguments); -this.popupMenu = null; -Clazz_instantialize (this, arguments); -}, javax.swing.JMenu, "WinListener", java.awt.event.WindowAdapter); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, javax.swing.JMenu.WinListener, []); -this.popupMenu = a; -}, "javax.swing.JPopupMenu"); -Clazz_overrideMethod (c$, "windowClosing", -function (a) { -this.b$["javax.swing.JMenu"].setSelected (false); -}, "java.awt.event.WindowEvent"); -c$ = Clazz_p0p (); -}; -c$.$JMenu$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing, "JMenu$1", javax.swing.JMenuItem); -Clazz_defineMethod (c$, "createActionPropertyChangeListener", -function (a) { -var pcl = this.b$["javax.swing.JMenu"].createActionChangeListener (this); -if (pcl == null) { -pcl = Clazz_superCall (this, javax.swing.JMenu$1, "createActionPropertyChangeListener", [a]); -}return pcl; -}, "javax.swing.Action"); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"$$uiClassID", "MenuUI"); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.WindowFocusListener", "$.WindowListener", "$.WindowStateListener"], "java.awt.event.WindowAdapter", null, function () { -c$ = Clazz_declareType (java.awt.event, "WindowAdapter", null, [java.awt.event.WindowListener, java.awt.event.WindowStateListener, java.awt.event.WindowFocusListener]); -Clazz_overrideMethod (c$, "windowOpened", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowClosing", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowClosed", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowIconified", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowDeiconified", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowActivated", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowDeactivated", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowStateChanged", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowGainedFocus", -function (e) { -}, "java.awt.event.WindowEvent"); -Clazz_overrideMethod (c$, "windowLostFocus", -function (e) { -}, "java.awt.event.WindowEvent"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.event.FocusListener", "javax.swing.AbstractButton", "$.MenuElement"], "javax.swing.JMenuItem", ["java.lang.Boolean", "javax.swing.DefaultButtonModel", "$.UIManager", "javax.swing.event.MenuDragMouseEvent", "$.MenuDragMouseListener", "$.MenuKeyEvent", "$.MenuKeyListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.isMouseDragged = false; -this.accelerator = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JMenuItem", javax.swing.AbstractButton, javax.swing.MenuElement); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JMenuItem, []); -this.init0 (null, null, -2147483648); -}); -Clazz_makeConstructor (c$, -function (icon) { -Clazz_superConstructor (this, javax.swing.JMenuItem, []); -this.init0 (null, icon, -2147483648); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text) { -Clazz_superConstructor (this, javax.swing.JMenuItem, []); -this.init0 (text, null, -2147483648); -}, "~S"); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, javax.swing.JMenuItem, []); -this.init0 (null, null, -2147483648); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (text, icon) { -Clazz_superConstructor (this, javax.swing.JMenuItem, []); -this.init0 (text, icon, -2147483648); -}, "~S,javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text, mnemonic) { -Clazz_superConstructor (this, javax.swing.JMenuItem, []); -this.init0 (text, null, mnemonic); -}, "~S,~N"); -Clazz_defineMethod (c$, "setModel", -function (newModel) { -Clazz_superCall (this, javax.swing.JMenuItem, "setModel", [newModel]); -if (Clazz_instanceOf (newModel, javax.swing.DefaultButtonModel)) { -(newModel).setMenuItem (true); -}}, "javax.swing.ButtonModel"); -Clazz_defineMethod (c$, "initFocusability", -function () { -this.setFocusable (false); -}); -Clazz_defineMethod (c$, "init0", -function (text, icon, mnemonic) { -this.setModel ( new javax.swing.DefaultButtonModel ()); -this.init (text, icon); -if (mnemonic >= 0) this.setMnemonic (mnemonic); -this.initFocusability (); -}, "~S,javax.swing.Icon,~N"); -Clazz_overrideMethod (c$, "init", -function (text, icon) { -this.updateUI (); -if (text != null) this.setText (text); -if (icon != null) this.setIcon (icon); -this.addFocusListener ( new javax.swing.JMenuItem.MenuItemFocusListener ()); -this.setUIProperty ("borderPainted", Boolean.FALSE); -this.setFocusPainted (false); -this.setHorizontalTextPosition (11); -this.setHorizontalAlignment (10); -}, "~S,javax.swing.Icon"); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "MenuItemUI"; -}); -Clazz_defineMethod (c$, "setArmed", -function (b) { -var model = this.getModel (); -if (model.isArmed () != b) { -model.setArmed (b); -}}, "~B"); -Clazz_defineMethod (c$, "isArmed", -function () { -var model = this.getModel (); -return model.isArmed (); -}); -Clazz_defineMethod (c$, "setEnabled", -function (b) { -if (!b && !javax.swing.UIManager.getBoolean ("MenuItem.disabledAreNavigable")) { -this.setArmed (false); -}Clazz_superCall (this, javax.swing.JMenuItem, "setEnabled", [b]); -}, "~B"); -Clazz_overrideMethod (c$, "alwaysOnTop", -function () { -return true; -}); -Clazz_defineMethod (c$, "setAccelerator", -function (keyStroke) { -var oldAccelerator = this.accelerator; -this.accelerator = keyStroke; -this.repaint (); -this.revalidate (); -this.firePropertyChangeObject ("accelerator", oldAccelerator, this.accelerator); -}, "javax.swing.KeyStroke"); -Clazz_defineMethod (c$, "getAccelerator", -function () { -return this.accelerator; -}); -Clazz_defineMethod (c$, "configurePropertiesFromAction", -function (a) { -Clazz_superCall (this, javax.swing.JMenuItem, "configurePropertiesFromAction", [a]); -this.configureAcceleratorFromAction (a); -}, "javax.swing.Action"); -Clazz_overrideMethod (c$, "setIconFromAction", -function (a) { -var icon = null; -if (a != null) { -icon = a.getValue ("SmallIcon"); -}this.setIcon (icon); -}, "javax.swing.Action"); -Clazz_overrideMethod (c$, "largeIconChanged", -function (a) { -}, "javax.swing.Action"); -Clazz_overrideMethod (c$, "smallIconChanged", -function (a) { -this.setIconFromAction (a); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "configureAcceleratorFromAction", -function (a) { -var ks = (a == null) ? null : a.getValue ("AcceleratorKey"); -this.setAccelerator (ks); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "actionPropertyChanged", -function (action, propertyName) { -if (propertyName === "AcceleratorKey") { -this.configureAcceleratorFromAction (action); -} else { -Clazz_superCall (this, javax.swing.JMenuItem, "actionPropertyChanged", [action, propertyName]); -}}, "javax.swing.Action,~S"); -Clazz_defineMethod (c$, "processMouseEvent", -function (e, path, manager) { -this.processMenuDragMouseEvent ( new javax.swing.event.MenuDragMouseEvent (e.getComponent (), e.getID (), e.getWhen (), e.getModifiers (), e.getX (), e.getY (), e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), path, manager)); -}, "java.awt.event.MouseEvent,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "processKeyEvent", -function (e, path, manager) { -var mke = new javax.swing.event.MenuKeyEvent (e.getComponent (), e.getID (), e.getWhen (), e.getModifiers (), e.getKeyCode (), e.getKeyChar (), path, manager); -this.processMenuKeyEvent (mke); -if (mke.isConsumed ()) { -e.consume (); -}}, "java.awt.event.KeyEvent,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "processMenuDragMouseEvent", -function (e) { -switch (e.getID ()) { -case 504: -this.isMouseDragged = false; -this.fireMenuDragMouseEntered (e); -break; -case 505: -this.isMouseDragged = false; -this.fireMenuDragMouseExited (e); -break; -case 506: -this.isMouseDragged = true; -this.fireMenuDragMouseDragged (e); -break; -case 502: -if (this.isMouseDragged) this.fireMenuDragMouseReleased (e); -break; -default: -break; -} -}, "javax.swing.event.MenuDragMouseEvent"); -Clazz_defineMethod (c$, "processMenuKeyEvent", -function (e) { -switch (e.getID ()) { -case 401: -this.fireMenuKeyPressed (e); -break; -case 402: -this.fireMenuKeyReleased (e); -break; -case 400: -this.fireMenuKeyTyped (e); -break; -default: -break; -} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_defineMethod (c$, "fireMenuDragMouseEntered", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuDragMouseListener) { -(listeners[i + 1]).menuDragMouseEntered (event); -}} -}, "javax.swing.event.MenuDragMouseEvent"); -Clazz_defineMethod (c$, "fireMenuDragMouseExited", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuDragMouseListener) { -(listeners[i + 1]).menuDragMouseExited (event); -}} -}, "javax.swing.event.MenuDragMouseEvent"); -Clazz_defineMethod (c$, "fireMenuDragMouseDragged", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuDragMouseListener) { -(listeners[i + 1]).menuDragMouseDragged (event); -}} -}, "javax.swing.event.MenuDragMouseEvent"); -Clazz_defineMethod (c$, "fireMenuDragMouseReleased", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuDragMouseListener) { -(listeners[i + 1]).menuDragMouseReleased (event); -}} -}, "javax.swing.event.MenuDragMouseEvent"); -Clazz_defineMethod (c$, "fireMenuKeyPressed", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuKeyListener) { -(listeners[i + 1]).menuKeyPressed (event); -}} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_defineMethod (c$, "fireMenuKeyReleased", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuKeyListener) { -(listeners[i + 1]).menuKeyReleased (event); -}} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_defineMethod (c$, "fireMenuKeyTyped", -function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuKeyListener) { -(listeners[i + 1]).menuKeyTyped (event); -}} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_overrideMethod (c$, "menuSelectionChanged", -function (isIncluded) { -this.setArmed (isIncluded); -}, "~B"); -Clazz_overrideMethod (c$, "getSubElements", -function () { -return new Array (0); -}); -Clazz_defineMethod (c$, "getComponent", -function () { -return this; -}); -Clazz_defineMethod (c$, "addMenuDragMouseListener", -function (l) { -this.listenerList.add (javax.swing.event.MenuDragMouseListener, l); -}, "javax.swing.event.MenuDragMouseListener"); -Clazz_defineMethod (c$, "removeMenuDragMouseListener", -function (l) { -this.listenerList.remove (javax.swing.event.MenuDragMouseListener, l); -}, "javax.swing.event.MenuDragMouseListener"); -Clazz_defineMethod (c$, "getMenuDragMouseListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.MenuDragMouseListener); -}); -Clazz_defineMethod (c$, "addMenuKeyListener", -function (l) { -this.listenerList.add (javax.swing.event.MenuKeyListener, l); -}, "javax.swing.event.MenuKeyListener"); -Clazz_defineMethod (c$, "removeMenuKeyListener", -function (l) { -this.listenerList.remove (javax.swing.event.MenuKeyListener, l); -}, "javax.swing.event.MenuKeyListener"); -Clazz_defineMethod (c$, "getMenuKeyListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.MenuKeyListener); -}); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.JMenuItem, "MenuItemFocusListener", null, java.awt.event.FocusListener); -Clazz_overrideMethod (c$, "focusGained", -function (a) { -}, "java.awt.event.FocusEvent"); -Clazz_overrideMethod (c$, "focusLost", -function (a) { -var b = a.getSource (); -if (b.isFocusPainted ()) { -b.repaint (); -}}, "java.awt.event.FocusEvent"); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"$uiClassID", "MenuItemUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JMenuItem", "$.SwingConstants"], "javax.swing.JCheckBoxMenuItem", ["javax.swing.JToggleButton"], function () { -c$ = Clazz_declareType (javax.swing, "JCheckBoxMenuItem", javax.swing.JMenuItem, javax.swing.SwingConstants); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, false); -}); -Clazz_makeConstructor (c$, -function (icon) { -this.construct (null, icon, false); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text) { -this.construct (text, null, false); -}, "~S"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (text, icon) { -this.construct (text, icon, false); -}, "~S,javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text, b) { -this.construct (text, null, b); -}, "~S,~B"); -Clazz_makeConstructor (c$, -function (text, icon, b) { -Clazz_superConstructor (this, javax.swing.JCheckBoxMenuItem, [text, icon]); -this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ()); -this.setSelected (b); -this.setFocusable (false); -}, "~S,javax.swing.Icon,~B"); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "CheckBoxMenuItemUI"; -}); -Clazz_defineMethod (c$, "getState", -function () { -return this.isSelected (); -}); -Clazz_defineMethod (c$, "setState", -function (b) { -this.setSelected (b); -}, "~B"); -Clazz_overrideMethod (c$, "getSelectedObjects", -function () { -if (this.isSelected () == false) return null; -var selectedObjects = new Array (1); -selectedObjects[0] = this.getText (); -return selectedObjects; -}); -Clazz_overrideMethod (c$, "shouldUpdateSelectedStateFromAction", -function () { -return true; -}); -Clazz_defineStatics (c$, -"$$uiClassID", "CheckBoxMenuItemUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JMenuItem"], "javax.swing.JRadioButtonMenuItem", ["javax.swing.JToggleButton"], function () { -c$ = Clazz_declareType (javax.swing, "JRadioButtonMenuItem", javax.swing.JMenuItem); -Clazz_makeConstructor (c$, -function () { -this.construct (null, null, false); -}); -Clazz_makeConstructor (c$, -function (icon) { -this.construct (null, icon, false); -}, "javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text) { -this.construct (text, null, false); -}, "~S"); -Clazz_makeConstructor (c$, -function (a) { -this.construct (); -this.setAction (a); -}, "javax.swing.Action"); -Clazz_makeConstructor (c$, -function (text, icon) { -this.construct (text, icon, false); -}, "~S,javax.swing.Icon"); -Clazz_makeConstructor (c$, -function (text, selected) { -this.construct (text); -this.setSelected (selected); -}, "~S,~B"); -Clazz_makeConstructor (c$, -function (icon, selected) { -this.construct (null, icon, selected); -}, "javax.swing.Icon,~B"); -Clazz_makeConstructor (c$, -function (text, icon, selected) { -Clazz_superConstructor (this, javax.swing.JRadioButtonMenuItem, [text, icon]); -this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ()); -this.setSelected (selected); -this.setFocusable (false); -}, "~S,javax.swing.Icon,~B"); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "RadioButtonMenuItemUI"; -}); -Clazz_overrideMethod (c$, "shouldUpdateSelectedStateFromAction", -function () { -return true; -}); -Clazz_defineStatics (c$, -"$$uiClassID", "RadioButtonMenuItemUI"); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.MenuDragMouseListener", null, function () { -Clazz_declareInterface (javax.swing.event, "MenuDragMouseListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.awt.event.KeyEvent"], "javax.swing.event.MenuKeyEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.path = null; -this.manager = null; -Clazz_instantialize (this, arguments); -}, javax.swing.event, "MenuKeyEvent", java.awt.event.KeyEvent); -Clazz_makeConstructor (c$, -function (source, id, when, modifiers, keyCode, keyChar, p, m) { -Clazz_superConstructor (this, javax.swing.event.MenuKeyEvent, [source, id, when, modifiers, keyCode, keyChar]); -this.path = p; -this.manager = m; -}, "java.awt.Component,~N,~N,~N,~N,~S,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "getPath", -function () { -return this.path; -}); -Clazz_defineMethod (c$, "getMenuSelectionManager", -function () { -return this.manager; -}); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.MenuKeyListener", null, function () { -Clazz_declareInterface (javax.swing.event, "MenuKeyListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent", "$.JSeparator", "$.MenuElement"], "javax.swing.JPopupMenu", ["java.lang.Boolean", "$.IllegalArgumentException", "java.util.Vector", "java.awt.Dimension", "$.Frame", "$.GraphicsEnvironment", "$.Insets", "$.Point", "javax.swing.DefaultSingleSelectionModel", "$.JMenu", "$.JMenuItem", "$.MenuSelectionManager", "$.PopupFactory", "$.SwingUtilities", "$.UIManager", "javax.swing.event.MenuKeyEvent", "$.MenuKeyListener", "$.PopupMenuEvent", "$.PopupMenuListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.invoker = null; -this.popup = null; -this.frame = null; -this.desiredLocationX = 0; -this.desiredLocationY = 0; -this.label = null; -this.$paintBorder = true; -this.margin = null; -this.lightWeightPopup = true; -this.selectionModel = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JPopupMenu", javax.swing.JComponent, javax.swing.MenuElement); -c$.setDefaultLightWeightPopupEnabled = Clazz_defineMethod (c$, "setDefaultLightWeightPopupEnabled", -function (aFlag) { -javax.swing.SwingUtilities.appContextPut (javax.swing.JPopupMenu.defaultLWPopupEnabledKey, Boolean.$valueOf (aFlag)); -}, "~B"); -c$.getDefaultLightWeightPopupEnabled = Clazz_defineMethod (c$, "getDefaultLightWeightPopupEnabled", -function () { -var b = javax.swing.SwingUtilities.appContextGet (javax.swing.JPopupMenu.defaultLWPopupEnabledKey); -if (b == null) { -javax.swing.SwingUtilities.appContextPut (javax.swing.JPopupMenu.defaultLWPopupEnabledKey, Boolean.TRUE); -return true; -}return b.booleanValue (); -}); -Clazz_makeConstructor (c$, -function () { -this.construct (null); -}); -Clazz_makeConstructor (c$, -function (label) { -Clazz_superConstructor (this, javax.swing.JPopupMenu, []); -this.label = label; -this.lightWeightPopup = javax.swing.JPopupMenu.getDefaultLightWeightPopupEnabled (); -this.setSelectionModel ( new javax.swing.DefaultSingleSelectionModel ()); -this.enableEvents (16); -this.updateUI (); -}, "~S"); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "PopupMenuUI"; -}); -Clazz_defineMethod (c$, "processKeyEvent", -function (evt) { -javax.swing.MenuSelectionManager.defaultManager ().processKeyEvent (evt); -if (evt.isConsumed ()) { -return; -}Clazz_superCall (this, javax.swing.JPopupMenu, "processKeyEvent", [evt]); -}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "getSelectionModel", -function () { -return this.selectionModel; -}); -Clazz_defineMethod (c$, "setSelectionModel", -function (model) { -this.selectionModel = model; -}, "javax.swing.SingleSelectionModel"); -Clazz_defineMethod (c$, "add", -function (menuItem) { -Clazz_superCall (this, javax.swing.JPopupMenu, "add", [menuItem]); -return menuItem; -}, "javax.swing.JMenuItem"); -Clazz_defineMethod (c$, "add", -function (s) { -return this.add ( new javax.swing.JMenuItem (s)); -}, "~S"); -Clazz_defineMethod (c$, "add", -function (a) { -var mi = this.createActionComponent (a); -mi.setAction (a); -this.add (mi); -return mi; -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "adjustPopupLocationToFitScreen", -function (xposition, yposition) { -var p = new java.awt.Point (xposition, yposition); -if (javax.swing.JPopupMenu.popupPostionFixDisabled == true || java.awt.GraphicsEnvironment.isHeadless ()) return p; -return p; -}, "~N,~N"); -Clazz_defineMethod (c$, "createActionComponent", -function (a) { -var mi = ((Clazz_isClassDefined ("javax.swing.JPopupMenu$1") ? 0 : javax.swing.JPopupMenu.$JPopupMenu$1$ ()), Clazz_innerTypeInstance (javax.swing.JPopupMenu$1, this, null)); -mi.setHorizontalTextPosition (11); -mi.setVerticalTextPosition (0); -return mi; -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "createActionChangeListener", -function (b) { -return b.createActionPropertyChangeListener0 (b.getAction ()); -}, "javax.swing.JMenuItem"); -Clazz_defineMethod (c$, "remove", -function (pos) { -if (pos < 0) { -throw new IllegalArgumentException ("index less than zero."); -}if (pos > this.getComponentCount () - 1) { -throw new IllegalArgumentException ("index greater than the number of items."); -}Clazz_superCall (this, javax.swing.JPopupMenu, "remove", [pos]); -}, "~N"); -Clazz_defineMethod (c$, "setLightWeightPopupEnabled", -function (aFlag) { -this.lightWeightPopup = aFlag; -}, "~B"); -Clazz_defineMethod (c$, "isLightWeightPopupEnabled", -function () { -return this.lightWeightPopup; -}); -Clazz_defineMethod (c$, "getLabel", -function () { -return this.label; -}); -Clazz_defineMethod (c$, "setLabel", -function (label) { -var oldValue = this.label; -this.label = label; -this.firePropertyChangeObject ("label", oldValue, label); -this.invalidate (); -this.repaint (); -}, "~S"); -Clazz_defineMethod (c$, "addSeparator", -function () { -this.add ( new javax.swing.JPopupMenu.Separator ()); -}); -Clazz_defineMethod (c$, "insert", -function (a, index) { -var mi = this.createActionComponent (a); -mi.setAction (a); -this.insert (mi, index); -}, "javax.swing.Action,~N"); -Clazz_defineMethod (c$, "insert", -function (component, index) { -if (index < 0) { -throw new IllegalArgumentException ("index less than zero."); -}var nitems = this.getComponentCount (); -var tempItems = new java.util.Vector (); -for (var i = index; i < nitems; i++) { -tempItems.addElement (this.getComponent (index)); -this.remove (index); -} -this.add (component); -for (var i = 0; i < tempItems.size (); i++) { -this.add (tempItems.elementAt (i)); -} -}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "addPopupMenuListener", -function (l) { -this.listenerList.add (javax.swing.event.PopupMenuListener, l); -}, "javax.swing.event.PopupMenuListener"); -Clazz_defineMethod (c$, "removePopupMenuListener", -function (l) { -this.listenerList.remove (javax.swing.event.PopupMenuListener, l); -}, "javax.swing.event.PopupMenuListener"); -Clazz_defineMethod (c$, "getPopupMenuListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.PopupMenuListener); -}); -Clazz_defineMethod (c$, "addMenuKeyListener", -function (l) { -this.listenerList.add (javax.swing.event.MenuKeyListener, l); -}, "javax.swing.event.MenuKeyListener"); -Clazz_defineMethod (c$, "removeMenuKeyListener", -function (l) { -this.listenerList.remove (javax.swing.event.MenuKeyListener, l); -}, "javax.swing.event.MenuKeyListener"); -Clazz_defineMethod (c$, "getMenuKeyListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.MenuKeyListener); -}); -Clazz_defineMethod (c$, "firePopupMenuWillBecomeVisible", -function () { -var listeners = this.listenerList.getListenerList (); -var e = null; -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.PopupMenuListener) { -if (e == null) e = new javax.swing.event.PopupMenuEvent (this); -(listeners[i + 1]).popupMenuWillBecomeVisible (e); -}} -}); -Clazz_defineMethod (c$, "firePopupMenuWillBecomeInvisible", -function () { -var listeners = this.listenerList.getListenerList (); -var e = null; -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.PopupMenuListener) { -if (e == null) e = new javax.swing.event.PopupMenuEvent (this); -(listeners[i + 1]).popupMenuWillBecomeInvisible (e); -}} -}); -Clazz_defineMethod (c$, "firePopupMenuCanceled", -function () { -var listeners = this.listenerList.getListenerList (); -var e = null; -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.PopupMenuListener) { -if (e == null) e = new javax.swing.event.PopupMenuEvent (this); -(listeners[i + 1]).popupMenuCanceled (e); -}} -}); -Clazz_overrideMethod (c$, "alwaysOnTop", -function () { -return true; -}); -Clazz_defineMethod (c$, "pack", -function () { -if (this.popup != null) { -var pref = this.getPreferredSize (); -if (pref == null || pref.width != this.getWidth () || pref.height != this.getHeight ()) { -this.popup = this.getPopup (); -} else { -this.validate (); -}}}); -Clazz_overrideMethod (c$, "setVisible", -function (b) { -if (b == this.isVisible ()) return; -if (b == false) { -var doCanceled = this.getClientProperty ("JPopupMenu.firePopupMenuCanceled"); -if (doCanceled != null && doCanceled === Boolean.TRUE) { -this.putClientProperty ("JPopupMenu.firePopupMenuCanceled", Boolean.FALSE); -this.firePopupMenuCanceled (); -}this.getSelectionModel ().clearSelection (); -} else { -if (this.isPopupMenu ()) { -var me = new Array (1); -me[0] = this; -javax.swing.MenuSelectionManager.defaultManager ().setSelectedPath (me); -}}if (b) { -this.firePopupMenuWillBecomeVisible (); -this.popup = this.getPopup (); -this.firePropertyChangeObject ("visible", Boolean.FALSE, Boolean.TRUE); -} else if (this.popup != null) { -this.firePopupMenuWillBecomeInvisible (); -this.popup.hide (); -this.popup = null; -this.firePropertyChangeObject ("visible", Boolean.TRUE, Boolean.FALSE); -if (this.isPopupMenu ()) { -javax.swing.MenuSelectionManager.defaultManager ().clearSelectedPath (); -}}}, "~B"); -Clazz_defineMethod (c$, "getPopup", - function () { -var oldPopup = this.popup; -if (oldPopup != null) { -oldPopup.hide (); -}var popupFactory = javax.swing.PopupFactory.getSharedInstance (); -if (this.isLightWeightPopupEnabled ()) { -popupFactory.setPopupType (0); -} else { -popupFactory.setPopupType (1); -}var p = this.adjustPopupLocationToFitScreen (this.desiredLocationX, this.desiredLocationY); -this.desiredLocationX = p.x; -this.desiredLocationY = p.y; -var newPopup = this.getUI ().getPopup (this, this.desiredLocationX, this.desiredLocationY); -popupFactory.setPopupType (0); -newPopup.show (); -return newPopup; -}); -Clazz_overrideMethod (c$, "isVisible", -function () { -if (this.popup != null) return true; - else return false; -}); -Clazz_defineMethod (c$, "setLocation", -function (x, y) { -var oldX = this.desiredLocationX; -var oldY = this.desiredLocationY; -this.desiredLocationX = x; -this.desiredLocationY = y; -if (this.popup != null && (x != oldX || y != oldY)) { -this.popup = this.getPopup (); -}}, "~N,~N"); -Clazz_defineMethod (c$, "isPopupMenu", - function () { -return ((this.invoker != null) && !(Clazz_instanceOf (this.invoker, javax.swing.JMenu))); -}); -Clazz_defineMethod (c$, "getInvoker", -function () { -return this.invoker; -}); -Clazz_defineMethod (c$, "setInvoker", -function (invoker) { -var oldInvoker = this.invoker; -this.invoker = invoker; -if ((oldInvoker !== this.invoker) && (this.ui != null)) { -this.ui.uninstallUI (this); -this.ui.installUI (this); -}this.invalidate (); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "show", -function (invoker, x, y) { -this.setInvoker (invoker); -var newFrame = javax.swing.JPopupMenu.getFrame (invoker); -if (newFrame !== this.frame) { -if (newFrame != null) { -this.frame = newFrame; -if (this.popup != null) { -this.setVisible (false); -}}}var invokerOrigin; -if (invoker != null) { -invokerOrigin = invoker.getLocationOnScreen (); -var lx; -var ly; -lx = (invokerOrigin.x) + (x); -ly = (invokerOrigin.y) + (y); -if (lx > 2147483647) lx = 2147483647; -if (lx < -2147483648) lx = -2147483648; -if (ly > 2147483647) ly = 2147483647; -if (ly < -2147483648) ly = -2147483648; -this.setLocation (lx, ly); -} else { -this.setLocation (x, y); -}this.setVisible (true); -}, "java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getRootPopupMenu", -function () { -var mp = this; -while ((mp != null) && (mp.isPopupMenu () != true) && (mp.getInvoker () != null) && (mp.getInvoker ().getParent () != null) && (Clazz_instanceOf (mp.getInvoker ().getParent (), javax.swing.JPopupMenu))) { -mp = mp.getInvoker ().getParent (); -} -return mp; -}); -Clazz_defineMethod (c$, "getComponentAtIndex", -function (i) { -return this.getComponent (i); -}, "~N"); -Clazz_defineMethod (c$, "getComponentIndex", -function (c) { -var ncomponents = this.getComponentCount (); -var component = this.getComponents (); -for (var i = 0; i < ncomponents; i++) { -var comp = component[i]; -if (comp === c) return i; -} -return -1; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "setPopupSize", -function (d) { -var oldSize = this.getPreferredSize (); -this.setPreferredSize (d); -if (this.popup != null) { -var newSize = this.getPreferredSize (); -if (!oldSize.equals (newSize)) { -this.popup = this.getPopup (); -}}}, "java.awt.Dimension"); -Clazz_defineMethod (c$, "setPopupSize", -function (width, height) { -this.setPopupSize ( new java.awt.Dimension (width, height)); -}, "~N,~N"); -Clazz_defineMethod (c$, "setSelected", -function (sel) { -var model = this.getSelectionModel (); -var index = this.getComponentIndex (sel); -model.setSelectedIndex (index); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "isBorderPainted", -function () { -return this.$paintBorder; -}); -Clazz_defineMethod (c$, "setBorderPainted", -function (b) { -this.$paintBorder = b; -this.repaint (); -}, "~B"); -Clazz_defineMethod (c$, "paintBorder", -function (g) { -if (this.isBorderPainted ()) { -Clazz_superCall (this, javax.swing.JPopupMenu, "paintBorder", [g]); -}}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "getMargin", -function () { -if (this.margin == null) { -return new java.awt.Insets (0, 0, 0, 0); -} else { -return this.margin; -}}); -Clazz_defineMethod (c$, "isSubPopupMenu", -function (popup) { -var ncomponents = this.getComponentCount (); -var component = this.getComponents (); -for (var i = 0; i < ncomponents; i++) { -var comp = component[i]; -if (Clazz_instanceOf (comp, javax.swing.JMenu)) { -var menu = comp; -var subPopup = menu.getPopupMenu (); -if (subPopup === popup) return true; -if (subPopup.isSubPopupMenu (popup)) return true; -}} -return false; -}, "javax.swing.JPopupMenu"); -c$.getFrame = Clazz_defineMethod (c$, "getFrame", - function (c) { -var w = c; -while (!(Clazz_instanceOf (w, java.awt.Frame)) && (w != null)) { -w = w.getParent (); -} -return w; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "paramString", -function () { -var labelString = (this.label != null ? this.label : ""); -var paintBorderString = (this.$paintBorder ? "true" : "false"); -var marginString = (this.margin != null ? this.margin.toString () : ""); -var lightWeightPopupEnabledString = (this.isLightWeightPopupEnabled () ? "true" : "false"); -return Clazz_superCall (this, javax.swing.JPopupMenu, "paramString", []) + ",desiredLocationX=" + this.desiredLocationX + ",desiredLocationY=" + this.desiredLocationY + ",label=" + labelString + ",lightWeightPopupEnabled=" + lightWeightPopupEnabledString + ",margin=" + marginString + ",paintBorder=" + paintBorderString; -}); -Clazz_defineMethod (c$, "processMouseEvent", -function (event, path, manager) { -}, "java.awt.event.MouseEvent,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "processKeyEvent", -function (e, path, manager) { -var mke = new javax.swing.event.MenuKeyEvent (e.getComponent (), e.getID (), e.getWhen (), e.getModifiers (), e.getKeyCode (), e.getKeyChar (), path, manager); -this.processMenuKeyEvent (mke); -if (mke.isConsumed ()) { -e.consume (); -}}, "java.awt.event.KeyEvent,~A,javax.swing.MenuSelectionManager"); -Clazz_defineMethod (c$, "processMenuKeyEvent", - function (e) { -switch (e.getID ()) { -case 401: -this.fireMenuKeyPressed (e); -break; -case 402: -this.fireMenuKeyReleased (e); -break; -case 400: -this.fireMenuKeyTyped (e); -break; -default: -break; -} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_defineMethod (c$, "fireMenuKeyPressed", - function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuKeyListener) { -(listeners[i + 1]).menuKeyPressed (event); -}} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_defineMethod (c$, "fireMenuKeyReleased", - function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuKeyListener) { -(listeners[i + 1]).menuKeyReleased (event); -}} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_defineMethod (c$, "fireMenuKeyTyped", - function (event) { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.MenuKeyListener) { -(listeners[i + 1]).menuKeyTyped (event); -}} -}, "javax.swing.event.MenuKeyEvent"); -Clazz_overrideMethod (c$, "menuSelectionChanged", -function (isIncluded) { -if (Clazz_instanceOf (this.invoker, javax.swing.JMenu)) { -var m = this.invoker; -if (isIncluded) m.setPopupMenuVisible (true); - else m.setPopupMenuVisible (false); -}if (this.isPopupMenu () && !isIncluded) this.setVisible (false); -}, "~B"); -Clazz_overrideMethod (c$, "getSubElements", -function () { -var result; -var tmp = new java.util.Vector (); -var c = this.getComponentCount (); -var i; -var m; -for (i = 0; i < c; i++) { -m = this.getComponent (i); -if (Clazz_instanceOf (m, javax.swing.MenuElement)) tmp.addElement (m); -} -result = new Array (tmp.size ()); -for (i = 0, c = tmp.size (); i < c; i++) result[i] = tmp.elementAt (i); - -return result; -}); -Clazz_defineMethod (c$, "getComponent", -function () { -return this; -}); -Clazz_defineMethod (c$, "isPopupTrigger", -function (e) { -return this.getUI ().isPopupTrigger (e); -}, "java.awt.event.MouseEvent"); -c$.$JPopupMenu$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing, "JPopupMenu$1", javax.swing.JMenuItem); -Clazz_defineMethod (c$, "createActionPropertyChangeListener", -function (a) { -var pcl = this.b$["javax.swing.JPopupMenu"].createActionChangeListener (this); -if (pcl == null) { -pcl = Clazz_superCall (this, javax.swing.JPopupMenu$1, "createActionPropertyChangeListener", [a]); -}return pcl; -}, "javax.swing.Action"); -c$ = Clazz_p0p (); -}; -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.JPopupMenu, "Separator", javax.swing.JSeparator); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JPopupMenu.Separator, [0]); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "PopupMenuSeparatorUI"; -}); -c$ = Clazz_p0p (); -Clazz_defineStatics (c$, -"$uiClassID", "PopupMenuUI"); -c$.defaultLWPopupEnabledKey = c$.prototype.defaultLWPopupEnabledKey = new Clazz._O (); -Clazz_defineStatics (c$, -"popupPostionFixDisabled", false); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent", "$.SwingConstants"], "javax.swing.JSeparator", ["java.lang.IllegalArgumentException", "javax.swing.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.orientation = 0; -Clazz_instantialize (this, arguments); -}, javax.swing, "JSeparator", javax.swing.JComponent, javax.swing.SwingConstants); -Clazz_makeConstructor (c$, -function () { -this.construct (0); -}); -Clazz_makeConstructor (c$, -function (orientation) { -Clazz_superConstructor (this, javax.swing.JSeparator, []); -this.checkOrientation (orientation); -this.orientation = orientation; -this.setFocusable (false); -this.updateUI (); -}, "~N"); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "SeparatorUI"; -}); -Clazz_defineMethod (c$, "getOrientation", -function () { -return this.orientation; -}); -Clazz_defineMethod (c$, "setOrientation", -function (orientation) { -if (this.orientation == orientation) { -return; -}var oldValue = this.orientation; -this.checkOrientation (orientation); -this.orientation = orientation; -this.firePropertyChangeInt ("orientation", oldValue, orientation); -this.revalidate (); -this.repaint (); -}, "~N"); -Clazz_defineMethod (c$, "checkOrientation", - function (orientation) { -switch (orientation) { -case 1: -case 0: -break; -default: -throw new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL"); -} -}, "~N"); -Clazz_defineMethod (c$, "paramString", -function () { -var orientationString = (this.orientation == 0 ? "HORIZONTAL" : "VERTICAL"); -return Clazz_superCall (this, javax.swing.JSeparator, "paramString", []) + ",orientation=" + orientationString; -}); -Clazz_defineStatics (c$, -"$uiClassID", "SeparatorUI"); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.util.Vector", "javax.swing.event.EventListenerList"], "javax.swing.MenuSelectionManager", ["java.awt.event.MouseEvent", "javax.swing.JComponent", "$.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "jssun.awt.AppContext"], function () { -c$ = Clazz_decorateAsClass (function () { -this.selection = null; -this.changeEvent = null; -this.listenerList = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "MenuSelectionManager"); -Clazz_prepareFields (c$, function () { -this.selection = new java.util.Vector (); -this.listenerList = new javax.swing.event.EventListenerList (); -}); -c$.defaultManager = Clazz_defineMethod (c$, "defaultManager", -function () { -{ -var context = jssun.awt.AppContext.getAppContext (); -var msm = context.get (javax.swing.MenuSelectionManager.MENU_SELECTION_MANAGER_KEY); -if (msm == null) { -msm = new javax.swing.MenuSelectionManager (); -context.put (javax.swing.MenuSelectionManager.MENU_SELECTION_MANAGER_KEY, msm); -}return msm; -}}); -Clazz_defineMethod (c$, "setSelectedPath", -function (path) { -var i; -var c; -var currentSelectionCount = this.selection.size (); -var firstDifference = 0; -if (path == null) { -path = new Array (0); -}for (i = 0, c = path.length; i < c; i++) { -if (i < currentSelectionCount && this.selection.elementAt (i) === path[i]) firstDifference++; - else break; -} -for (i = currentSelectionCount - 1; i >= firstDifference; i--) { -var me = this.selection.elementAt (i); -this.selection.removeElementAt (i); -me.menuSelectionChanged (false); -} -for (i = firstDifference, c = path.length; i < c; i++) { -if (path[i] != null) { -this.selection.addElement (path[i]); -path[i].menuSelectionChanged (true); -}} -this.fireStateChanged (); -}, "~A"); -Clazz_defineMethod (c$, "getSelectedPath", -function () { -var res = new Array (this.selection.size ()); -var i; -var c; -for (i = 0, c = this.selection.size (); i < c; i++) res[i] = this.selection.elementAt (i); - -return res; -}); -Clazz_defineMethod (c$, "clearSelectedPath", -function () { -if (this.selection.size () > 0) { -this.setSelectedPath (null); -}}); -Clazz_defineMethod (c$, "addChangeListener", -function (l) { -this.listenerList.add (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "removeChangeListener", -function (l) { -this.listenerList.remove (javax.swing.event.ChangeListener, l); -}, "javax.swing.event.ChangeListener"); -Clazz_defineMethod (c$, "getChangeListeners", -function () { -return this.listenerList.getListeners (javax.swing.event.ChangeListener); -}); -Clazz_defineMethod (c$, "fireStateChanged", -function () { -var listeners = this.listenerList.getListenerList (); -for (var i = listeners.length - 2; i >= 0; i -= 2) { -if (listeners[i] === javax.swing.event.ChangeListener) { -if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); -(listeners[i + 1]).stateChanged (this.changeEvent); -}} -}); -Clazz_defineMethod (c$, "processMouseEvent", -function (event) { -var screenX; -var screenY; -var p; -var i; -var j; -var d; -var mc; -var r2; -var cWidth; -var cHeight; -var menuElement; -var subElements; -var path; -var tmp; -var selectionSize; -p = event.getPoint (); -var source = event.getSource (); -if (!source.isShowing ()) { -return; -}var type = event.getID (); -var modifiers = event.getModifiers (); -if ((type == 504 || type == 505) && ((modifiers & (28)) != 0)) { -return; -}javax.swing.SwingUtilities.convertPointToScreen (p, source); -screenX = p.x; -screenY = p.y; -tmp = this.selection.clone (); -selectionSize = tmp.size (); -var success = false; -for (i = selectionSize - 1; i >= 0 && success == false; i--) { -menuElement = tmp.elementAt (i); -subElements = menuElement.getSubElements (); -path = null; -for (j = 0, d = subElements.length; j < d && success == false; j++) { -if (subElements[j] == null) continue; -mc = subElements[j].getComponent (); -if (!mc.isShowing ()) continue; -if (Clazz_instanceOf (mc, javax.swing.JComponent)) { -cWidth = (mc).getWidth (); -cHeight = (mc).getHeight (); -} else { -r2 = mc.getBounds (); -cWidth = r2.width; -cHeight = r2.height; -}p.x = screenX; -p.y = screenY; -javax.swing.SwingUtilities.convertPointFromScreen (p, mc); -if ((p.x >= 0 && p.x < cWidth && p.y >= 0 && p.y < cHeight)) { -var k; -if (path == null) { -path = new Array (i + 2); -for (k = 0; k <= i; k++) path[k] = tmp.elementAt (k); - -}path[i + 1] = subElements[j]; -var currentSelection = this.getSelectedPath (); -if (currentSelection[currentSelection.length - 1] !== path[i + 1] && (currentSelection.length < 2 || currentSelection[currentSelection.length - 2] !== path[i + 1])) { -var oldMC = currentSelection[currentSelection.length - 1].getComponent (); -var exitEvent = new java.awt.event.MouseEvent (oldMC, 505, event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0); -currentSelection[currentSelection.length - 1].processMouseEvent (exitEvent, path, this); -var enterEvent = new java.awt.event.MouseEvent (mc, 504, event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0); -subElements[j].processMouseEvent (enterEvent, path, this); -}var mouseEvent = new java.awt.event.MouseEvent (mc, event.getID (), event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0); -subElements[j].processMouseEvent (mouseEvent, path, this); -success = true; -event.consume (); -}} -} -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "componentForPoint", -function (source, sourcePoint) { -var screenX; -var screenY; -var p = sourcePoint; -var i; -var j; -var d; -var mc; -var r2; -var cWidth; -var cHeight; -var menuElement; -var subElements; -var tmp; -var selectionSize; -javax.swing.SwingUtilities.convertPointToScreen (p, source); -screenX = p.x; -screenY = p.y; -tmp = this.selection.clone (); -selectionSize = tmp.size (); -for (i = selectionSize - 1; i >= 0; i--) { -menuElement = tmp.elementAt (i); -subElements = menuElement.getSubElements (); -for (j = 0, d = subElements.length; j < d; j++) { -if (subElements[j] == null) continue; -mc = subElements[j].getComponent (); -if (!mc.isShowing ()) continue; -if (Clazz_instanceOf (mc, javax.swing.JComponent)) { -cWidth = (mc).getWidth (); -cHeight = (mc).getHeight (); -} else { -r2 = mc.getBounds (); -cWidth = r2.width; -cHeight = r2.height; -}p.x = screenX; -p.y = screenY; -javax.swing.SwingUtilities.convertPointFromScreen (p, mc); -if (p.x >= 0 && p.x < cWidth && p.y >= 0 && p.y < cHeight) { -return mc; -}} -} -return null; -}, "java.awt.Component,java.awt.Point"); -Clazz_defineMethod (c$, "processKeyEvent", -function (e) { -var sel2 = new Array (0); -sel2 = this.selection.toArray (sel2); -var selSize = sel2.length; -var path; -if (selSize < 1) { -return; -}for (var i = selSize - 1; i >= 0; i--) { -var elem = sel2[i]; -var subs = elem.getSubElements (); -path = null; -for (var j = 0; j < subs.length; j++) { -if (subs[j] == null || !subs[j].getComponent ().isShowing () || !subs[j].getComponent ().isEnabled ()) { -continue; -}if (path == null) { -path = new Array (i + 2); -System.arraycopy (sel2, 0, path, 0, i + 1); -}path[i + 1] = subs[j]; -subs[j].processKeyEvent (e, path, this); -if (e.isConsumed ()) { -return; -}} -} -path = new Array (1); -path[0] = sel2[0]; -path[0].processKeyEvent (e, path, this); -if (e.isConsumed ()) { -return; -}}, "java.awt.event.KeyEvent"); -Clazz_defineMethod (c$, "isComponentPartOfCurrentMenu", -function (c) { -if (this.selection.size () > 0) { -var me = this.selection.elementAt (0); -return this.isComponentPartOfCurrentMenu (me, c); -} else return false; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "isComponentPartOfCurrentMenu", - function (root, c) { -var children; -var i; -var d; -if (root == null) return false; -if (root.getComponent () === c) return true; - else { -children = root.getSubElements (); -for (i = 0, d = children.length; i < d; i++) { -if (this.isComponentPartOfCurrentMenu (children[i], c)) return true; -} -}return false; -}, "javax.swing.MenuElement,java.awt.Component"); -c$.MENU_SELECTION_MANAGER_KEY = c$.prototype.MENU_SELECTION_MANAGER_KEY = new Clazz._O (); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Panel", "javax.swing.Popup", "$.SwingHeavyWeight", "java.awt.BorderLayout"], "javax.swing.PopupFactory", ["java.lang.Boolean", "$.IllegalArgumentException", "java.util.ArrayList", "$.HashMap", "java.applet.Applet", "java.awt.Container", "$.Insets", "$.Rectangle", "$.Toolkit", "$.Window", "java.awt.event.WindowAdapter", "javax.swing.ClientPropertyKey", "$.JApplet", "$.JComponent", "$.JDialog", "$.JFrame", "$.JLayeredPane", "$.JPanel", "$.JPopupMenu", "$.JRootPane", "$.JSeparator", "$.JToolTip", "$.JWindow", "$.MenuElement", "javax.swing.Popup.DefaultFrame", "$.HeavyWeightWindow", "javax.swing.RootPaneContainer", "$.SwingUtilities"], function () { -c$ = Clazz_decorateAsClass (function () { -this.popupType = 0; -Clazz_instantialize (this, arguments); -}, javax.swing, "PopupFactory"); -c$.setSharedInstance = Clazz_defineMethod (c$, "setSharedInstance", -function (factory) { -if (factory == null) { -throw new IllegalArgumentException ("PopupFactory can not be null"); -}javax.swing.SwingUtilities.appContextPut (javax.swing.PopupFactory.SharedInstanceKey, factory); -}, "javax.swing.PopupFactory"); -c$.getSharedInstance = Clazz_defineMethod (c$, "getSharedInstance", -function () { -var factory = javax.swing.SwingUtilities.appContextGet (javax.swing.PopupFactory.SharedInstanceKey); -if (factory == null) { -factory = new javax.swing.PopupFactory (); -javax.swing.PopupFactory.setSharedInstance (factory); -}return factory; -}); -Clazz_defineMethod (c$, "setPopupType", -function (type) { -this.popupType = type; -}, "~N"); -Clazz_defineMethod (c$, "getPopupType", -function () { -return this.popupType; -}); -Clazz_defineMethod (c$, "getPopup", -function (owner, contents, x, y) { -if (contents == null) { -throw new IllegalArgumentException ("Popup.getPopup must be passed non-null contents"); -}var popupType = this.getPopupType (owner, contents, x, y); -var popup = this.getPopup (owner, contents, x, y, popupType); -if (popup == null) { -popup = this.getPopup (owner, contents, x, y, 2); -}return popup; -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getPopupType", - function (owner, contents, ownerX, ownerY) { -var popupType = this.getPopupType (); -if (owner == null || this.invokerInHeavyWeightPopup (owner)) { -popupType = 2; -} else if (popupType == 0 && !(Clazz_instanceOf (contents, javax.swing.JToolTip)) && !(Clazz_instanceOf (contents, javax.swing.JPopupMenu))) { -popupType = 1; -}var c = owner; -while (c != null) { -if (Clazz_instanceOf (c, javax.swing.JComponent)) { -if ((c).getClientProperty (javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP) === Boolean.TRUE) { -popupType = 2; -break; -}}c = c.getParent (); -} -return popupType; -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getPopup", - function (owner, contents, ownerX, ownerY, popupType) { -switch (popupType) { -case 0: -return this.getLightWeightPopup (owner, contents, ownerX, ownerY); -case 1: -return this.getMediumWeightPopup (owner, contents, ownerX, ownerY); -case 2: -return this.getHeavyWeightPopup (owner, contents, ownerX, ownerY); -} -return null; -}, "java.awt.Component,java.awt.Component,~N,~N,~N"); -Clazz_defineMethod (c$, "getLightWeightPopup", - function (owner, contents, ownerX, ownerY) { -return javax.swing.PopupFactory.LightWeightPopup.getLightWeightPopup (owner, contents, ownerX, ownerY); -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getMediumWeightPopup", - function (owner, contents, ownerX, ownerY) { -return javax.swing.PopupFactory.MediumWeightPopup.getMediumWeightPopup (owner, contents, ownerX, ownerY); -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getHeavyWeightPopup", - function (owner, contents, ownerX, ownerY) { -return javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopup (owner, contents, ownerX, ownerY); -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "invokerInHeavyWeightPopup", - function (i) { -if (i != null) { -var parent; -for (parent = i.getParent (); parent != null; parent = parent.getParent ()) { -if (Clazz_instanceOf (parent, javax.swing.Popup.HeavyWeightWindow)) { -return true; -}} -}return false; -}, "java.awt.Component"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.PopupFactory, "HeavyWeightPopup", javax.swing.Popup); -c$.getHeavyWeightPopup = Clazz_defineMethod (c$, "getHeavyWeightPopup", -function (a, b, c, d) { -var e = (a != null) ? javax.swing.SwingUtilities.getWindowAncestor (a) : null; -var f = null; -if (e != null) { -f = javax.swing.PopupFactory.HeavyWeightPopup.getRecycledHeavyWeightPopup (e); -}var g = false; -if (b != null && b.isFocusable ()) { -if (Clazz_instanceOf (b, javax.swing.JPopupMenu)) { -var h = b; -var i = h.getComponents (); -for (var j = 0; j < i.length; j++) { -if (!(Clazz_instanceOf (i[j], javax.swing.MenuElement)) && !(Clazz_instanceOf (i[j], javax.swing.JSeparator))) { -g = true; -break; -}} -}}if (f == null || (f.getComponent ()).getFocusableWindowState () != g) { -if (f != null) { -f._dispose (); -}f = new javax.swing.PopupFactory.HeavyWeightPopup (); -}f.reset (a, b, c, d); -if (g) { -var h = f.getComponent (); -h.setFocusableWindowState (true); -h.setName ("###focusableSwingPopup###"); -}return f; -}, "java.awt.Component,java.awt.Component,~N,~N"); -c$.getRecycledHeavyWeightPopup = Clazz_defineMethod (c$, "getRecycledHeavyWeightPopup", - function (a) { -{ -var b; -var c = javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopupCache (); -if (c.containsKey (a)) { -b = c.get (a); -} else { -return null; -}var d; -if ((d = b.size ()) > 0) { -var e = b.get (0); -b.remove (0); -return e; -}return null; -}}, "java.awt.Window"); -c$.getHeavyWeightPopupCache = Clazz_defineMethod (c$, "getHeavyWeightPopupCache", - function () { -{ -var a = javax.swing.SwingUtilities.appContextGet (javax.swing.PopupFactory.HeavyWeightPopup.heavyWeightPopupCacheKey); -if (a == null) { -a = new java.util.HashMap (2); -javax.swing.SwingUtilities.appContextPut (javax.swing.PopupFactory.HeavyWeightPopup.heavyWeightPopupCacheKey, a); -}return a; -}}); -c$.recycleHeavyWeightPopup = Clazz_defineMethod (c$, "recycleHeavyWeightPopup", - function (a) { -{ -var b; -var c = javax.swing.SwingUtilities.getWindowAncestor (a.getComponent ()); -var d = javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopupCache (); -if (Clazz_instanceOf (c, javax.swing.Popup.DefaultFrame) || !(c).isVisible ()) { -a._dispose (); -return; -} else if (d.containsKey (c)) { -b = d.get (c); -} else { -b = new java.util.ArrayList (); -d.put (c, b); -var e = c; -e.addWindowListener (((Clazz_isClassDefined ("javax.swing.PopupFactory$HeavyWeightPopup$1") ? 0 : javax.swing.PopupFactory.HeavyWeightPopup.$PopupFactory$HeavyWeightPopup$1$ ()), Clazz_innerTypeInstance (javax.swing.PopupFactory$HeavyWeightPopup$1, this, Clazz_cloneFinals ("e", e)))); -}if (b.size () < 5) { -b.add (a); -} else { -a._dispose (); -}}}, "javax.swing.PopupFactory.HeavyWeightPopup"); -Clazz_defineMethod (c$, "hide", -function () { -Clazz_superCall (this, javax.swing.PopupFactory.HeavyWeightPopup, "hide", []); -javax.swing.PopupFactory.HeavyWeightPopup.recycleHeavyWeightPopup (this); -}); -Clazz_defineMethod (c$, "dispose", -function () { -}); -Clazz_defineMethod (c$, "_dispose", -function () { -Clazz_superCall (this, javax.swing.PopupFactory.HeavyWeightPopup, "dispose", []); -}); -c$.$PopupFactory$HeavyWeightPopup$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (javax.swing, "PopupFactory$HeavyWeightPopup$1", java.awt.event.WindowAdapter); -Clazz_overrideMethod (c$, "windowClosed", -function (a) { -var b; -{ -var c = javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopupCache (); -b = c.remove (this.f$.e); -}if (b != null) { -for (var c = b.size () - 1; c >= 0; c--) { -(b.get (c))._dispose (); -} -}}, "java.awt.event.WindowEvent"); -c$ = Clazz_p0p (); -}; -c$.heavyWeightPopupCacheKey = c$.prototype.heavyWeightPopupCacheKey = new Clazz._O (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.owner = null; -this.x = 0; -this.y = 0; -Clazz_instantialize (this, arguments); -}, javax.swing.PopupFactory, "ContainerPopup", javax.swing.Popup); -Clazz_overrideMethod (c$, "hide", -function () { -var a = this.getComponent (); -if (a != null) { -var b = a.getParent (); -if (b != null) { -var c = a.getBounds (); -b.remove (a); -b.repaint (c.x, c.y, c.width, c.height); -}}this.owner = null; -}); -Clazz_overrideMethod (c$, "pack", -function () { -var a = this.getComponent (); -if (a != null) { -a.setSize (a.getPreferredSize ()); -}}); -Clazz_defineMethod (c$, "reset", -function (a, b, c, d) { -if ((Clazz_instanceOf (a, javax.swing.JFrame)) || (Clazz_instanceOf (a, javax.swing.JDialog)) || (Clazz_instanceOf (a, javax.swing.JWindow))) { -a = (a).getLayeredPane (); -}Clazz_superCall (this, javax.swing.PopupFactory.ContainerPopup, "reset", [a, b, c, d]); -this.x = c; -this.y = d; -this.owner = a; -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "overlappedByOwnedWindow", -function () { -var a = this.getComponent (); -if (this.owner != null && a != null) { -var b = javax.swing.SwingUtilities.getWindowAncestor (this.owner); -if (b == null) { -return false; -}var c = b.getOwnedWindows (); -if (c != null) { -var d = a.getBounds (); -for (var e = 0; e < c.length; e++) { -var f = c[e]; -if (f.isVisible () && d.intersects (f.getBounds ())) { -return true; -}} -}}return false; -}); -Clazz_defineMethod (c$, "fitsOnScreen", -function () { -var a = this.getComponent (); -if (this.owner != null && a != null) { -var b; -var c = a.getWidth (); -var d = a.getHeight (); -for (b = this.owner.getParent (); b != null; b = b.getParent ()) { -if (Clazz_instanceOf (b, javax.swing.JFrame) || Clazz_instanceOf (b, javax.swing.JDialog) || Clazz_instanceOf (b, javax.swing.JWindow)) { -var e = b.getBounds (); -var f = b.getInsets (); -e.x += f.left; -e.y += f.top; -e.width -= (f.left + f.right); -e.height -= (f.top + f.bottom); -var g = b.getGraphicsConfiguration (); -var h = this.getContainerPopupArea (g); -return e.intersection (h).contains (this.x, this.y, c, d); -} else if (Clazz_instanceOf (b, javax.swing.JApplet)) { -var e = b.getBounds (); -var f = b.getLocationOnScreen (); -e.x = f.x; -e.y = f.y; -return e.contains (this.x, this.y, c, d); -} else if (Clazz_instanceOf (b, java.awt.Window) || Clazz_instanceOf (b, java.applet.Applet)) { -break; -}} -}return false; -}); -Clazz_defineMethod (c$, "getContainerPopupArea", -function (a) { -var b; -var c = java.awt.Toolkit.getDefaultToolkit (); -var d; -if (a != null) { -b = a.getBounds (); -d = c.getScreenInsets (a); -} else { -b = new java.awt.Rectangle (c.getScreenSize ()); -d = new java.awt.Insets (0, 0, 0, 0); -}b.x += d.left; -b.y += d.top; -b.width -= (d.left + d.right); -b.height -= (d.top + d.bottom); -return b; -}, "java.awt.GraphicsConfiguration"); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.PopupFactory, "LightWeightPopup", javax.swing.PopupFactory.ContainerPopup); -c$.getLightWeightPopup = Clazz_defineMethod (c$, "getLightWeightPopup", -function (a, b, c, d) { -var e = null; -if (e == null) { -e = new javax.swing.PopupFactory.LightWeightPopup (); -}e.reset (a, b, c, d); -if (!e.fitsOnScreen () || e.overlappedByOwnedWindow ()) { -e.hide (); -return null; -}return e; -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "hide", -function () { -Clazz_superCall (this, javax.swing.PopupFactory.LightWeightPopup, "hide", []); -var a = this.getComponent (); -a.removeAll (); -}); -Clazz_overrideMethod (c$, "show", -function () { -var a = null; -if (this.owner != null) { -a = (Clazz_instanceOf (this.owner, java.awt.Container) ? this.owner : this.owner.getParent ()); -}for (var b = a; b != null; b = b.getParent ()) { -if (Clazz_instanceOf (b, javax.swing.JRootPane)) { -a = (b).getLayeredPane (); -} else if (Clazz_instanceOf (b, java.awt.Window)) { -if (a == null) { -a = b; -}break; -} else if (Clazz_instanceOf (b, javax.swing.JApplet)) { -break; -}} -var c = javax.swing.SwingUtilities.convertScreenLocationToParent (a, this.x, this.y); -var d = this.getComponent (); -d.setLocation (c.x, c.y); -if (Clazz_instanceOf (a, javax.swing.JLayeredPane)) { -(a).add (d, javax.swing.JLayeredPane.POPUP_LAYER, 0); -} else { -a.add (d); -}}); -Clazz_overrideMethod (c$, "createComponent", -function (a) { -var b = new javax.swing.JPanel ( new java.awt.BorderLayout (), true); -b.setOpaque (true); -return b; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "reset", -function (a, b, c, d) { -Clazz_superCall (this, javax.swing.PopupFactory.LightWeightPopup, "reset", [a, b, c, d]); -var e = this.getComponent (); -e.setOpaque (b.isOpaque ()); -e.setLocation (c, d); -e.add (b, "Center"); -b.invalidate (); -this.pack (); -}, "java.awt.Component,java.awt.Component,~N,~N"); -c$.lightWeightPopupCacheKey = c$.prototype.lightWeightPopupCacheKey = new Clazz._O (); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_decorateAsClass (function () { -this.rootPane = null; -Clazz_instantialize (this, arguments); -}, javax.swing.PopupFactory, "MediumWeightPopup", javax.swing.PopupFactory.ContainerPopup); -c$.getMediumWeightPopup = Clazz_defineMethod (c$, "getMediumWeightPopup", -function (a, b, c, d) { -var e = javax.swing.PopupFactory.MediumWeightPopup.getRecycledMediumWeightPopup (); -if (e == null) { -e = new javax.swing.PopupFactory.MediumWeightPopup (); -}e.reset (a, b, c, d); -if (!e.fitsOnScreen () || e.overlappedByOwnedWindow ()) { -e.hide (); -return null; -}return e; -}, "java.awt.Component,java.awt.Component,~N,~N"); -c$.getMediumWeightPopupCache = Clazz_defineMethod (c$, "getMediumWeightPopupCache", - function () { -var a = javax.swing.SwingUtilities.appContextGet (javax.swing.PopupFactory.MediumWeightPopup.mediumWeightPopupCacheKey); -if (a == null) { -a = new java.util.ArrayList (); -javax.swing.SwingUtilities.appContextPut (javax.swing.PopupFactory.MediumWeightPopup.mediumWeightPopupCacheKey, a); -}return a; -}); -c$.recycleMediumWeightPopup = Clazz_defineMethod (c$, "recycleMediumWeightPopup", - function (a) { -{ -var b = javax.swing.PopupFactory.MediumWeightPopup.getMediumWeightPopupCache (); -if (b.size () < 5) { -b.add (a); -}}}, "javax.swing.PopupFactory.MediumWeightPopup"); -c$.getRecycledMediumWeightPopup = Clazz_defineMethod (c$, "getRecycledMediumWeightPopup", - function () { -{ -var a = javax.swing.PopupFactory.MediumWeightPopup.getMediumWeightPopupCache (); -var b; -if ((b = a.size ()) > 0) { -var c = a.get (0); -a.remove (0); -return c; -}return null; -}}); -Clazz_defineMethod (c$, "hide", -function () { -Clazz_superCall (this, javax.swing.PopupFactory.MediumWeightPopup, "hide", []); -this.rootPane.getContentPane ().removeAll (); -javax.swing.PopupFactory.MediumWeightPopup.recycleMediumWeightPopup (this); -}); -Clazz_overrideMethod (c$, "show", -function () { -var a = this.getComponent (); -var b = null; -if (this.owner != null) { -b = this.owner.getParent (); -}while (!(Clazz_instanceOf (b, java.awt.Window) || Clazz_instanceOf (b, java.applet.Applet)) && (b != null)) { -b = b.getParent (); -} -if (Clazz_instanceOf (b, javax.swing.RootPaneContainer)) { -b = (b).getLayeredPane (); -var c = javax.swing.SwingUtilities.convertScreenLocationToParent (b, this.x, this.y); -a.setVisible (false); -a.setLocation (c.x, c.y); -(b).add (a, javax.swing.JLayeredPane.POPUP_LAYER, 0); -} else { -var c = javax.swing.SwingUtilities.convertScreenLocationToParent (b, this.x, this.y); -a.setLocation (c.x, c.y); -a.setVisible (false); -b.add (a); -}a.setVisible (true); -}); -Clazz_overrideMethod (c$, "createComponent", -function (a) { -var b = new javax.swing.PopupFactory.MediumWeightPopup.MediumWeightComponent (); -this.rootPane = new javax.swing.JRootPane (); -this.rootPane.setOpaque (true); -b.add (this.rootPane, "Center"); -return b; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "reset", -function (a, b, c, d) { -Clazz_superCall (this, javax.swing.PopupFactory.MediumWeightPopup, "reset", [a, b, c, d]); -var e = this.getComponent (); -e.setLocation (c, d); -this.rootPane.getContentPane ().add (b, "Center"); -b.invalidate (); -e.validate (); -this.pack (); -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.PopupFactory.MediumWeightPopup, "MediumWeightComponent", java.awt.Panel, javax.swing.SwingHeavyWeight); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.PopupFactory.MediumWeightPopup.MediumWeightComponent, [ new java.awt.BorderLayout ()]); -}); -c$ = Clazz_p0p (); -c$.mediumWeightPopupCacheKey = c$.prototype.mediumWeightPopupCacheKey = new Clazz._O (); -c$ = Clazz_p0p (); -c$.SharedInstanceKey = c$.prototype.SharedInstanceKey = new Clazz._O (); -Clazz_defineStatics (c$, -"MAX_CACHE_SIZE", 5, -"LIGHT_WEIGHT_POPUP", 0, -"MEDIUM_WEIGHT_POPUP", 1, -"HEAVY_WEIGHT_POPUP", 2); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["java.awt.Frame", "javax.swing.JWindow"], "javax.swing.Popup", ["java.lang.IllegalArgumentException", "java.awt.Toolkit", "$.Window", "javax.swing.SwingUtilities", "jssun.awt.SunToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.component = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "Popup"); -Clazz_makeConstructor (c$, -function (owner, contents, x, y) { -this.construct (); -if (contents == null) { -throw new IllegalArgumentException ("Contents must be non-null"); -}this.reset (owner, contents, x, y); -}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "show", -function () { -var component = this.getComponent (); -if (component != null) { -component.show (); -}}); -Clazz_defineMethod (c$, "hide", -function () { -var component = this.getComponent (); -if (Clazz_instanceOf (component, javax.swing.JWindow)) { -component.hide (); -(component).getContentPane ().removeAll (); -}this.dispose (); -}); -Clazz_defineMethod (c$, "dispose", -function () { -var component = this.getComponent (); -var window = javax.swing.SwingUtilities.getWindowAncestor (component); -if (Clazz_instanceOf (component, javax.swing.JWindow)) { -(component).dispose (); -component = null; -}if (Clazz_instanceOf (window, javax.swing.Popup.DefaultFrame)) { -window.dispose (); -}}); -Clazz_defineMethod (c$, "reset", -function (owner, contents, ownerX, ownerY) { -if (this.getComponent () == null) { -this.component = this.createComponent (owner); -}var c = this.getComponent (); -if (Clazz_instanceOf (c, javax.swing.JWindow)) { -var component = this.getComponent (); -component.setLocation (ownerX, ownerY); -component.getContentPane ().add (contents, "Center"); -contents.invalidate (); -if (component.isVisible ()) { -this.pack (); -}}}, "java.awt.Component,java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "pack", -function () { -var component = this.getComponent (); -if (Clazz_instanceOf (component, java.awt.Window)) { -(component).pack (); -}}); -Clazz_defineMethod (c$, "getParentWindow", - function (owner) { -var window = null; -if (Clazz_instanceOf (owner, java.awt.Window)) { -window = owner; -} else if (owner != null) { -window = javax.swing.SwingUtilities.getWindowAncestor (owner); -}if (window == null) { -window = new javax.swing.Popup.DefaultFrame (); -}return window; -}, "java.awt.Component"); -Clazz_defineMethod (c$, "createComponent", -function (owner) { -return new javax.swing.Popup.HeavyWeightWindow (this.getParentWindow (owner)); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getComponent", -function () { -return this.component; -}); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.Popup, "HeavyWeightWindow", javax.swing.JWindow); -Clazz_makeConstructor (c$, -function (a) { -Clazz_superConstructor (this, javax.swing.Popup.HeavyWeightWindow, [a]); -this.setFocusableWindowState (false); -var b = java.awt.Toolkit.getDefaultToolkit (); -if (Clazz_instanceOf (b, jssun.awt.SunToolkit)) { -(b).setOverrideRedirect (this); -}this.getRootPane ().setUseTrueDoubleBuffering (false); -try { -this.setAlwaysOnTop (true); -} catch (se) { -if (Clazz_exceptionOf (se, SecurityException)) { -} else { -throw se; -} -} -}, "java.awt.Window"); -Clazz_overrideMethod (c$, "update", -function (a) { -this.paint (a); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "show", -function () { -this.pack (); -if (this.getWidth () > 0 && this.getHeight () > 0) { -Clazz_superCall (this, javax.swing.Popup.HeavyWeightWindow, "show", []); -}}); -c$ = Clazz_p0p (); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (javax.swing.Popup, "DefaultFrame", java.awt.Frame); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("javax.swing"); -Clazz_declareInterface (javax.swing, "SwingHeavyWeight"); -Clazz_declarePackage ("javax.swing"); -Clazz_load (["javax.swing.JComponent"], "javax.swing.JToolTip", ["javax.swing.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this.tipText = null; -this.$component = null; -Clazz_instantialize (this, arguments); -}, javax.swing, "JToolTip", javax.swing.JComponent); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.JToolTip, []); -this.setOpaque (true); -this.updateUI (); -}); -Clazz_overrideMethod (c$, "getUI", -function () { -return this.ui; -}); -Clazz_overrideMethod (c$, "updateUI", -function () { -this.setUI (javax.swing.UIManager.getUI (this)); -}); -Clazz_overrideMethod (c$, "getUIClassID", -function () { -return "ToolTipUI"; -}); -Clazz_defineMethod (c$, "setTipText", -function (tipText) { -var oldValue = this.tipText; -this.tipText = tipText; -this.firePropertyChangeObject ("tiptext", oldValue, tipText); -}, "~S"); -Clazz_defineMethod (c$, "getTipText", -function () { -return this.tipText; -}); -Clazz_defineMethod (c$, "setComponent", -function (c) { -var oldValue = this.$component; -this.$component = c; -this.firePropertyChangeObject ("component", oldValue, c); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "getComponent", -function () { -return this.$component; -}); -Clazz_overrideMethod (c$, "alwaysOnTop", -function () { -return true; -}); -Clazz_defineMethod (c$, "paramString", -function () { -var tipTextString = (this.tipText != null ? this.tipText : ""); -return Clazz_superCall (this, javax.swing.JToolTip, "paramString", []) + ",tipText=" + tipTextString; -}); -Clazz_defineStatics (c$, -"$uiClassID", "ToolTipUI"); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventObject"], "javax.swing.event.PopupMenuEvent", null, function () { -c$ = Clazz_declareType (javax.swing.event, "PopupMenuEvent", java.util.EventObject); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.PopupMenuListener", null, function () { -Clazz_declareInterface (javax.swing.event, "PopupMenuListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventObject"], "javax.swing.event.MenuEvent", null, function () { -c$ = Clazz_declareType (javax.swing.event, "MenuEvent", java.util.EventObject); -}); -Clazz_declarePackage ("javax.swing.event"); -Clazz_load (["java.util.EventListener"], "javax.swing.event.MenuListener", null, function () { -Clazz_declareInterface (javax.swing.event, "MenuListener", java.util.EventListener); -}); -Clazz_declarePackage ("javax.swing.border"); -Clazz_load (["javax.swing.border.Border"], "javax.swing.border.AbstractBorder", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Component", "$.Insets", "$.Rectangle"], function () { -c$ = Clazz_declareType (javax.swing.border, "AbstractBorder", null, javax.swing.border.Border); -Clazz_overrideMethod (c$, "paintBorder", -function (c, g, x, y, width, height) { -}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getBorderInsets", -function (c) { -return new java.awt.Insets (0, 0, 0, 0); -}, "java.awt.Component"); -Clazz_defineMethod (c$, "getBorderInsets", -function (c, insets) { -insets.left = insets.top = insets.right = insets.bottom = 0; -return insets; -}, "java.awt.Component,java.awt.Insets"); -Clazz_overrideMethod (c$, "isBorderOpaque", -function () { -return false; -}); -Clazz_defineMethod (c$, "getInteriorRectangle", -function (c, x, y, width, height) { -return javax.swing.border.AbstractBorder.getInteriorRectangle (c, this, x, y, width, height); -}, "java.awt.Component,~N,~N,~N,~N"); -c$.getInteriorRectangle = Clazz_defineMethod (c$, "getInteriorRectangle", -function (c, b, x, y, width, height) { -var insets; -if (b != null) insets = b.getBorderInsets (c); - else insets = new java.awt.Insets (0, 0, 0, 0); -return new java.awt.Rectangle (x + insets.left, y + insets.top, width - insets.right - insets.left, height - insets.top - insets.bottom); -}, "java.awt.Component,javax.swing.border.Border,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getBaseline", -function (c, width, height) { -if (width < 0 || height < 0) { -throw new IllegalArgumentException ("Width and height must be >= 0"); -}return -1; -}, "java.awt.Component,~N,~N"); -Clazz_defineMethod (c$, "getBaselineResizeBehavior", -function (c) { -if (c == null) { -throw new NullPointerException ("Component must be non-null"); -}return java.awt.Component.BaselineResizeBehavior.OTHER; -}, "java.awt.Component"); -c$.isLeftToRight = Clazz_defineMethod (c$, "isLeftToRight", -function (c) { -return c.getComponentOrientation ().isLeftToRight (); -}, "java.awt.Component"); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_load (["java.awt.event.InvocationEvent"], "jssun.awt.PeerEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.flags = 0; -Clazz_instantialize (this, arguments); -}, jssun.awt, "PeerEvent", java.awt.event.InvocationEvent); -Clazz_makeConstructor (c$, -function (source, runnable, flags) { -this.construct (source, runnable, null, false, flags); -}, "~O,Runnable,~N"); -Clazz_makeConstructor (c$, -function (source, runnable, notifier, catchExceptions, flags) { -Clazz_superConstructor (this, jssun.awt.PeerEvent, [source, runnable, notifier, catchExceptions]); -this.flags = flags; -}, "~O,Runnable,~O,~B,~N"); -Clazz_defineMethod (c$, "getFlags", -function () { -return this.flags; -}); -Clazz_defineMethod (c$, "coalesceEvents", -function (newEvent) { -return null; -}, "jssun.awt.PeerEvent"); -Clazz_defineStatics (c$, -"PRIORITY_EVENT", 0x01, -"ULTIMATE_PRIORITY_EVENT", 0x02, -"LOW_PRIORITY_EVENT", 0x04); -}); -Clazz_declarePackage ("jssun.awt.image"); -Clazz_load (["jssun.awt.image.InputStreamImageSource"], "jssun.awt.image.URLImageSource", ["java.net.URL"], function () { -c$ = Clazz_decorateAsClass (function () { -this.url = null; -this.conn = null; -this.actualHost = null; -this.actualPort = 0; -Clazz_instantialize (this, arguments); -}, jssun.awt.image, "URLImageSource", jssun.awt.image.InputStreamImageSource); -Clazz_makeConstructor (c$, -function (u) { -Clazz_superConstructor (this, jssun.awt.image.URLImageSource, []); -this.url = u; -}, "java.net.URL"); -Clazz_makeConstructor (c$, -function (href) { -this.construct ( new java.net.URL (null, href)); -}, "~S"); -Clazz_makeConstructor (c$, -function (u, uc) { -this.construct (u); -this.conn = uc; -}, "java.net.URL,java.net.URLConnection"); -Clazz_makeConstructor (c$, -function (uc) { -this.construct (uc.getURL (), uc); -}, "java.net.URLConnection"); -Clazz_overrideMethod (c$, "checkSecurity", -function (context, quiet) { -if (this.actualHost != null) { -try { -var security = System.getSecurityManager (); -if (security != null) { -security.checkConnect (this.actualHost, this.actualPort, context); -}} catch (e) { -if (Clazz_exceptionOf (e, SecurityException)) { -if (!quiet) { -throw e; -}return false; -} else { -throw e; -} -} -}return true; -}, "~O,~B"); -Clazz_defineMethod (c$, "getDecoder", -function () { -return null; -}); -}); -Clazz_declarePackage ("jssun.awt.image"); -Clazz_load (["java.awt.image.ImageProducer", "jssun.awt.image.ImageFetchable"], "jssun.awt.image.InputStreamImageSource", ["java.lang.SecurityException", "$.Thread", "jssun.awt.image.ImageConsumerQueue", "$.ImageFetcher"], function () { -c$ = Clazz_decorateAsClass (function () { -this.consumers = null; -this.decoder = null; -this.decoders = null; -this.awaitingFetch = false; -Clazz_instantialize (this, arguments); -}, jssun.awt.image, "InputStreamImageSource", null, [java.awt.image.ImageProducer, jssun.awt.image.ImageFetchable]); -Clazz_defineMethod (c$, "countConsumers", -function (cq) { -var i = 0; -while (cq != null) { -i++; -cq = cq.next; -} -return i; -}, "jssun.awt.image.ImageConsumerQueue"); -Clazz_defineMethod (c$, "countConsumers", -function () { -var id = this.decoders; -var i = this.countConsumers (this.consumers); -while (id != null) { -i += this.countConsumers (id.queue); -id = id.next; -} -return i; -}); -Clazz_defineMethod (c$, "addConsumer", -function (ic) { -this.addConsumer (ic, false); -}, "java.awt.image.ImageConsumer"); -Clazz_defineMethod (c$, "printQueue", -function (cq, prefix) { -while (cq != null) { -System.out.println (prefix + cq); -cq = cq.next; -} -}, "jssun.awt.image.ImageConsumerQueue,~S"); -Clazz_defineMethod (c$, "printQueues", -function (title) { -System.out.println (title + "[ -----------"); -this.printQueue (this.consumers, " "); -for (var id = this.decoders; id != null; id = id.next) { -System.out.println (" " + id); -this.printQueue (id.queue, " "); -} -System.out.println ("----------- ]" + title); -}, "~S"); -Clazz_defineMethod (c$, "addConsumer", -function (ic, produce) { -for (var id = this.decoders; id != null; id = id.next) { -if (id.isConsumer (ic)) { -return; -}} -var cq = this.consumers; -while (cq != null && cq.consumer !== ic) { -cq = cq.next; -} -if (cq == null) { -cq = new jssun.awt.image.ImageConsumerQueue (this, ic); -cq.next = this.consumers; -this.consumers = cq; -} else { -if (!cq.secure) { -var context = null; -var security = System.getSecurityManager (); -if (security != null) { -context = security.getSecurityContext (); -}if (cq.securityContext == null) { -cq.securityContext = context; -} else if (!cq.securityContext.equals (context)) { -this.errorConsumer (cq, false); -throw new SecurityException ("Applets are trading image data!"); -}}cq.interested = true; -}if (produce && this.decoder == null) { -this.startProduction (); -}}, "java.awt.image.ImageConsumer,~B"); -Clazz_overrideMethod (c$, "isConsumer", -function (ic) { -for (var id = this.decoders; id != null; id = id.next) { -if (id.isConsumer (ic)) { -return true; -}} -return jssun.awt.image.ImageConsumerQueue.isConsumer (this.consumers, ic); -}, "java.awt.image.ImageConsumer"); -Clazz_defineMethod (c$, "errorAllConsumers", - function (cq, needReload) { -while (cq != null) { -if (cq.interested) { -this.errorConsumer (cq, needReload); -}cq = cq.next; -} -}, "jssun.awt.image.ImageConsumerQueue,~B"); -Clazz_defineMethod (c$, "errorConsumer", - function (cq, needReload) { -cq.consumer.imageComplete (1); -this.removeConsumer (cq.consumer); -}, "jssun.awt.image.ImageConsumerQueue,~B"); -Clazz_overrideMethod (c$, "removeConsumer", -function (ic) { -for (var id = this.decoders; id != null; id = id.next) { -id.removeConsumer (ic); -} -this.consumers = jssun.awt.image.ImageConsumerQueue.removeConsumer (this.consumers, ic, false); -}, "java.awt.image.ImageConsumer"); -Clazz_defineMethod (c$, "startProduction", -function (ic) { -this.addConsumer (ic, true); -}, "java.awt.image.ImageConsumer"); -Clazz_defineMethod (c$, "startProduction", - function () { -if (!this.awaitingFetch) { -jssun.awt.image.ImageFetcher.add (this); -this.awaitingFetch = true; -}}); -Clazz_overrideMethod (c$, "requestTopDownLeftRightResend", -function (ic) { -}, "java.awt.image.ImageConsumer"); -Clazz_defineMethod (c$, "decoderForType", -function (is, content_type) { -return null; -}, "java.io.InputStream,~S"); -Clazz_defineMethod (c$, "getDecoder", -function (is) { -return null; -}, "java.io.InputStream"); -Clazz_overrideMethod (c$, "doFetch", -function () { -{ -if (this.consumers == null) { -this.awaitingFetch = false; -return; -}}var imgd = this.getDecoder (); -if (imgd == null) { -this.badDecoder (); -} else { -this.setDecoder (imgd); -try { -imgd.produceImage (); -} catch (e$$) { -if (Clazz_exceptionOf (e$$, java.io.IOException)) { -var e = e$$; -{ -e.printStackTrace (); -} -} else if (Clazz_exceptionOf (e$$, jssun.awt.image.ImageFormatException)) { -var e = e$$; -{ -e.printStackTrace (); -} -} else { -throw e$$; -} -} finally { -this.removeDecoder (imgd); -if (Thread.currentThread ().isInterrupted () || !Thread.currentThread ().isAlive ()) { -this.errorAllConsumers (imgd.queue, true); -} else { -this.errorAllConsumers (imgd.queue, false); -}} -}}); -Clazz_defineMethod (c$, "badDecoder", - function () { -var cq; -{ -cq = this.consumers; -this.consumers = null; -this.awaitingFetch = false; -}this.errorAllConsumers (cq, false); -}); -Clazz_defineMethod (c$, "setDecoder", - function (mydecoder) { -var cq; -{ -mydecoder.next = this.decoders; -this.decoders = mydecoder; -this.decoder = mydecoder; -cq = this.consumers; -mydecoder.queue = cq; -this.consumers = null; -this.awaitingFetch = false; -}}, "jssun.awt.image.ImageDecoder"); -Clazz_defineMethod (c$, "removeDecoder", - function (mydecoder) { -this.doneDecoding (mydecoder); -var idprev = null; -for (var id = this.decoders; id != null; id = id.next) { -if (id === mydecoder) { -if (idprev == null) { -this.decoders = id.next; -} else { -idprev.next = id.next; -}break; -}idprev = id; -} -}, "jssun.awt.image.ImageDecoder"); -Clazz_defineMethod (c$, "doneDecoding", -function (mydecoder) { -if (this.decoder === mydecoder) { -this.decoder = null; -if (this.consumers != null) { -this.startProduction (); -}}}, "jssun.awt.image.ImageDecoder"); -Clazz_defineMethod (c$, "latchConsumers", -function (id) { -this.doneDecoding (id); -}, "jssun.awt.image.ImageDecoder"); -Clazz_defineMethod (c$, "flush", -function () { -this.decoder = null; -}); -}); -Clazz_declarePackage ("java.awt.image"); -Clazz_declareInterface (java.awt.image, "ImageProducer"); -Clazz_declarePackage ("jssun.awt.image"); -Clazz_declareInterface (jssun.awt.image, "ImageFetchable"); -Clazz_declarePackage ("jssun.awt.image"); -c$ = Clazz_decorateAsClass (function () { -this.next = null; -this.consumer = null; -this.interested = false; -this.securityContext = null; -this.secure = false; -Clazz_instantialize (this, arguments); -}, jssun.awt.image, "ImageConsumerQueue"); -c$.removeConsumer = Clazz_defineMethod (c$, "removeConsumer", -function (cqbase, ic, stillinterested) { -var cqprev = null; -for (var cq = cqbase; cq != null; cq = cq.next) { -if (cq.consumer === ic) { -if (cqprev == null) { -cqbase = cq.next; -} else { -cqprev.next = cq.next; -}cq.interested = stillinterested; -break; -}cqprev = cq; -} -return cqbase; -}, "jssun.awt.image.ImageConsumerQueue,java.awt.image.ImageConsumer,~B"); -c$.isConsumer = Clazz_defineMethod (c$, "isConsumer", -function (cqbase, ic) { -for (var cq = cqbase; cq != null; cq = cq.next) { -if (cq.consumer === ic) { -return true; -}} -return false; -}, "jssun.awt.image.ImageConsumerQueue,java.awt.image.ImageConsumer"); -Clazz_makeConstructor (c$, -function (src, ic) { -this.consumer = ic; -this.interested = true; -this.secure = true; -}, "jssun.awt.image.InputStreamImageSource,java.awt.image.ImageConsumer"); -Clazz_overrideMethod (c$, "toString", -function () { -return ("[" + this.consumer + ", " + (this.interested ? "" : "not ") + "interested" + (this.securityContext != null ? ", " + this.securityContext : "") + "]"); -}); -Clazz_declarePackage ("jssun.awt.image"); -Clazz_load (["java.lang.Thread", "$.StringBuffer"], ["jssun.awt.image.FetcherInfo", "$.ImageFetcher"], ["java.util.Vector", "jssun.awt.AppContext"], function () { -c$ = Clazz_declareType (jssun.awt.image, "ImageFetcher", Thread); -Clazz_makeConstructor (c$, - function (threadGroup, index) { -Clazz_superConstructor (this, jssun.awt.image.ImageFetcher, [threadGroup, "Image Fetcher " + index]); -this.setDaemon (true); -}, "ThreadGroup,~N"); -c$.add = Clazz_defineMethod (c$, "add", -function (src) { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -{ -if (!info.waitList.contains (src)) { -info.waitList.addElement (src); -if (info.numWaiting == 0 && info.numFetchers < info.fetchers.length) { -jssun.awt.image.ImageFetcher.createFetchers (info); -}info.waitList.notify (); -}}}, "jssun.awt.image.ImageFetchable"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (src) { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -{ -if (info.waitList.contains (src)) { -info.waitList.removeElement (src); -}}}, "jssun.awt.image.ImageFetchable"); -c$.isFetcher = Clazz_defineMethod (c$, "isFetcher", -function (t) { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -{ -for (var i = 0; i < info.fetchers.length; i++) { -if (info.fetchers[i] === t) { -return true; -}} -}return false; -}, "Thread"); -c$.amFetcher = Clazz_defineMethod (c$, "amFetcher", -function () { -return jssun.awt.image.ImageFetcher.isFetcher (Thread.currentThread ()); -}); -c$.nextImage = Clazz_defineMethod (c$, "nextImage", - function () { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -{ -var src = null; -var end = System.currentTimeMillis () + 5000; -while (src == null) { -while (info.waitList.size () == 0) { -var now = System.currentTimeMillis (); -if (now >= end) { -return null; -}try { -info.numWaiting++; -info.waitList.wait (end - now); -} catch (e) { -if (Clazz_exceptionOf (e, InterruptedException)) { -return null; -} else { -throw e; -} -} finally { -info.numWaiting--; -} -} -src = info.waitList.elementAt (0); -info.waitList.removeElement (src); -} -return src; -}}); -Clazz_overrideMethod (c$, "run", -function () { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -try { -this.fetchloop (); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -e.printStackTrace (); -} else { -throw e; -} -} finally { -{ -var me = Thread.currentThread (); -for (var i = 0; i < info.fetchers.length; i++) { -if (info.fetchers[i] === me) { -info.fetchers[i] = null; -info.numFetchers--; -}} -}} -}); -Clazz_defineMethod (c$, "fetchloop", - function () { -var me = Thread.currentThread (); -while (jssun.awt.image.ImageFetcher.isFetcher (me)) { -Thread.interrupted (); -me.setPriority (8); -var src = jssun.awt.image.ImageFetcher.nextImage (); -if (src == null) { -return; -}try { -src.doFetch (); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -System.err.println ("Uncaught error fetching image:"); -e.printStackTrace (); -} else { -throw e; -} -} -jssun.awt.image.ImageFetcher.stoppingAnimation (me); -} -}); -c$.startingAnimation = Clazz_defineMethod (c$, "startingAnimation", -function () { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -var me = Thread.currentThread (); -{ -for (var i = 0; i < info.fetchers.length; i++) { -if (info.fetchers[i] === me) { -info.fetchers[i] = null; -info.numFetchers--; -me.setName ("Image Animator " + i); -if (info.waitList.size () > info.numWaiting) { -jssun.awt.image.ImageFetcher.createFetchers (info); -}return; -}} -}me.setPriority (2); -me.setName ("Image Animator"); -}); -c$.stoppingAnimation = Clazz_defineMethod (c$, "stoppingAnimation", - function (me) { -var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); -{ -var index = -1; -for (var i = 0; i < info.fetchers.length; i++) { -if (info.fetchers[i] === me) { -return; -}if (info.fetchers[i] == null) { -index = i; -}} -if (index >= 0) { -info.fetchers[index] = me; -info.numFetchers++; -me.setName ("Image Fetcher " + index); -return; -}}}, "Thread"); -c$.createFetchers = Clazz_defineMethod (c$, "createFetchers", - function (info) { -var appContext = jssun.awt.AppContext.getAppContext (); -var threadGroup = appContext.getThreadGroup (); -var fetcherThreadGroup; -try { -if (threadGroup.getParent () != null) { -fetcherThreadGroup = threadGroup; -} else { -threadGroup = Thread.currentThread ().getThreadGroup (); -var parent = threadGroup.getParent (); -while ((parent != null) && (parent.getParent () != null)) { -threadGroup = parent; -parent = threadGroup.getParent (); -} -fetcherThreadGroup = threadGroup; -}} catch (e) { -if (Clazz_exceptionOf (e, SecurityException)) { -fetcherThreadGroup = appContext.getThreadGroup (); -} else { -throw e; -} -} -var fetcherGroup = fetcherThreadGroup; -for (var i = 0; i < info.fetchers.length; i++) { -if (info.fetchers[i] == null) { -info.fetchers[i] = new jssun.awt.image.ImageFetcher (fetcherGroup, i); -info.fetchers[i].start (); -info.numFetchers++; -break; -}} -return; -}, "jssun.awt.image.FetcherInfo"); -Clazz_defineStatics (c$, -"HIGH_PRIORITY", 8, -"LOW_PRIORITY", 3, -"ANIM_PRIORITY", 2, -"TIMEOUT", 5000); -c$ = Clazz_decorateAsClass (function () { -this.fetchers = null; -this.numFetchers = 0; -this.numWaiting = 0; -this.waitList = null; -Clazz_instantialize (this, arguments); -}, jssun.awt.image, "FetcherInfo"); -Clazz_makeConstructor (c$, - function () { -this.fetchers = new Array (4); -this.numFetchers = 0; -this.numWaiting = 0; -this.waitList = new java.util.Vector (); -}); -c$.getFetcherInfo = Clazz_defineMethod (c$, "getFetcherInfo", -function () { -var appContext = jssun.awt.AppContext.getAppContext (); -{ -var info = appContext.get (jssun.awt.image.FetcherInfo.FETCHER_INFO_KEY); -if (info == null) { -info = new jssun.awt.image.FetcherInfo (); -appContext.put (jssun.awt.image.FetcherInfo.FETCHER_INFO_KEY, info); -}return info; -}}); -Clazz_defineStatics (c$, -"MAX_NUM_FETCHERS_PER_APPCONTEXT", 4); -c$.FETCHER_INFO_KEY = c$.prototype.FETCHER_INFO_KEY = new StringBuffer ("FetcherInfo"); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.FocusEvent", ["jssun.awt.AppContext", "$.SunToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.temporary = false; -this.opposite = null; -Clazz_instantialize (this, arguments); -}, java.awt.event, "FocusEvent", java.awt.event.ComponentEvent); -Clazz_makeConstructor (c$, -function (source, id, temporary, opposite) { -Clazz_superConstructor (this, java.awt.event.FocusEvent, [source, id]); -this.temporary = temporary; -this.opposite = opposite; -}, "java.awt.Component,~N,~B,java.awt.Component"); -Clazz_makeConstructor (c$, -function (source, id, temporary) { -this.construct (source, id, temporary, null); -}, "java.awt.Component,~N,~B"); -Clazz_makeConstructor (c$, -function (source, id) { -this.construct (source, id, false); -}, "java.awt.Component,~N"); -Clazz_defineMethod (c$, "isTemporary", -function () { -return this.temporary; -}); -Clazz_defineMethod (c$, "getOppositeComponent", -function () { -if (this.opposite == null) { -return null; -}return (jssun.awt.SunToolkit.targetToAppContext (this.opposite) === jssun.awt.AppContext.getAppContext ()) ? this.opposite : null; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 1004: -typeStr = "FOCUS_GAINED"; -break; -case 1005: -typeStr = "FOCUS_LOST"; -break; -default: -typeStr = "unknown type"; -} -return typeStr + (this.temporary ? ",temporary" : ",permanent") + ",opposite=" + this.getOppositeComponent (); -}); -Clazz_defineStatics (c$, -"FOCUS_FIRST", 1004, -"FOCUS_LAST", 1005, -"FOCUS_GAINED", 1004, -"FOCUS_LOST", 1005); -}); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.AWTEvent"], "java.awt.event.HierarchyEvent", ["java.awt.Component"], function () { -c$ = Clazz_decorateAsClass (function () { -this.changed = null; -this.changedParent = null; -this.changeFlags = 0; -Clazz_instantialize (this, arguments); -}, java.awt.event, "HierarchyEvent", java.awt.AWTEvent); -Clazz_makeConstructor (c$, -function (source, id, changed, changedParent) { -Clazz_superConstructor (this, java.awt.event.HierarchyEvent, [source, id]); -this.changed = changed; -this.changedParent = changedParent; -}, "java.awt.Component,~N,java.awt.Component,java.awt.Container"); -Clazz_makeConstructor (c$, -function (source, id, changed, changedParent, changeFlags) { -Clazz_superConstructor (this, java.awt.event.HierarchyEvent, [source, id]); -this.changed = changed; -this.changedParent = changedParent; -this.changeFlags = changeFlags; -}, "java.awt.Component,~N,java.awt.Component,java.awt.Container,~N"); -Clazz_defineMethod (c$, "getComponent", -function () { -return (Clazz_instanceOf (this.source, java.awt.Component)) ? this.source : null; -}); -Clazz_defineMethod (c$, "getChanged", -function () { -return this.changed; -}); -Clazz_defineMethod (c$, "getChangedParent", -function () { -return this.changedParent; -}); -Clazz_defineMethod (c$, "getChangeFlags", -function () { -return this.changeFlags; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 1401: -typeStr = "ANCESTOR_MOVED (" + this.changed + "," + this.changedParent + ")"; -break; -case 1402: -typeStr = "ANCESTOR_RESIZED (" + this.changed + "," + this.changedParent + ")"; -break; -case 1400: -{ -typeStr = "HIERARCHY_CHANGED ("; -var first = true; -if ((this.changeFlags & 1) != 0) { -first = false; -typeStr += "PARENT_CHANGED"; -}if ((this.changeFlags & 2) != 0) { -if (first) { -first = false; -} else { -typeStr += ","; -}typeStr += "DISPLAYABILITY_CHANGED"; -}if ((this.changeFlags & 4) != 0) { -if (first) { -first = false; -} else { -typeStr += ","; -}typeStr += "SHOWING_CHANGED"; -}if (!first) { -typeStr += ","; -}typeStr += this.changed + "," + this.changedParent + ")"; -break; -}default: -typeStr = "unknown type"; -} -return typeStr; -}); -Clazz_defineStatics (c$, -"HIERARCHY_FIRST", 1400, -"HIERARCHY_CHANGED", 1400, -"ANCESTOR_MOVED", 1401, -"ANCESTOR_RESIZED", 1402, -"HIERARCHY_LAST", 1402, -"PARENT_CHANGED", 0x1, -"DISPLAYABILITY_CHANGED", 0x2, -"SHOWING_CHANGED", 0x4); -}); -Clazz_declarePackage ("jssun.awt"); -Clazz_declareInterface (jssun.awt, "ConstrainableGraphics"); -Clazz_declarePackage ("jssun.awt"); -Clazz_declareInterface (jssun.awt, "Graphics2Delegate"); -Clazz_declarePackage ("java.awt.event"); -Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.ContainerEvent", ["java.awt.Container"], function () { -c$ = Clazz_decorateAsClass (function () { -this.child = null; -Clazz_instantialize (this, arguments); -}, java.awt.event, "ContainerEvent", java.awt.event.ComponentEvent); -Clazz_makeConstructor (c$, -function (source, id, child) { -Clazz_superConstructor (this, java.awt.event.ContainerEvent, [source, id]); -this.child = child; -}, "java.awt.Component,~N,java.awt.Component"); -Clazz_defineMethod (c$, "getContainer", -function () { -return (Clazz_instanceOf (this.source, java.awt.Container)) ? this.source : null; -}); -Clazz_defineMethod (c$, "getChild", -function () { -return this.child; -}); -Clazz_overrideMethod (c$, "paramString", -function () { -var typeStr; -switch (this.id) { -case 300: -typeStr = "COMPONENT_ADDED"; -break; -case 301: -typeStr = "COMPONENT_REMOVED"; -break; -default: -typeStr = "unknown type"; -} -return typeStr + ",child=" + this.child.getName (); -}); -Clazz_defineStatics (c$, -"CONTAINER_FIRST", 300, -"CONTAINER_LAST", 301, -"COMPONENT_ADDED", 300, -"COMPONENT_REMOVED", 301); -}); -Clazz_declarePackage ("jssun.applet"); -Clazz_load (["java.util.EventObject"], "jssun.applet.AppletEvent", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.arg = null; -this.id = 0; -Clazz_instantialize (this, arguments); -}, jssun.applet, "AppletEvent", java.util.EventObject); -Clazz_makeConstructor (c$, -function (source, id, argument) { -Clazz_superConstructor (this, jssun.applet.AppletEvent, [source]); -this.arg = argument; -this.id = id; -}, "~O,~N,~O"); -Clazz_defineMethod (c$, "getID", -function () { -return this.id; -}); -Clazz_defineMethod (c$, "getArgument", -function () { -return this.arg; -}); -Clazz_overrideMethod (c$, "toString", -function () { -var str = this.getClass ().getName () + "[source=" + this.source + " + id=" + this.id; -if (this.arg != null) { -str += " + arg=" + this.arg; -}str += " ]"; -return str; -}); -}); -Clazz_declarePackage ("jssun.applet"); -Clazz_load (["jssun.applet.AppletListener"], "jssun.applet.AppletEventMulticaster", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.a = null; -this.b = null; -Clazz_instantialize (this, arguments); -}, jssun.applet, "AppletEventMulticaster", null, jssun.applet.AppletListener); -Clazz_makeConstructor (c$, -function (a, b) { -this.a = a; -this.b = b; -}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); -Clazz_defineMethod (c$, "appletStateChanged", -function (e) { -this.a.appletStateChanged (e); -this.b.appletStateChanged (e); -}, "jssun.applet.AppletEvent"); -c$.add = Clazz_defineMethod (c$, "add", -function (a, b) { -return jssun.applet.AppletEventMulticaster.addInternal (a, b); -}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (l, oldl) { -return jssun.applet.AppletEventMulticaster.removeInternal (l, oldl); -}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); -c$.addInternal = Clazz_defineMethod (c$, "addInternal", - function (a, b) { -if (a == null) return b; -if (b == null) return a; -return new jssun.applet.AppletEventMulticaster (a, b); -}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); -Clazz_defineMethod (c$, "remove", -function (oldl) { -if (oldl === this.a) return this.b; -if (oldl === this.b) return this.a; -var a2 = jssun.applet.AppletEventMulticaster.removeInternal (this.a, oldl); -var b2 = jssun.applet.AppletEventMulticaster.removeInternal (this.b, oldl); -if (a2 === this.a && b2 === this.b) { -return this; -}return jssun.applet.AppletEventMulticaster.addInternal (a2, b2); -}, "jssun.applet.AppletListener"); -c$.removeInternal = Clazz_defineMethod (c$, "removeInternal", - function (l, oldl) { -if (l === oldl || l == null) { -return null; -} else if (Clazz_instanceOf (l, jssun.applet.AppletEventMulticaster)) { -return (l).remove (oldl); -} else { -return l; -}}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); -}); -Clazz_declarePackage ("jssun.applet"); -Clazz_load (["java.util.EventListener"], "jssun.applet.AppletListener", null, function () { -Clazz_declareInterface (jssun.applet, "AppletListener", java.util.EventListener); -}); -Clazz_declarePackage ("jssun.misc"); -Clazz_load (["java.util.Enumeration"], ["jssun.misc.Queue", "$.LIFOQueueEnumerator", "$.FIFOQueueEnumerator", "$.QueueElement"], ["java.util.NoSuchElementException", "swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.length = 0; -this.head = null; -this.tail = null; -Clazz_instantialize (this, arguments); -}, jssun.misc, "Queue"); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "enqueue", -function (obj) { -var newElt = new jssun.misc.QueueElement (obj); -if (this.head == null) { -this.head = newElt; -this.tail = newElt; -this.length = 1; -} else { -newElt.next = this.head; -this.head.prev = newElt; -this.head = newElt; -this.length++; -}this.notify (); -}, "~O"); -Clazz_defineMethod (c$, "dequeue", -function () { -return this.dequeue (0); -}); -Clazz_defineMethod (c$, "dequeue", -function (timeOut) { -while (this.tail == null) { -swingjs.JSToolkit.warn ("Cannot wait in Queue.java"); -this.wait (timeOut); -} -var elt = this.tail; -this.tail = elt.prev; -if (this.tail == null) { -this.head = null; -} else { -this.tail.next = null; -}this.length--; -return elt.obj; -}, "~N"); -Clazz_defineMethod (c$, "isEmpty", -function () { -return (this.tail == null); -}); -Clazz_defineMethod (c$, "elements", -function () { -return new jssun.misc.LIFOQueueEnumerator (this); -}); -Clazz_defineMethod (c$, "reverseElements", -function () { -return new jssun.misc.FIFOQueueEnumerator (this); -}); -Clazz_defineMethod (c$, "dump", -function (msg) { -System.err.println (">> " + msg); -System.err.println ("[" + this.length + " elt(s); head = " + (this.head == null ? "null" : (this.head.obj) + "") + " tail = " + (this.tail == null ? "null" : (this.tail.obj) + "")); -var cursor = this.head; -var last = null; -while (cursor != null) { -System.err.println (" " + cursor); -last = cursor; -cursor = cursor.next; -} -if (last !== this.tail) { -System.err.println (" tail != last: " + this.tail + ", " + last); -}System.err.println ("]"); -}, "~S"); -c$ = Clazz_decorateAsClass (function () { -this.queue = null; -this.cursor = null; -Clazz_instantialize (this, arguments); -}, jssun.misc, "FIFOQueueEnumerator", null, java.util.Enumeration); -Clazz_makeConstructor (c$, -function (q) { -this.queue = q; -this.cursor = q.tail; -}, "jssun.misc.Queue"); -Clazz_overrideMethod (c$, "hasMoreElements", -function () { -return (this.cursor != null); -}); -Clazz_overrideMethod (c$, "nextElement", -function () { -{ -if (this.cursor != null) { -var result = this.cursor; -this.cursor = this.cursor.prev; -return result.obj; -}}throw new java.util.NoSuchElementException ("FIFOQueueEnumerator"); -}); -c$ = Clazz_decorateAsClass (function () { -this.queue = null; -this.cursor = null; -Clazz_instantialize (this, arguments); -}, jssun.misc, "LIFOQueueEnumerator", null, java.util.Enumeration); -Clazz_makeConstructor (c$, -function (q) { -this.queue = q; -this.cursor = q.head; -}, "jssun.misc.Queue"); -Clazz_overrideMethod (c$, "hasMoreElements", -function () { -return (this.cursor != null); -}); -Clazz_overrideMethod (c$, "nextElement", -function () { -{ -if (this.cursor != null) { -var result = this.cursor; -this.cursor = this.cursor.next; -return result.obj; -}}throw new java.util.NoSuchElementException ("LIFOQueueEnumerator"); -}); -c$ = Clazz_decorateAsClass (function () { -this.next = null; -this.prev = null; -this.obj = null; -Clazz_instantialize (this, arguments); -}, jssun.misc, "QueueElement"); -Clazz_makeConstructor (c$, -function (obj) { -this.obj = obj; -}, "~O"); -Clazz_overrideMethod (c$, "toString", -function () { -return "QueueElement[obj=" + this.obj + (this.prev == null ? " null" : " prev") + (this.next == null ? " null" : " next") + "]"; -}); -}); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_declareInterface (javax.swing.plaf, "UIResource"); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_load (["javax.swing.InputMap", "javax.swing.plaf.UIResource"], "javax.swing.plaf.InputMapUIResource", null, function () { -c$ = Clazz_declareType (javax.swing.plaf, "InputMapUIResource", javax.swing.InputMap, javax.swing.plaf.UIResource); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.plaf.InputMapUIResource, []); -}); -}); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_load (["javax.swing.ActionMap", "javax.swing.plaf.UIResource"], "javax.swing.plaf.ActionMapUIResource", null, function () { -c$ = Clazz_declareType (javax.swing.plaf, "ActionMapUIResource", javax.swing.ActionMap, javax.swing.plaf.UIResource); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, javax.swing.plaf.ActionMapUIResource, []); -}); -}); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_load (["java.awt.peer.LightweightPeer"], "javax.swing.plaf.ComponentUI", ["java.lang.Error", "java.awt.Component"], function () { -c$ = Clazz_declareType (javax.swing.plaf, "ComponentUI", null, java.awt.peer.LightweightPeer); -Clazz_makeConstructor (c$, -function () { -}); -Clazz_defineMethod (c$, "installUI", -function (c) { -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "uninstallUI", -function (c) { -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "paint", -function (g, c) { -}, "java.awt.Graphics,javax.swing.JComponent"); -Clazz_defineMethod (c$, "update", -function (g, c) { -}, "java.awt.Graphics,javax.swing.JComponent"); -Clazz_defineMethod (c$, "getPreferredSize", -function (c) { -return null; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "getMinimumSize", -function (c) { -return this.getPreferredSize (c); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "getMaximumSize", -function (c) { -return null; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "contains", -function (c, x, y) { -return c.inside (x, y); -}, "javax.swing.JComponent,~N,~N"); -c$.createUI = Clazz_defineMethod (c$, "createUI", -function (c) { -throw new Error ("ComponentUI.createUI not implemented."); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "getBaseline", -function (c, width, height) { -return -1; -}, "javax.swing.JComponent,~N,~N"); -Clazz_defineMethod (c$, "getBaselineResizeBehavior", -function (c) { -return java.awt.Component.BaselineResizeBehavior.OTHER; -}, "javax.swing.JComponent"); -}); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_load (["java.awt.Font", "javax.swing.plaf.UIResource"], "javax.swing.plaf.FontUIResource", null, function () { -c$ = Clazz_declareType (javax.swing.plaf, "FontUIResource", java.awt.Font, javax.swing.plaf.UIResource); -}); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_load (["java.awt.Color", "javax.swing.plaf.UIResource"], "javax.swing.plaf.ColorUIResource", null, function () { -c$ = Clazz_declareType (javax.swing.plaf, "ColorUIResource", java.awt.Color, javax.swing.plaf.UIResource); -}); -Clazz_declarePackage ("javax.swing.plaf"); -Clazz_load (["javax.swing.ComponentInputMap", "javax.swing.plaf.UIResource"], "javax.swing.plaf.ComponentInputMapUIResource", null, function () { -c$ = Clazz_declareType (javax.swing.plaf, "ComponentInputMapUIResource", javax.swing.ComponentInputMap, javax.swing.plaf.UIResource); -}); -Clazz_declarePackage ("swingjs.api"); -Clazz_declareInterface (swingjs.api, "JSFunction"); -Clazz_declarePackage ("swingjs.api"); -Clazz_declareInterface (swingjs.api, "JSInterface"); -Clazz_declarePackage ("swingjs.api"); -c$ = Clazz_declareType (swingjs.api, "Interface"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function (name, isQuiet) { -try { -{ -Clazz._isQuiet = isQuiet; -}System.out.println ("swingjs.api.Interface creating instance of " + name); -var x = Clazz._4Name (name); -{ -Clazz._isQuiet = false; -}return (x == null ? null : x.newInstance ()); -} catch (e) { -if (Clazz_exceptionOf (e, Exception)) { -System.out.println ("Interface.java Error creating instance for " + name + ": \n" + e); -return null; -} else { -throw e; -} -} -}, "~S,~B"); -Clazz_declarePackage ("swingjs.api"); -c$ = Clazz_declareType (swingjs.api, "DOMNode"); -c$.createElement = Clazz_defineMethod (c$, "createElement", -function (key, id) { -var obj = null; -{ -obj = document.createElement(key); -obj.id = id; -}return obj; -}, "~S,~S"); -c$.getParent = Clazz_defineMethod (c$, "getParent", -function (obj) { -{ -return obj.parentNode; -}}, "swingjs.api.DOMNode"); -c$.remove = Clazz_defineMethod (c$, "remove", -function (obj) { -{ -try { -var p = obj.parentNode; -p.removeNode(obj); -} catch(e) {}; -return p; -}}, "swingjs.api.DOMNode"); -c$.add = Clazz_defineMethod (c$, "add", -function (parent, child) { -{ -parent && parent.appendChild(child); -}}, "swingjs.api.DOMNode,swingjs.api.DOMNode"); -c$.getAttr = Clazz_defineMethod (c$, "getAttr", -function (obj, attr) { -{ -if (obj)return obj[attr]; -}}, "swingjs.api.DOMNode,~S"); -Clazz_defineMethod (c$, "getStyle", -function (style) { -{ -if (obj)return obj.style[style]; -}}, "~S"); -c$.setAttr = Clazz_defineMethod (c$, "setAttr", -function (obj, attr, val) { -{ -obj[attr] = (val == "TRUE" ? true : val); -}return obj; -}, "swingjs.api.DOMNode,~S,~O"); -c$.setStyles = Clazz_defineMethod (c$, "setStyles", -function (obj, attr) { -{ -for (var i = 0; i < attr.length;) { -//System.out.println(["DOMNode.setStyles ",attr[i],attr[i+1]]) -; -obj.style[attr[i++]] = attr[i++]; } -}return obj; -}, "swingjs.api.DOMNode,~A"); -c$.setSize = Clazz_defineMethod (c$, "setSize", -function (obj, width, height) { -return swingjs.api.DOMNode.setStyles (obj, ["width", width + "px", "height", height + "px"]); -}, "swingjs.api.DOMNode,~N,~N"); -Clazz_declarePackage ("swingjs"); -c$ = Clazz_declareType (swingjs, "JSUtil"); -c$.split = Clazz_defineMethod (c$, "split", -function (text, run) { -if (text.length == 0) return new Array (0); -var n = 1; -var i = text.indexOf (run); -var lines; -var runLen = run.length; -if (i < 0 || runLen == 0) { -lines = new Array (1); -lines[0] = text; -return lines; -}var len = text.length - runLen; -for (; i >= 0 && i < len; n++) i = text.indexOf (run, i + runLen); - -lines = new Array (n); -i = 0; -var ipt = 0; -var pt = 0; -for (; (ipt = text.indexOf (run, i)) >= 0 && pt + 1 < n; ) { -lines[pt++] = text.substring (i, ipt); -i = ipt + runLen; -} -if (text.indexOf (run, len) != len) len += runLen; -lines[pt] = text.substring (i, len); -return lines; -}, "~S,~S"); -Clazz_declarePackage ("swingjs"); -Clazz_load (["jssun.awt.SunToolkit"], "swingjs.JSToolkit", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "$.InputStream", "java.lang.Boolean", "$.Thread", "java.util.Hashtable", "JU.AU", "$.Rdr", "$.SB", "java.awt.Dimension", "java.awt.image.ColorModel", "javax.swing.UIManager", "jssun.awt.AppContext", "swingjs.JSComponentPeer", "swingjs.api.Interface"], function () { -c$ = Clazz_decorateAsClass (function () { -this.imageKit = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSToolkit", jssun.awt.SunToolkit); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, swingjs.JSToolkit); -System.out.println ("JSToolkit initialized"); -}); -c$.warn = Clazz_defineMethod (c$, "warn", -function (msg) { -swingjs.JSToolkit.alert (msg); -}, "~S"); -c$.alert = Clazz_defineMethod (c$, "alert", -function (object) { -{ -console.log("[JSToolkit] " + object); -alert("[JSToolkit] " + object); -}}, "~O"); -c$.log = Clazz_defineMethod (c$, "log", -function (msg) { -{ -System.out.println(msg); -console.log(msg); -}}, "~S"); -c$.confirm = Clazz_defineMethod (c$, "confirm", -function (msg) { -{ -return confirm(msg); -}}, "~S"); -c$.prompt = Clazz_defineMethod (c$, "prompt", -function (msg, defaultRet) { -{ -return confirm(msg, defaultRet); -}}, "~S,~S"); -c$.getPostEventQueue = Clazz_defineMethod (c$, "getPostEventQueue", -function (isPost) { -return (isPost ? jssun.awt.AppContext.getAppContext ().get ("PostEventQueue") : jssun.awt.AppContext.getAppContext ().get (jssun.awt.AppContext.EVENT_QUEUE_KEY)); -}, "~B"); -Clazz_overrideMethod (c$, "getScreenSize", -function () { -var d = new java.awt.Dimension (0, 0); -var jq = swingjs.JSToolkit.getJQuery (); -{ -d.setSize(jq.$(window).width(), jq.$(window).height()); return -d; -}}); -Clazz_overrideMethod (c$, "getScreenResolution", -function () { -return 0; -}); -Clazz_overrideMethod (c$, "getColorModel", -function () { -return java.awt.image.ColorModel.getRGBdefault (); -}); -Clazz_overrideMethod (c$, "getFontList", -function () { -var hardwiredFontList = Clazz_newArray (-1, ["SansSerif", "SansSerif", "Serif", "Monospaced", "DialogInput"]); -return hardwiredFontList; -}); -Clazz_overrideMethod (c$, "sync", -function () { -}); -Clazz_overrideMethod (c$, "isModalExclusionTypeSupported", -function (modalExclusionType) { -return true; -}, "java.awt.Dialog.ModalExclusionType"); -Clazz_overrideMethod (c$, "isModalityTypeSupported", -function (modalityType) { -return false; -}, "java.awt.Dialog.ModalityType"); -Clazz_overrideMethod (c$, "isTraySupported", -function () { -return false; -}); -Clazz_overrideMethod (c$, "getScreenWidth", -function () { -return 0; -}); -Clazz_overrideMethod (c$, "getScreenHeight", -function () { -return 0; -}); -Clazz_overrideMethod (c$, "grab", -function (w) { -}, "java.awt.Window"); -Clazz_overrideMethod (c$, "ungrab", -function (w) { -}, "java.awt.Window"); -c$.getPropertyObject = Clazz_defineMethod (c$, "getPropertyObject", -function (t, key, def) { -return def; -}, "~O,~S,~O"); -c$.getInstance = Clazz_defineMethod (c$, "getInstance", -function (className) { -return swingjs.api.Interface.getInstance (className, false); -}, "~S"); -c$.getGraphicsConfiguration = Clazz_defineMethod (c$, "getGraphicsConfiguration", -function () { -return (swingjs.JSToolkit.gc == null ? swingjs.JSToolkit.gc = swingjs.JSToolkit.getInstance ("swingjs.JSGraphicsConfiguration") : swingjs.JSToolkit.gc); -}); -c$.isFocused = Clazz_defineMethod (c$, "isFocused", -function (window) { -return false; -}, "java.awt.Window"); -c$.getCSSFont = Clazz_defineMethod (c$, "getCSSFont", -function (font) { -var css = ""; -if (font.isItalic ()) css += "font-style:italic;"; -if (font.isBold ()) css += "font-weight:bold;"; -css += "font-size:" + font.getSize () + "px;"; -css += "font-family:" + font.getFamily () + ";"; -return css; -}, "java.awt.Font"); -c$.getStringWidth = Clazz_defineMethod (c$, "getStringWidth", -function (context, font, text) { -var fontInfo = swingjs.JSToolkit.getCanvasFont (font); -if (context == null) context = swingjs.JSToolkit.getDefaultCanvasContext2d (); -var w = 0; -{ -context.font = fontInfo; -w = Math.ceil(context.measureText(text).width); -}return w; -}, "swingjs.api.HTML5CanvasContext2D,java.awt.Font,~S"); -c$.getDefaultCanvasContext2d = Clazz_defineMethod (c$, "getDefaultCanvasContext2d", -function () { -{ -if (this.defaultContext == null) this.defaultContext = -document.createElement( 'canvas' ).getContext('2d'); -}return swingjs.JSToolkit.defaultContext; -}); -c$.getCanvasFont = Clazz_defineMethod (c$, "getCanvasFont", -function (font) { -var strStyle = ""; -if (font.isItalic ()) strStyle += "italic "; -if (font.isBold ()) strStyle += "bold "; -return strStyle + font.getSize () + "px " + font.getFamily (); -}, "java.awt.Font"); -c$.getFontFamily = Clazz_defineMethod (c$, "getFontFamily", -function (font) { -return font.getName (); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -var fm = swingjs.JSToolkit.getInstance ("swingjs.JSFontMetrics"); -fm.setFont (font); -return fm; -}, "java.awt.Font"); -c$.getCSSColor = Clazz_defineMethod (c$, "getCSSColor", -function (c) { -var s = "000000" + Integer.toHexString (c.getRGB () & 0xFFFFFF); -return "#" + s.substring (s.length - 6); -}, "java.awt.Color"); -c$.notImplemented = Clazz_defineMethod (c$, "notImplemented", -function (msg) { -var s = null; -if (swingjs.JSToolkit.mapNotImpl == null) swingjs.JSToolkit.mapNotImpl = new java.util.Hashtable (); -{ -s = arguments.callee.caller; s = s.__CLASS_NAME__ || -s.claxxOwner.__CLASS_NAME__; s += "." + -arguments.callee.caller.exName; -}if (swingjs.JSToolkit.mapNotImpl.containsKey (s)) return; -swingjs.JSToolkit.mapNotImpl.put (s, Boolean.TRUE); -System.out.println (s + " has not been implemented in SwingJS. " + (msg === "" ? "" : (msg == null ? "" : msg) + swingjs.JSToolkit.getStackTrace (-5))); -}, "~S"); -c$.getStackTrace = Clazz_defineMethod (c$, "getStackTrace", -function () { -{ -return Clazz_getStackTrace(); -}}); -c$.getStackTrace = Clazz_defineMethod (c$, "getStackTrace", -function (n) { -{ -return Clazz_getStackTrace(n); -}}, "~N"); -c$.getLookAndFeelDefaults = Clazz_defineMethod (c$, "getLookAndFeelDefaults", -function () { -if (swingjs.JSToolkit.uid == null) swingjs.JSToolkit.uid = javax.swing.UIManager.getLookAndFeel ().getDefaults (); -return swingjs.JSToolkit.uid; -}); -c$.getComponentUI = Clazz_defineMethod (c$, "getComponentUI", -function (target) { -var c = swingjs.api.Interface.getInstance ("swingjs.plaf.JS" + target.getUIClassID (), true); -if (c != null) c.set (target); -return c; -}, "javax.swing.JComponent"); -c$.getSwingDivId = Clazz_defineMethod (c$, "getSwingDivId", -function () { -return Thread.currentThread ().getName () + "_swingdiv"; -}); -c$.getJQuery = Clazz_defineMethod (c$, "getJQuery", -function () { -{ -if (!window.jQuery) alert( -"jQuery is required for SwingJS, but window.jQuery is not defined." -); jQuery.$ || (jQuery.$ = jQuery); return(jQuery); -}}); -c$.getJavaResource = Clazz_defineMethod (c$, "getJavaResource", -function (resourceName) { -System.out.println ("JSToolkit getting Java resource " + resourceName); -{ -return SwingJS.getJavaResource(resourceName); -}}, "~S"); -c$.dispatchSystemEvent = Clazz_defineMethod (c$, "dispatchSystemEvent", -function (runnable) { -var f = null; -{ -System.out.println("JST dispatchSystemEvent " + -runnable.run.toString()); f = -function(_JSToolkit_dispatchSystemEvent) { -System.out.println("JST running " + -runnable.run.toString());runnable.run()}; -}swingjs.JSToolkit.setTimeout (f, 0, 0); -}, "Runnable"); -c$.dispatchEvent = Clazz_defineMethod (c$, "dispatchEvent", -function (event, src, andWait) { -var f = null; -var id = ++swingjs.JSToolkit.dispatchID; -{ -f = function() -{ -if -(src == null) event.dispatch(); else src.dispatchEvent(event); -}; -}if (andWait) swingjs.JSToolkit.invokeAndWait (f, id); - else swingjs.JSToolkit.setTimeout (f, 0, id); -}, "java.awt.AWTEvent,~O,~B"); -c$.setTimeout = Clazz_defineMethod (c$, "setTimeout", -function (f, msDelay, id) { -{ -var thread = java.lang.Thread.thisThread; -var thread0 = thread; -var id0 = SwingJS.eventID || 0; -setTimeout(function(_JSToolkit_setTimeout) { -SwingJS.eventID = id; -java.lang.Thread.thisThread = thread; -try { -if (f.run) -f.run(); -else -f(); -} catch (e) { -var s = "JSToolkit.setTimeout(" + id +"): " + e; -System.out.println(s); -alert(s)} -SwingJS.eventID = id0; -java.lang.Thread.thisThread = thread0; -}, msDelay); -}}, "~O,~N,~N"); -c$.invokeAndWait = Clazz_defineMethod (c$, "invokeAndWait", - function (f, id) { -{ -var thread = java.lang.Thread.thisThread; -var thread0 = thread; -(function(_JSToolkit_setTimeout) { -var id0 = SwingJS.eventID || 0; -System.out.println("runNow " + id); SwingJS.eventID = id; -java.lang.Thread.thisThread = thread; -if (f.run) -f.run(); -else -f(); -SwingJS.eventID = id0; -java.lang.Thread.thisThread = thread0; -})(); -}}, "swingjs.api.JSFunction,~N"); -c$.isDispatchThread = Clazz_defineMethod (c$, "isDispatchThread", -function () { -{ -return (!!SwingJS.eventID); -}}); -c$.checkClassMethod = Clazz_defineMethod (c$, "checkClassMethod", -function (component, fname, signature) { -{ -return component[fname] && component[fname][signature]; -}}, "java.awt.Component,~S,~S"); -c$.readyCallback = Clazz_defineMethod (c$, "readyCallback", -function (aname, fname, a, me) { -{ -Jmol._readyCallback(aname, fname, true,a, me); -}}, "~S,~S,~O,~O"); -c$.forceRepaint = Clazz_defineMethod (c$, "forceRepaint", -function (c) { -}, "java.awt.Component"); -c$.getHTML5Applet = Clazz_defineMethod (c$, "getHTML5Applet", -function (c) { -return (c.getAppContext ().getThreadGroup ()).getHtmlApplet (); -}, "javax.swing.JComponent"); -c$.taintUI = Clazz_defineMethod (c$, "taintUI", -function (c) { -{ -c.getUI && c.getUI() && c.getUI().setTainted(); -}}, "java.awt.Component"); -Clazz_overrideMethod (c$, "createComponent", -function (target) { -System.out.println ("JSToolkit creating LightweightPeer for " + target); -var peer = swingjs.JSToolkit.getUI (target, true); -return (peer == null ? new swingjs.JSComponentPeer (target) : peer); -}, "java.awt.Component"); -c$.getPlainDocument = Clazz_defineMethod (c$, "getPlainDocument", -function (c) { -return swingjs.JSToolkit.getInstance ("swingjs.JSPlainDocument"); -}, "javax.swing.JComponent"); -c$.getClassName = Clazz_defineMethod (c$, "getClassName", -function (c) { -{ -return c.__CLASS_NAME__; -}}, "~O"); -c$.getSignedStreamBytes = Clazz_defineMethod (c$, "getSignedStreamBytes", -function (bis) { -try { -return JU.AU.ensureSignedBytes (JU.Rdr.getStreamAsBytes (bis, null)); -} catch (e) { -if (Clazz_exceptionOf (e, java.io.IOException)) { -return null; -} else { -throw e; -} -} -}, "java.io.BufferedInputStream"); -c$.getFileContents = Clazz_defineMethod (c$, "getFileContents", -function (uri) { -{ -return Jmol._getFileData(uri); -}}, "~S"); -Clazz_defineMethod (c$, "getFileAsBytes", -function (filename) { -var data = swingjs.JSToolkit.getFileContents (filename); -var b = null; -if (JU.AU.isAB (data)) b = data; - else if (Clazz_instanceOf (data, String)) b = (data).getBytes (); - else if (Clazz_instanceOf (data, JU.SB)) b = JU.Rdr.getBytesFromSB (data); - else if (Clazz_instanceOf (data, java.io.InputStream)) try { -b = JU.Rdr.getLimitedStreamBytes (data, -1); -} catch (e) { -if (Clazz_exceptionOf (e, java.io.IOException)) { -} else { -throw e; -} -} -return JU.AU.ensureSignedBytes (b); -}, "~S"); -Clazz_defineMethod (c$, "getImagekit", - function () { -return (this.imageKit == null ? this.imageKit = swingjs.api.Interface.getInstance ("swingjs.JSImagekit", false) : this.imageKit); -}); -Clazz_defineMethod (c$, "createImage", -function (producer) { -producer.startProduction (null); -return null; -}, "java.awt.image.ImageProducer"); -Clazz_defineMethod (c$, "createImage", -function (filename) { -return this.getImagekit ().createImageFromBytes (swingjs.JSToolkit.getSignedStreamBytes ( new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (this.getFileAsBytes (filename)))), 0, -1); -}, "~S"); -Clazz_defineMethod (c$, "createImage", -function (url) { -try { -return this.getImagekit ().createImageFromBytes (swingjs.JSToolkit.getSignedStreamBytes ( new java.io.BufferedInputStream (url.openStream ())), 0, -1); -} catch (e) { -if (Clazz_exceptionOf (e, java.io.IOException)) { -return null; -} else { -throw e; -} -} -}, "java.net.URL"); -Clazz_defineMethod (c$, "createImage", -function (data, imageoffset, imagelength) { -return this.getImagekit ().createImageFromBytes (data, imageoffset, imagelength); -}, "~A,~N,~N"); -Clazz_overrideMethod (c$, "checkImage", -function (image, width, height, observer) { -return 63; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "prepareImage", -function (image, width, height, observer) { -return true; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -c$.hasFocus = Clazz_defineMethod (c$, "hasFocus", -function (c) { -var ui = swingjs.JSToolkit.getUI (c, false); -return (ui != null && ui.hasFocus ()); -}, "java.awt.Component"); -c$.getUI = Clazz_defineMethod (c$, "getUI", -function (c, isQuiet) { -var ui = null; -{ -ui = c.getUI && c.getUI(); -}if (ui == null) { -var s = "[JSToolkit] Component " + c.getClass ().getName () + " has no cooresponding JSComponentUI."; -System.out.println (s); -}return ui; -}, "java.awt.Component,~B"); -c$.requestFocus = Clazz_defineMethod (c$, "requestFocus", -function (c) { -var ui = swingjs.JSToolkit.getUI (c, false); -if (ui == null || !ui.isFocusable ()) return false; -var r = ((Clazz_isClassDefined ("swingjs.JSToolkit$1") ? 0 : swingjs.JSToolkit.$JSToolkit$1$ ()), Clazz_innerTypeInstance (swingjs.JSToolkit$1, this, Clazz_cloneFinals ("ui", ui))); -swingjs.JSToolkit.setTimeout (r, 50, 0); -return true; -}, "java.awt.Component"); -c$.getCompositor = Clazz_defineMethod (c$, "getCompositor", -function () { -return (swingjs.JSToolkit.compositor == null ? swingjs.JSToolkit.compositor = swingjs.api.Interface.getInstance ("swingjs.JSGraphicsCompositor", false) : swingjs.JSToolkit.compositor); -}); -c$.setGraphicsCompositeAlpha = Clazz_defineMethod (c$, "setGraphicsCompositeAlpha", -function (g, rule) { -return swingjs.JSToolkit.getCompositor ().setGraphicsCompositeAlpha (g, rule); -}, "swingjs.JSGraphics2D,~N"); -c$.drawImageOp = Clazz_defineMethod (c$, "drawImageOp", -function (g, img, op, x, y) { -return swingjs.JSToolkit.getCompositor ().drawImageOp (g, img, op, x, y); -}, "swingjs.JSGraphics2D,java.awt.image.BufferedImage,java.awt.image.BufferedImageOp,~N,~N"); -c$.filterRaster = Clazz_defineMethod (c$, "filterRaster", -function (src, dst, op) { -return swingjs.JSToolkit.getCompositor ().filterRaster (src, dst, op); -}, "java.awt.image.Raster,java.awt.image.WritableRaster,java.awt.image.RasterOp"); -c$.filterImage = Clazz_defineMethod (c$, "filterImage", -function (src, dst, op) { -return swingjs.JSToolkit.getCompositor ().filterImage (src, dst, op); -}, "java.awt.image.BufferedImage,java.awt.image.BufferedImage,java.awt.image.BufferedImageOp"); -c$.getZIndex = Clazz_defineMethod (c$, "getZIndex", -function (ui, what) { -{ -if (what) return getHTML5Applet(ui.c)._z[what]; -var c = ui.domNode; var z; -while (c && !(z = c.style["z-index"])) { -c = c.parentNode; -} -return z || 100000; -}}, "swingjs.plaf.JSComponentUI,~S"); -Clazz_overrideMethod (c$, "createFrame", -function (target) { -return this.createWindowPeer (target, true); -}, "java.awt.Frame"); -Clazz_overrideMethod (c$, "createWindow", -function (target) { -return this.createWindowPeer (target, false); -}, "java.awt.Window"); -Clazz_defineMethod (c$, "createWindowPeer", - function (target, isFrame) { -return (swingjs.JSToolkit.getInstance ("swingjs.JSWindowPeer")).setFrame (target, true); -}, "java.awt.Window,~B"); -c$.$JSToolkit$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (swingjs, "JSToolkit$1", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -this.f$.ui.requestFocus (null, false, false, 0, null); -}); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"gc", null, -"defaultContext", null, -"mapNotImpl", null, -"uid", null, -"dispatchID", 0, -"compositor", null); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.awt.event.InvocationEvent"], "swingjs.JSEvent", null, function () { -c$ = Clazz_declareType (swingjs, "JSEvent", java.awt.event.InvocationEvent); -Clazz_makeConstructor (c$, -function (t, r) { -Clazz_superConstructor (this, swingjs.JSEvent, [t, 1201, r, null, false]); -}, "swingjs.JSThread,Runnable"); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.awt.FontMetrics"], "swingjs.JSFontMetrics", ["swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.widths = null; -this.iwidths = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSFontMetrics", java.awt.FontMetrics); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, swingjs.JSFontMetrics, [null]); -}); -Clazz_defineMethod (c$, "setFont", -function (f) { -this.font = f; -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "getLeading", -function () { -return Clazz_doubleToInt (this.font.getSize () / 20) + 1; -}); -Clazz_overrideMethod (c$, "getAscent", -function () { -return this.font.getSize (); -}); -Clazz_overrideMethod (c$, "getDescent", -function () { -return Clazz_doubleToInt (this.font.getSize () / 4) + 1; -}); -Clazz_defineMethod (c$, "charWidth", -function (pt) { -return (pt.charCodeAt (0) < 256 ? Clazz_floatToInt (this.getWidthsFloat ()[pt.charCodeAt (0)]) : this.stringWidth ("" + pt)); -}, "~S"); -Clazz_defineMethod (c$, "charWidth", -function (pt) { -return (pt < 256 ? Clazz_floatToInt (this.getWidthsFloat ()[pt]) : this.stringWidth ("" + String.fromCharCode (pt))); -}, "~N"); -Clazz_overrideMethod (c$, "stringWidth", -function (s) { -return Clazz_floatToInt (swingjs.JSToolkit.getStringWidth (null, this.font, s)); -}, "~S"); -Clazz_overrideMethod (c$, "getWidths", -function () { -if (this.iwidths != null) return this.iwidths; -this.iwidths = Clazz_newIntArray (256, 0); -this.getWidthsFloat (); -for (var ch = 0; ch < 256; ch++) { -this.iwidths[ch] = Clazz_floatToInt (this.widths[ch]); -} -return this.iwidths; -}); -Clazz_defineMethod (c$, "getWidthsFloat", -function () { -if (this.widths != null) return this.widths; -this.widths = Clazz_newFloatArray (256, 0); -for (var ch = 0; ch < 256; ch++) { -this.widths[ch] = swingjs.JSToolkit.getStringWidth (null, this.font, "" + String.fromCharCode (ch)); -} -return this.widths; -}); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.lang.Thread", "swingjs.api.JSFunction"], "swingjs.JSThread", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.isJS = false; -Clazz_instantialize (this, arguments); -}, swingjs, "JSThread", Thread, swingjs.api.JSFunction); -Clazz_makeConstructor (c$, -function (group, name) { -Clazz_superConstructor (this, swingjs.JSThread, [group, name]); -{ -this.isJS = true; -}}, "ThreadGroup,~S"); -Clazz_overrideMethod (c$, "run", -function () { -this.run1 (0); -}); -Clazz_defineMethod (c$, "start", -function () { -{ -swingjs.JSToolkit.setTimeout(this, 1, 0); -}}); -Clazz_defineMethod (c$, "sleepAndReturn", -function (delay, state) { -if (!this.isJS) { -Thread.sleep (delay); -return false; -}var me = this; -var r = ((Clazz_isClassDefined ("swingjs.JSThread$1") ? 0 : swingjs.JSThread.$JSThread$1$ ()), Clazz_innerTypeInstance (swingjs.JSThread$1, this, Clazz_cloneFinals ("me", me, "state", state))); -{ -setTimeout( -function() {java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new java.awt.event.InvocationEvent(me, r))}, -delay -); -}return true; -}, "~N,~N"); -c$.$JSThread$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (swingjs, "JSThread$1", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -this.f$.me.run1 (this.f$.state); -}); -c$ = Clazz_p0p (); -}; -Clazz_defineStatics (c$, -"INIT", 0, -"LOOP", 1, -"DONE", 2); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.lang.ThreadGroup"], "swingjs.JSThreadGroup", null, function () { -c$ = Clazz_decorateAsClass (function () { -this.html5Applet = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSThreadGroup", ThreadGroup); -Clazz_defineMethod (c$, "setHtmlApplet", -function (html5Applet) { -this.html5Applet = html5Applet; -}, "swingjs.api.HTML5Applet"); -Clazz_defineMethod (c$, "getHtmlApplet", -function () { -return this.html5Applet; -}); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.applet.AppletContext", "$.AppletStub", "java.awt.Panel", "swingjs.api.JSInterface", "java.awt.Dimension"], "swingjs.JSAppletPanel", ["java.lang.InstantiationException", "java.net.URL", "java.awt.BorderLayout", "$.Font", "$.Toolkit", "javax.swing.JApplet", "jssun.applet.AppletEvent", "$.AppletEventMulticaster", "swingjs.JSAppletThread", "$.JSGraphics2D", "$.JSMouse", "$.JSThreadGroup", "$.JSToolkit", "$.JSUtil", "swingjs.api.Interface"], function () { -c$ = Clazz_decorateAsClass (function () { -this.params = null; -this.html5Applet = null; -this.fullName = null; -this.appletCodeBase = null; -this.appletIdiomaBase = null; -this.appletDocumentBase = null; -this.maximumSize = 2147483647; -this.appletName = null; -this.syncId = null; -this.testAsync = false; -this.async = false; -this.strJavaVersion = null; -this.strJavaVendor = null; -this.display = null; -this.canvas = null; -this.jsgraphics = null; -this.applet = null; -this.defaultAppletSize = null; -this.currentAppletSize = null; -this.nextStatus = 0; -this.status = 0; -this.listeners = null; -this.mouse = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSAppletPanel", java.awt.Panel, [java.applet.AppletStub, java.applet.AppletContext, swingjs.api.JSInterface]); -Clazz_prepareFields (c$, function () { -this.defaultAppletSize = new java.awt.Dimension (10, 10); -this.currentAppletSize = new java.awt.Dimension (10, 10); -}); -Clazz_makeConstructor (c$, -function (params) { -Clazz_superConstructor (this, swingjs.JSAppletPanel, []); -this.setPanel (); -this.set (params); -}, "java.util.Hashtable"); -Clazz_defineMethod (c$, "set", - function (params) { -System.out.println ("JSAppletPanel initializing"); -this.params = params; -this.htmlName = swingjs.JSUtil.split ("" + this.getParameter ("name"), "_object")[0]; -this.appletName = swingjs.JSUtil.split (this.htmlName + "_", "_")[0]; -this.syncId = this.getParameter ("syncId"); -this.fullName = this.htmlName + "__" + this.syncId + "__"; -params.put ("fullName", this.fullName); -var o = params.get ("codePath"); -if (o == null) o = "../java/"; -this.appletCodeBase = o.toString (); -this.appletIdiomaBase = this.appletCodeBase.substring (0, this.appletCodeBase.lastIndexOf ("/", this.appletCodeBase.length - 2) + 1) + "idioma"; -o = params.get ("documentBase"); -this.appletDocumentBase = (o == null ? "" : o.toString ()); -if (params.containsKey ("maximumSize")) Math.max ((params.get ("maximumSize")).intValue (), 100); -this.async = (this.testAsync || params.containsKey ("async")); -var applet = null; -var javaver = "?"; -{ -if(self.Jmol) { applet = -Jmol._applets[this.htmlName.split("_object")[0]]; javaver = -Jmol._version; } -}this.html5Applet = applet; -this.strJavaVersion = javaver; -this.strJavaVendor = "Java2Script/Java 1.6 (HTML5)"; -this.display = params.get ("display"); -this.threadGroup = new swingjs.JSThreadGroup (this.appletName); -this.myThread = new swingjs.JSAppletThread (this, this.threadGroup, this.appletName); -(this.threadGroup).setHtmlApplet (this.html5Applet); -{ -Jmol._applets[this.appletName + "_thread"] = -java.lang.Thread.thisThread = this.myThread; -}this.appContext = swingjs.JSToolkit.createNewAppContext (); -java.awt.Toolkit.getDefaultToolkit (); -try { -java.net.URL.setURLStreamHandlerFactory (swingjs.api.Interface.getInstance ("JU.AjaxURLStreamHandlerFactory", false)); -} catch (e) { -} -System.out.println ("JSAppletPanel initialized"); -}, "java.util.Hashtable"); -Clazz_defineMethod (c$, "start", -function () { -if (this.status == 0) this.myThread.start (); - else this.showStatus ("already started"); -}); -Clazz_defineMethod (c$, "addAppletListener", -function (l) { -this.listeners = jssun.applet.AppletEventMulticaster.add (this.listeners, l); -}, "jssun.applet.AppletListener"); -Clazz_defineMethod (c$, "removeAppletListener", -function (l) { -this.listeners = jssun.applet.AppletEventMulticaster.remove (this.listeners, l); -}, "jssun.applet.AppletListener"); -Clazz_defineMethod (c$, "dispatchAppletEvent", -function (id, argument) { -if (this.listeners != null) { -var evt = new jssun.applet.AppletEvent (this, id, argument); -this.listeners.appletStateChanged (evt); -}}, "~N,~O"); -Clazz_defineMethod (c$, "getCode", - function () { -return this.getParameter ("code"); -}); -Clazz_defineMethod (c$, "getCanvas", - function () { -return (this.canvas == null ? (this.canvas = this.html5Applet._getHtml5Canvas ()) : this.canvas); -}); -Clazz_overrideMethod (c$, "isActive", -function () { -return true; -}); -Clazz_overrideMethod (c$, "appletResize", -function (width, height) { -var currentSize = new java.awt.Dimension (this.currentAppletSize.width, this.currentAppletSize.height); -this.currentAppletSize.width = width; -this.currentAppletSize.height = height; -this.applet.setBounds (0, 0, this.getWidth (), this.getHeight ()); -this.applet.getRootPane ().setBounds (0, 0, this.getWidth (), this.getHeight ()); -this.applet.getContentPane ().setBounds (0, 0, this.getWidth (), this.getHeight ()); -(this.applet.getContentPane ()).revalidate (); -this.dispatchAppletEvent (51234, currentSize); -}, "~N,~N"); -Clazz_overrideMethod (c$, "getDocumentBase", -function () { -try { -return new java.net.URL (this.params.get ("documentBase")); -} catch (e) { -if (Clazz_exceptionOf (e, java.net.MalformedURLException)) { -return null; -} else { -throw e; -} -} -}); -Clazz_overrideMethod (c$, "getCodeBase", -function () { -try { -return new java.net.URL (this.params.get ("codePath")); -} catch (e) { -if (Clazz_exceptionOf (e, java.net.MalformedURLException)) { -return null; -} else { -throw e; -} -} -}); -Clazz_overrideMethod (c$, "getParameter", -function (name) { -var s = this.params.get (name); -System.out.println ("get parameter: " + name + " = " + s); -return (s == null ? null : "" + s); -}, "~S"); -Clazz_overrideMethod (c$, "getAppletContext", -function () { -return this; -}); -Clazz_defineMethod (c$, "getHeight", -function () { -return this.html5Applet._getHeight (); -}); -Clazz_defineMethod (c$, "getWidth", -function () { -return this.html5Applet._getWidth (); -}); -Clazz_defineMethod (c$, "setBounds", -function (x, y, width, height) { -this.reshape (x, y, width, height); -this.currentAppletSize.width = width; -this.currentAppletSize.height = height; -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getImage", -function (url) { -return null; -}, "java.net.URL"); -Clazz_overrideMethod (c$, "getApplet", -function (name) { -var applet = null; -{ -applet = Jmol._applets[name]; applet && (applet = -applet._applet); -}return applet; -}, "~S"); -Clazz_overrideMethod (c$, "getApplets", -function () { -return null; -}); -Clazz_defineMethod (c$, "showDocument", -function (url) { -{ -window.open(url.toString()); -}}, "java.net.URL"); -Clazz_defineMethod (c$, "showDocument", -function (url, target) { -{ -window.open(url.toString(), target); -}}, "java.net.URL,~S"); -Clazz_defineMethod (c$, "showStatus", -function (status) { -swingjs.JSToolkit.log (status); -{ -Clazz._LoaderProgressMonitor.showStatus(status, true); -}}, "~S"); -Clazz_overrideMethod (c$, "cacheFileByName", -function (fileName, isAdd) { -return 0; -}, "~S,~B"); -Clazz_overrideMethod (c$, "cachePut", -function (key, data) { -}, "~S,~O"); -Clazz_overrideMethod (c$, "destroy", -function () { -}); -Clazz_overrideMethod (c$, "getFullName", -function () { -return this.fullName; -}); -Clazz_overrideMethod (c$, "openFileAsyncSpecial", -function (fileName, flags) { -}, "~S,~N"); -Clazz_defineMethod (c$, "processMouseEvent", -function (id, x, y, modifiers, time) { -this.getMouse ().processEvent (id, x, y, modifiers, time); -return false; -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "getMouse", - function () { -return (this.mouse == null ? this.mouse = new swingjs.JSMouse (this) : this.mouse); -}); -Clazz_overrideMethod (c$, "processTwoPointGesture", -function (touches) { -this.getMouse ().processTwoPointGesture (touches); -}, "~A"); -Clazz_overrideMethod (c$, "setDisplay", -function (canvas) { -this.canvas = canvas; -}, "swingjs.api.HTML5Canvas"); -Clazz_overrideMethod (c$, "setScreenDimension", -function (width, height) { -this.setGraphics (this.jsgraphics = null); -if (this.applet != null) this.applet.resize (width, height); -}, "~N,~N"); -Clazz_overrideMethod (c$, "setStatusDragDropped", -function (mode, x, y, fileName) { -return false; -}, "~N,~N,~N,~S"); -Clazz_overrideMethod (c$, "startHoverWatcher", -function (enable) { -}, "~B"); -Clazz_overrideMethod (c$, "paint", -function (g) { -this.applet.paint (this.setGraphics (g)); -}, "java.awt.Graphics"); -Clazz_defineMethod (c$, "setGraphics", - function (g) { -return (g == null ? this.getGraphics () : g); -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "getGraphics", -function () { -if (this.jsgraphics == null) { -this.jsgraphics = new swingjs.JSGraphics2D (this.getCanvas ()); -this.jsgraphics.setWindowParameters (this.getWidth (), this.getHeight ()); -}return this.jsgraphics; -}); -Clazz_defineMethod (c$, "showAppletStatus", - function (status) { -this.getAppletContext ().showStatus (this.htmlName + " " + status); -}, "~S"); -Clazz_defineMethod (c$, "showAppletException", - function (t) { -{ -this.showAppletStatus("error " + (t.getMessage ? -t.getMessage() : t)); t.printStackTrace && -t.printStackTrace(); -}this.repaint (); -}, "Throwable"); -Clazz_defineMethod (c$, "run1", -function (mode) { -var ok = false; -switch (mode) { -case 0: -this.currentAppletSize.width = this.defaultAppletSize.width = this.getWidth (); -this.currentAppletSize.height = this.defaultAppletSize.height = this.getHeight (); -this.setLayout ( new java.awt.BorderLayout ()); -this.nextStatus = 1; -ok = true; -break; -case 1: -switch (this.nextStatus) { -case 1: -if (this.status != 0) { -this.showAppletStatus ("notdisposed"); -this.status = 7; -break; -}System.out.println ("JSAppletPanel runloader"); -this.runLoader (); -this.nextStatus = 2; -ok = true; -break; -case 2: -if (this.status != 1 && this.status != 5) { -this.showAppletStatus ("notloaded"); -break; -}System.out.println ("JSAppletPanel init"); -this.setFont ( new java.awt.Font ("Dialog", 0, 12)); -this.applet.resize (this.defaultAppletSize); -this.applet.init (); -this.validate (); -this.status = 2; -this.showAppletStatus ("initialized"); -this.nextStatus = 3; -ok = true; -break; -case 3: -if (this.status != 2 && this.status != 4) { -this.showAppletStatus ("notstarted"); -this.status = 7; -break; -}this.applet.getRootPane ().addNotify (); -System.out.println ("JSAppletPanel start" + this.currentAppletSize); -this.applet.resize (this.currentAppletSize); -this.applet.start (); -this.status = 3; -this.showAppletStatus ("started"); -this.nextStatus = 35; -ok = true; -break; -case 35: -swingjs.JSToolkit.readyCallback (this.appletName, this.fullName, this.applet, this); -break; -case 4: -if (this.status == 3) { -this.status = 4; -this.applet.setVisible (false); -this.applet.stop (); -this.showAppletStatus ("stopped"); -} else { -this.showAppletStatus ("notstopped"); -this.status = 7; -}break; -case 5: -if (this.status == 4 || this.status == 2) { -this.status = 5; -this.applet.destroy (); -this.showAppletStatus ("destroyed"); -} else { -this.showAppletStatus ("notdestroyed"); -this.status = 7; -}break; -case 75: -if (this.status == 5 || this.status == 1) { -this.showAppletStatus ("notdisposed"); -this.status = 7; -} else { -this.status = 0; -this.removeChild (this.applet); -this.applet = null; -this.showAppletStatus ("disposed"); -}break; -case 6: -break; -default: -System.out.println ("unrecognized JSAppletPanel status: " + this.nextStatus); -break; -} -break; -default: -System.out.println ("unrecognized JSAppletThread mode: " + mode); -break; -} -return (ok ? 1 : 2); -}, "~N"); -Clazz_defineMethod (c$, "runLoader", - function () { -this.dispatchAppletEvent (51235, null); -this.status = 1; -var code = this.getCode (); -try { -if (code == null) { -System.err.println ("runloader.err-- \"code\" must be specified."); -throw new InstantiationException ("\"code\" must be specified."); -}this.applet = swingjs.JSToolkit.getInstance (code); -if (this.applet == null) { -System.out.println (code + " could not be launched"); -this.status = 7; -} else if (!(Clazz_instanceOf (this.applet, javax.swing.JApplet))) { -System.out.println (code + " is not a JApplet!?"); -this.status = 7; -}} catch (e$$) { -if (Clazz_exceptionOf (e$$, InstantiationException)) { -var e = e$$; -{ -this.status = 7; -this.showAppletException (e); -return; -} -} else if (Clazz_exceptionOf (e$$, Exception)) { -var e = e$$; -{ -this.status = 7; -this.showAppletException (e); -return; -} -} else if (Clazz_exceptionOf (e$$, ThreadDeath)) { -var e = e$$; -{ -this.status = 7; -this.showAppletStatus ("death"); -return; -} -} else if (Clazz_exceptionOf (e$$, Error)) { -var e = e$$; -{ -this.status = 7; -this.showAppletException (e); -return; -} -} else { -throw e$$; -} -} finally { -this.dispatchAppletEvent (51236, null); -} -if (this.applet != null) { -this.applet.setStub (this); -this.applet.setVisible (false); -this.add ("Center", this.applet); -this.applet.setDispatcher (); -this.applet.addNotify (); -this.showAppletStatus ("loaded"); -this.validate (); -}}); -Clazz_defineMethod (c$, "getUI", -function () { -return null; -}); -Clazz_overrideMethod (c$, "repaintImpl", -function (tm, x, y, width, height) { -if (this.applet.isVisible () && this.applet.getWidth () > 0 && this.applet.getHeight () > 0) { -this.applet.getContentPane ().repaint (tm, x, y, width, height); -}}, "~N,~N,~N,~N,~N"); -Clazz_defineStatics (c$, -"APPLET_UNINITIALIZED", 0, -"APPLET_LOAD", 1, -"APPLET_INIT", 2, -"APPLET_START", 3, -"APPLET_READY", 35, -"APPLET_STOP", 4, -"APPLET_DESTROY", 5, -"APPLET_QUIT", 6, -"APPLET_ERROR", 7, -"APPLET_DISPOSE", 75, -"APPLET_RESIZE", 51234, -"APPLET_LOADING", 51235, -"APPLET_LOADING_COMPLETED", 51236); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["jssun.java2d.SunGraphics2D"], "swingjs.JSGraphics2D", ["java.util.HashMap", "java.awt.BasicStroke", "$.Rectangle", "$.RenderingHints", "$.Toolkit", "java.awt.geom.AffineTransform", "swingjs.JSToolkit", "swingjs.api.HTML5CanvasContext2D"], function () { -c$ = Clazz_decorateAsClass (function () { -this.constrainX = 0; -this.constrainY = 0; -this.windowWidth = 0; -this.windowHeight = 0; -this.canvas = null; -this.ctx = null; -this.gc = null; -this.paintState = 0; -this.compositeState = -2147483648; -this.strokeState = 0; -this.$transformState = 0; -this.clipState = 0; -this.isShifted = false; -this.font = null; -this.inPath = false; -this.currentClip = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSGraphics2D", jssun.java2d.SunGraphics2D, Cloneable); -Clazz_makeConstructor (c$, -function (canvas) { -Clazz_superConstructor (this, swingjs.JSGraphics2D, []); -this.hints = new java.awt.RenderingHints ( new java.util.HashMap ()); -this.canvas = canvas; -this.ctx = this.canvas.getContext ("2d"); -this.$transform = new java.awt.geom.AffineTransform (); -{ -this.gc = SwingJS; -}}, "~O"); -Clazz_overrideMethod (c$, "getDeviceConfiguration", -function () { -return this.gc; -}); -Clazz_overrideMethod (c$, "drawLine", -function (x0, y0, x1, y1) { -var inPath = this.inPath; -if (!inPath) this.ctx.beginPath (); -this.ctx.moveTo (x0, y0); -this.ctx.lineTo (x1, y1); -if (!inPath) this.ctx.stroke (); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "drawCircle", -function (x, y, diameter) { -this.drawArc (x, y, diameter, diameter, 0, 360); -}, "~N,~N,~N"); -Clazz_overrideMethod (c$, "fillArc", -function (x, y, width, height, startAngle, arcAngle) { -this.doArc (x, y, width, height, startAngle, arcAngle, true); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "drawArc", -function (x, y, width, height, startAngle, arcAngle) { -this.doArc (x, y, width, height, startAngle, arcAngle, false); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "save", - function () { -this.ctx.save (); -}); -Clazz_defineMethod (c$, "restore", - function () { -this.ctx.restore (); -}); -Clazz_defineMethod (c$, "doArc", - function (x, y, width, height, startAngle, arcAngle, fill) { -var isCircle = (arcAngle - startAngle == 360); -this.save (); -this.ctx.translate (x, y); -this.ctx.scale (Clazz_doubleToInt (width / height), height); -this.ctx.beginPath (); -if (fill) { -}this.ctx.arc (0.5, 0.5, 0.5, this.toRad (startAngle), this.toRad (arcAngle), false); -if (isCircle) this.ctx.closePath (); -this.ctx.stroke (); -this.restore (); -}, "~N,~N,~N,~N,~N,~N,~B"); -Clazz_defineMethod (c$, "toRad", - function (a) { -return a * 3.141592653589793 / 180; -}, "~N"); -Clazz_defineMethod (c$, "drawPolygon", -function (ayPoints, axPoints, nPoints) { -this.doPoly (ayPoints, axPoints, nPoints, false); -}, "~A,~A,~N"); -Clazz_defineMethod (c$, "doPoly", - function (axPoints, ayPoints, nPoints, doFill) { -this.ctx.beginPath (); -this.ctx.moveTo (axPoints[0], ayPoints[0]); -for (var i = 1; i < nPoints; i++) this.ctx.lineTo (axPoints[i], ayPoints[i]); - -if (doFill) this.ctx.fill (); - else this.ctx.stroke (); -}, "~A,~A,~N,~B"); -Clazz_overrideMethod (c$, "drawRect", -function (x, y, width, height) { -this.ctx.beginPath (); -this.ctx.rect (x, y, width, height); -this.ctx.stroke (); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "drawString", -function (s, x, y) { -this.ctx.fillText (s, x, y); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "background", -function (bgcolor) { -this.backgroundColor = bgcolor; -if (bgcolor == null) { -if (!this.isShifted) this.ctx.translate (-0.5, -0.5); -this.isShifted = true; -return; -}this.ctx.clearRect (0, 0, this.windowWidth, this.windowHeight); -this.setGraphicsColor (bgcolor); -this.fillRect (0, 0, this.windowWidth, this.windowHeight); -}, "java.awt.Color"); -Clazz_defineMethod (c$, "fillCircle", -function (x, y, diameter) { -var r = diameter / 2; -this.ctx.beginPath (); -this.ctx.arc (x + r, y + r, r, 0, 6.283185307179586, false); -this.ctx.fill (); -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "fillPolygon", -function (ayPoints, axPoints, nPoints) { -this.doPoly (ayPoints, axPoints, nPoints, true); -}, "~A,~A,~N"); -Clazz_overrideMethod (c$, "fillRect", -function (x, y, width, height) { -this.ctx.fillRect (x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setGraphicsColor", -function (c) { -var s = swingjs.JSToolkit.getCSSColor (c); -{ -this.ctx.fillStyle = s; this.ctx.strokeStyle = s; -}}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setFont", -function (font) { -this.font = font; -if (this.ctx == null) return; -var s = swingjs.JSToolkit.getCanvasFont (font); -{ -this.ctx.font = s; -}}, "java.awt.Font"); -Clazz_defineMethod (c$, "setStrokeBold", -function (tf) { -this.setLineWidth (tf ? 2. : 1.); -}, "~B"); -Clazz_defineMethod (c$, "setLineWidth", - function (d) { -{ -this.ctx.lineWidth = d; -}}, "~N"); -Clazz_defineMethod (c$, "setWindowParameters", -function (width, height) { -this.windowWidth = width; -this.windowHeight = height; -}, "~N,~N"); -Clazz_defineMethod (c$, "canDoLineTo", -function () { -return true; -}); -Clazz_defineMethod (c$, "doStroke", -function (isBegin) { -this.inPath = isBegin; -if (isBegin) { -this.ctx.beginPath (); -} else { -this.ctx.stroke (); -}}, "~B"); -Clazz_defineMethod (c$, "lineTo", -function (x2, y2) { -this.ctx.lineTo (x2, y2); -}, "~N,~N"); -Clazz_overrideMethod (c$, "clip", -function (s) { -this.doShape (s); -this.ctx.clip (); -}, "java.awt.Shape"); -Clazz_overrideMethod (c$, "draw", -function (s) { -this.doShape (s); -this.ctx.stroke (); -}, "java.awt.Shape"); -Clazz_defineMethod (c$, "doShape", - function (s) { -this.ctx.beginPath (); -var pts = Clazz_newDoubleArray (6, 0); -var pi = s.getPathIterator (null); -while (!pi.isDone ()) { -switch (pi.currentSegment (pts)) { -case 0: -this.ctx.moveTo (pts[0], pts[1]); -break; -case 1: -this.ctx.lineTo (pts[0], pts[1]); -break; -case 2: -this.ctx.quadraticCurveTo (pts[0], pts[1], pts[2], pts[3]); -break; -case 3: -this.ctx.bezeierCurveTo (pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); -break; -case 4: -this.ctx.closePath (); -break; -} -pi.next (); -} -return pi.getWindingRule (); -}, "java.awt.Shape"); -Clazz_overrideMethod (c$, "fill", -function (s) { -if (this.doShape (s) == 0) { -this.ctx.fill("evenodd"); -} else this.ctx.fill (); -}, "java.awt.Shape"); -Clazz_defineMethod (c$, "drawImage", -function (img, x, y, observer) { -System.out.println ("JSGraphics testing draw image"); -this.drawString ("JSGraphics testing draw img", 50, 50); -if (img != null) { -var imgNode = this.getImageNode (img); -if (imgNode != null) this.ctx.drawImage (imgNode, x, y, img.getWidth (observer), img.getHeight (observer)); -if (observer != null) this.observe (img, observer, imgNode != null); -}return true; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "observe", - function (img, observer, isOK) { -observer.imageUpdate (img, (isOK ? 0 : 192), -1, -1, -1, -1); -}, "java.awt.Image,java.awt.image.ImageObserver,~B"); -Clazz_defineMethod (c$, "drawImage", -function (img, x, y, width, height, observer) { -if (img != null) { -var imgNode = this.getImageNode (img); -if (imgNode != null) this.ctx.drawImage (imgNode, x, y, width, height); -if (observer != null) this.observe (img, observer, imgNode != null); -}return true; -}, "java.awt.Image,~N,~N,~N,~N,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "drawImage", -function (img, x, y, bgcolor, observer) { -swingjs.JSToolkit.notImplemented (null); -return this.drawImage (img, x, y, null); -}, "java.awt.Image,~N,~N,java.awt.Color,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "drawImage", -function (img, x, y, width, height, bgcolor, observer) { -swingjs.JSToolkit.notImplemented (null); -return this.drawImage (img, x, y, width, height, null); -}, "java.awt.Image,~N,~N,~N,~N,java.awt.Color,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "drawImage", -function (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer) { -if (img != null) { -var imgNode = this.getImageNode (img); -if (imgNode != null) swingjs.api.HTML5CanvasContext2D.stretchImage (this.ctx, imgNode, sx1, sy1, sx2 - sx1, sy2 - sy1, dx1, dy1, dx2 - dx1, dy2 - dy1); -if (observer != null) this.observe (img, observer, imgNode != null); -}return true; -}, "java.awt.Image,~N,~N,~N,~N,~N,~N,~N,~N,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "getImageNode", - function (img) { -var imgNode = null; -{ -imgNode = img._imgNode; -}if (imgNode == null) imgNode = swingjs.JSToolkit.getCompositor ().createImageNode (img); -return imgNode; -}, "java.awt.Image"); -Clazz_defineMethod (c$, "drawImage", -function (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer) { -swingjs.JSToolkit.notImplemented (null); -return this.drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer); -}, "java.awt.Image,~N,~N,~N,~N,~N,~N,~N,~N,java.awt.Color,java.awt.image.ImageObserver"); -Clazz_defineMethod (c$, "drawImage", -function (img, xform, obs) { -swingjs.JSToolkit.notImplemented (null); -return false; -}, "java.awt.Image,java.awt.geom.AffineTransform,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "drawRenderedImage", -function (img, xform) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.image.RenderedImage,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "drawRenderableImage", -function (img, xform) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.image.renderable.RenderableImage,java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "hit", -function (rect, s, onStroke) { -swingjs.JSToolkit.notImplemented (null); -return false; -}, "java.awt.Rectangle,java.awt.Shape,~B"); -Clazz_overrideMethod (c$, "setPaint", -function (paint) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.Paint"); -Clazz_overrideMethod (c$, "setStroke", -function (s) { -if (!(Clazz_instanceOf (s, java.awt.BasicStroke))) return; -var b = s; -var dash = b.getDashArray (); -var idash = Clazz_newIntArray (dash == null ? 0 : dash.length, 0); -for (var i = idash.length; --i >= 0; ) idash[i] = Clazz_floatToInt (dash[i]); - -this.ctx.setLineDash (idash); -this.setLineWidth (b.getLineWidth ()); -var lineCap; -var lineJoin; -var miterLimit = -1; -switch (b.getEndCap ()) { -case 0: -lineCap = "butt"; -break; -case 2: -lineCap = "square"; -break; -case 1: -default: -lineCap = "round"; -} -switch (b.getLineJoin ()) { -case 2: -lineJoin = "bevel"; -break; -case 0: -lineJoin = "miter"; -miterLimit = b.getMiterLimit (); -break; -case 1: -lineJoin = "round"; -} -{ -this.ctx.lineCap = lineCap; this.ctx.lineJoin = lineJoin; if -(miterLimit >= 0) this.ctx.miterLimit = miterLimit; -}}, "java.awt.Stroke"); -Clazz_overrideMethod (c$, "setRenderingHint", -function (hintKey, hintValue) { -this.hints.put (hintKey, hintValue); -}, "java.awt.RenderingHints.Key,~O"); -Clazz_overrideMethod (c$, "getRenderingHint", -function (hintKey) { -return this.hints.get (hintKey); -}, "java.awt.RenderingHints.Key"); -Clazz_overrideMethod (c$, "setRenderingHints", -function (hints) { -this.hints = new java.awt.RenderingHints (hints); -}, "java.util.Map"); -Clazz_overrideMethod (c$, "addRenderingHints", -function (hints) { -for (var e, $e = hints.entrySet ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) this.hints.put (e.getKey (), e.getValue ()); - -}, "java.util.Map"); -Clazz_overrideMethod (c$, "getRenderingHints", -function () { -return this.hints; -}); -Clazz_defineMethod (c$, "translate", -function (x, y) { -this.ctx.translate (x, y); -}, "~N,~N"); -Clazz_overrideMethod (c$, "scale", -function (sx, sy) { -this.ctx.scale (sx, sy); -}, "~N,~N"); -Clazz_overrideMethod (c$, "setBackground", -function (color) { -this.background (color); -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "getBackground", -function () { -return this.backgroundColor; -}); -Clazz_overrideMethod (c$, "createSwingJS", -function () { -return this.clone (); -}); -Clazz_overrideMethod (c$, "clone", -function () { -this.save (); -return this.clone0 (); -}); -Clazz_overrideMethod (c$, "dispose", -function () { -if (this.compositeState >= 0) this.setComposite (null); -this.restore (); -}); -Clazz_overrideMethod (c$, "getColor", -function () { -return this.foregroundColor; -}); -Clazz_overrideMethod (c$, "setColor", -function (c) { -this.foregroundColor = c; -this.setGraphicsColor (c); -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "getFont", -function () { -return this.font; -}); -Clazz_defineMethod (c$, "getFontMetrics", -function (f) { -return java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (f); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "clipRect", -function (x, y, width, height) { -this.ctx.beginPath (); -this.ctx.rect (x, y, width, height); -this.currentClip = new java.awt.Rectangle (x, y, width, height); -this.ctx.clip (); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setClip", -function (x, y, width, height) { -this.currentClip = new java.awt.Rectangle (x, y, width, height); -{ -if (arguments.length == 1) { setClip1(x); return; } -}this.ctx.beginPath (); -this.ctx.rect (x, y, width, height); -this.currentClip = new java.awt.Rectangle (x, y, width, height); -this.ctx.clip (); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "setClip1", -function (clip) { -this.ctx.beginPath (); -this.doShape (clip); -this.ctx.clip (); -}, "java.awt.Shape"); -Clazz_overrideMethod (c$, "clearRect", -function (x, y, width, height) { -this.ctx.clearRect (x, y, width, height); -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "drawPolyline", -function (xPoints, yPoints, nPoints) { -if (nPoints < 2) return; -this.ctx.moveTo (xPoints[0], yPoints[0]); -for (var i = 1; i < nPoints; i++) { -this.ctx.lineTo (xPoints[i], yPoints[i]); -} -}, "~A,~A,~N"); -Clazz_overrideMethod (c$, "copyArea", -function (x, y, width, height, dx, dy) { -swingjs.JSToolkit.notImplemented (null); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "drawRoundRect", -function (x, y, width, height, arcWidth, arcHeight) { -swingjs.JSToolkit.notImplemented (null); -this.drawRect (x, y, width, height); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "fillRoundRect", -function (x, y, width, height, arcWidth, arcHeight) { -swingjs.JSToolkit.notImplemented (null); -this.fillRect (x, y, width, height); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "drawOval", -function (x, y, width, height) { -swingjs.JSToolkit.notImplemented (null); -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "fillOval", -function (x, y, width, height) { -swingjs.JSToolkit.notImplemented (null); -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getClip", -function () { -swingjs.JSToolkit.notImplemented (null); -return null; -}); -Clazz_overrideMethod (c$, "drawStringTrans", -function (str, x, y) { -swingjs.JSToolkit.notImplemented (null); -}, "~S,~N,~N"); -Clazz_defineMethod (c$, "drawString", -function (iterator, x, y) { -swingjs.JSToolkit.notImplemented (null); -}, "java.text.AttributedCharacterIterator,~N,~N"); -Clazz_overrideMethod (c$, "drawStringAttrTrans", -function (iterator, x, y) { -swingjs.JSToolkit.notImplemented (null); -}, "java.text.AttributedCharacterIterator,~N,~N"); -Clazz_overrideMethod (c$, "translateTrans", -function (tx, ty) { -swingjs.JSToolkit.notImplemented (null); -}, "~N,~N"); -Clazz_defineMethod (c$, "rotate", -function (theta) { -swingjs.JSToolkit.notImplemented (null); -}, "~N"); -Clazz_defineMethod (c$, "rotate", -function (theta, x, y) { -swingjs.JSToolkit.notImplemented (null); -}, "~N,~N,~N"); -Clazz_overrideMethod (c$, "shear", -function (shx, shy) { -swingjs.JSToolkit.notImplemented (null); -}, "~N,~N"); -Clazz_overrideMethod (c$, "transform", -function (xform) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "setTransform", -function (Tx) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.geom.AffineTransform"); -Clazz_overrideMethod (c$, "getTransform", -function () { -swingjs.JSToolkit.notImplemented (null); -return null; -}); -Clazz_defineMethod (c$, "cloneTransform", -function () { -swingjs.JSToolkit.notImplemented (null); -return null; -}); -Clazz_overrideMethod (c$, "getPaint", -function () { -swingjs.JSToolkit.notImplemented (null); -return null; -}); -Clazz_overrideMethod (c$, "getStroke", -function () { -swingjs.JSToolkit.notImplemented (null); -return null; -}); -Clazz_overrideMethod (c$, "getFontRenderContext", -function () { -swingjs.JSToolkit.notImplemented (null); -return null; -}); -Clazz_overrideMethod (c$, "setPaintMode", -function () { -swingjs.JSToolkit.notImplemented (null); -}); -Clazz_overrideMethod (c$, "setXORMode", -function (c1) { -swingjs.JSToolkit.notImplemented (null); -}, "java.awt.Color"); -Clazz_defineMethod (c$, "getClipBounds", -function () { -var r = null; -{ -if (arguments.length == 1) r = arguments[0]; -}var clipRect = this.getClipBoundsImpl (); -if (r == null) { -r = clipRect; -} else { -r.x = clipRect.x; -r.y = clipRect.y; -r.width = clipRect.width; -r.height = clipRect.height; -}return r; -}); -Clazz_defineMethod (c$, "getClipBoundsImpl", - function () { -if (this.currentClip == null) { -this.currentClip = new java.awt.Rectangle (0, 0, this.windowWidth, this.windowHeight); -}return this.currentClip; -}); -Clazz_overrideMethod (c$, "setComposite", -function (comp) { -var newRule = 0; -var isValid = (comp == null || (Clazz_instanceOf (comp, java.awt.AlphaComposite)) && (newRule = (comp).getRule ()) != this.compositeState); -if (!isValid) return; -if (swingjs.JSToolkit.setGraphicsCompositeAlpha (this, newRule)) this.compositeState = newRule; -}, "java.awt.Composite"); -Clazz_defineMethod (c$, "drawImage", -function (img, op, x, y) { -swingjs.JSToolkit.drawImageOp (this, img, op, x, y); -}, "java.awt.image.BufferedImage,java.awt.image.BufferedImageOp,~N,~N"); -Clazz_defineMethod (c$, "setAlpha", -function (f) { -{ -this.ctx.globalAlpha = f; -}}, "~N"); -Clazz_defineStatics (c$, -"saveLevel", 0); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["swingjs.JSThread"], "swingjs.JSAppletThread", ["javax.swing.SwingUtilities"], function () { -c$ = Clazz_decorateAsClass (function () { -this.ap = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSAppletThread", swingjs.JSThread); -Clazz_makeConstructor (c$, -function (ap, group, name) { -Clazz_superConstructor (this, swingjs.JSAppletThread, [group, name]); -this.ap = ap; -}, "swingjs.JSAppletPanel,ThreadGroup,~S"); -Clazz_overrideMethod (c$, "run1", -function (mode) { -mode = this.ap.run1 (mode); -if (mode != 2) this.dispatchAndReturn (null, mode); -}, "~N"); -Clazz_defineMethod (c$, "dispatchAndReturn", -function (r, mode) { -var m = mode; -javax.swing.SwingUtilities.invokeLater (((Clazz_isClassDefined ("swingjs.JSAppletThread$1") ? 0 : swingjs.JSAppletThread.$JSAppletThread$1$ ()), Clazz_innerTypeInstance (swingjs.JSAppletThread$1, this, Clazz_cloneFinals ("m", m)))); -}, "Runnable,~N"); -c$.$JSAppletThread$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (swingjs, "JSAppletThread$1", null, Runnable); -Clazz_overrideMethod (c$, "run", -function () { -this.b$["swingjs.JSAppletThread"].run1 (this.f$.m); -}); -c$ = Clazz_p0p (); -}; -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (null, "swingjs.JSMouse", ["JU.V3", "java.awt.Toolkit", "java.awt.event.MouseEvent"], function () { -c$ = Clazz_decorateAsClass (function () { -this.ap = null; -this.isMouseDown = false; -this.wheeling = false; -this.xWhenPressed = 0; -this.yWhenPressed = 0; -this.modifiersWhenPressed10 = 0; -Clazz_instantialize (this, arguments); -}, swingjs, "JSMouse"); -Clazz_makeConstructor (c$, -function (ap) { -this.ap = ap; -}, "swingjs.JSAppletPanel"); -Clazz_defineMethod (c$, "processEvent", -function (id, x, y, modifiers, time) { -if (id != -1) modifiers = swingjs.JSMouse.applyLeftMouse (modifiers); -switch (id) { -case -1: -this.wheeled (time, x, modifiers); -break; -case 501: -this.xWhenPressed = x; -this.yWhenPressed = y; -this.modifiersWhenPressed10 = modifiers; -this.pressed (time, x, y, modifiers, false); -break; -case 506: -this.dragged (time, x, y, modifiers); -break; -case 504: -this.entry (time, x, y, false); -break; -case 505: -this.entry (time, x, y, true); -break; -case 503: -this.moved (time, x, y, modifiers); -break; -case 502: -this.released (time, x, y, modifiers); -if (x == this.xWhenPressed && y == this.yWhenPressed && modifiers == this.modifiersWhenPressed10) { -this.clicked (time, x, y, modifiers, 1); -}break; -default: -return false; -} -return true; -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "processTwoPointGesture", -function (touches) { -if (touches[0].length < 2) return; -var t1 = touches[0]; -var t2 = touches[1]; -var t1first = t1[0]; -var t1last = t1[t2.length - 1]; -var x1first = t1first[0]; -var x1last = t1last[0]; -var dx1 = x1last - x1first; -var y1first = t1first[1]; -var y1last = t1last[1]; -var dy1 = y1last - y1first; -var v1 = JU.V3.new3 (dx1, dy1, 0); -var d1 = v1.length (); -var t2first = t2[0]; -var t2last = t2[t2.length - 1]; -var x2first = t2first[0]; -var x2last = t2last[0]; -var dx2 = x2last - x2first; -var y2first = t2first[1]; -var y2last = t2last[1]; -var dy2 = y2last - y2first; -var v2 = JU.V3.new3 (dx2, dy2, 0); -var d2 = v2.length (); -if (d1 < 1 || d2 < 1) return; -v1.normalize (); -v2.normalize (); -var cos12 = (v1.dot (v2)); -if (cos12 > 0.8) { -var deltaX = Clazz_floatToInt (x1last - t1[t1.length - 2][0]); -var deltaY = Clazz_floatToInt (y1last - t1[t1.length - 2][1]); -this.translateXYBy (deltaX, deltaY); -} else if (cos12 < -0.8) { -v1 = JU.V3.new3 (x2first - x1first, y2first - y1first, 0); -v2 = JU.V3.new3 (x2last - x1last, y2last - y1last, 0); -var dx = v2.length () - v1.length (); -this.wheeled (System.currentTimeMillis (), dx < 0 ? -1 : 1, 32); -}}, "~A"); -Clazz_defineMethod (c$, "translateXYBy", - function (deltaX, deltaY) { -}, "~N,~N"); -Clazz_defineMethod (c$, "mouseClicked", -function (e) { -this.clicked (e.getWhen (), e.getX (), e.getY (), e.getModifiers (), e.getClickCount ()); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseEntered", -function (e) { -this.entry (e.getWhen (), e.getX (), e.getY (), false); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseExited", -function (e) { -this.entry (e.getWhen (), e.getX (), e.getY (), true); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mousePressed", -function (e) { -this.pressed (e.getWhen (), e.getX (), e.getY (), e.getModifiers (), e.isPopupTrigger ()); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseReleased", -function (e) { -this.released (e.getWhen (), e.getX (), e.getY (), e.getModifiers ()); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseDragged", -function (e) { -var modifiers = e.getModifiers (); -if ((modifiers & 28) == 0) modifiers |= 16; -this.dragged (e.getWhen (), e.getX (), e.getY (), modifiers); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseMoved", -function (e) { -this.moved (e.getWhen (), e.getX (), e.getY (), e.getModifiers ()); -}, "java.awt.event.MouseEvent"); -Clazz_defineMethod (c$, "mouseWheelMoved", -function (e) { -e.consume (); -this.wheeled (e.getWhen (), e.getWheelRotation (), e.getModifiers ()); -}, "java.awt.event.MouseWheelEvent"); -Clazz_defineMethod (c$, "entry", - function (time, x, y, isExit) { -this.wheeling = false; -this.mouseEnterExit (time, x, y, isExit); -}, "~N,~N,~N,~B"); -Clazz_defineMethod (c$, "clicked", - function (time, x, y, modifiers, clickCount) { -this.mouseAction (500, time, x, y, 1, modifiers); -}, "~N,~N,~N,~N,~N"); -Clazz_defineMethod (c$, "moved", - function (time, x, y, modifiers) { -if (this.isMouseDown) this.mouseAction (506, time, x, y, 0, swingjs.JSMouse.applyLeftMouse (modifiers)); - else this.mouseAction (503, time, x, y, 0, modifiers); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "wheeled", - function (time, rotation, modifiers) { -this.wheeling = true; -this.mouseAction (507, time, 0, rotation, 0, modifiers & -29 | 32); -}, "~N,~N,~N"); -Clazz_defineMethod (c$, "pressed", - function (time, x, y, modifiers, isPopupTrigger) { -this.isMouseDown = true; -this.wheeling = false; -this.mouseAction (501, time, x, y, 0, modifiers); -}, "~N,~N,~N,~N,~B"); -Clazz_defineMethod (c$, "released", - function (time, x, y, modifiers) { -this.isMouseDown = false; -this.wheeling = false; -this.mouseAction (502, time, x, y, 0, modifiers); -}, "~N,~N,~N,~N"); -Clazz_defineMethod (c$, "dragged", - function (time, x, y, modifiers) { -if (this.wheeling) return; -if ((modifiers & 20) == 20) modifiers = modifiers & -5 | 2; -this.mouseAction (506, time, x, y, 0, modifiers); -}, "~N,~N,~N,~N"); -c$.applyLeftMouse = Clazz_defineMethod (c$, "applyLeftMouse", - function (modifiers) { -return ((modifiers & 28) == 0) ? (modifiers | 16) : modifiers; -}, "~N"); -Clazz_defineMethod (c$, "getButton", - function (modifiers) { -switch (modifiers & 28) { -case 16: -return 1; -case 8: -return 2; -case 4: -return 3; -default: -return 0; -} -}, "~N"); -Clazz_defineMethod (c$, "mouseEnterExit", - function (time, x, y, isExit) { -}, "~N,~N,~N,~B"); -Clazz_defineMethod (c$, "mouseAction", - function (id, time, x, y, count, modifiers) { -var popupTrigger = false; -var button = this.getButton (modifiers); -var source = this.ap.applet; -var e = new java.awt.event.MouseEvent (source, id, time, modifiers, x, y, x, y, count, popupTrigger, button); -java.awt.Toolkit.getEventQueue ().postEvent (e); -}, "~N,~N,~N,~N,~N,~N"); -Clazz_defineStatics (c$, -"MOUSE_LEFT", 16, -"MOUSE_MIDDLE", 8, -"MOUSE_RIGHT", 4, -"MOUSE_WHEEL", 32, -"MAC_COMMAND", 20, -"BUTTON_MASK", 28); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.awt.peer.LightweightPeer"], "swingjs.JSComponentPeer", ["swingjs.JSToolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.target = null; -this.ui = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSComponentPeer", null, java.awt.peer.LightweightPeer); -Clazz_makeConstructor (c$, -function (target) { -this.target = target; -this.ui = swingjs.JSToolkit.getUI (target, false); -}, "java.awt.Component"); -Clazz_overrideMethod (c$, "isObscured", -function () { -return false; -}); -Clazz_overrideMethod (c$, "canDetermineObscurity", -function () { -return false; -}); -Clazz_overrideMethod (c$, "setVisible", -function (b) { -}, "~B"); -Clazz_overrideMethod (c$, "setEnabled", -function (b) { -}, "~B"); -Clazz_overrideMethod (c$, "paint", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "repaint", -function (tm, x, y, width, height) { -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "print", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "setBounds", -function (x, y, width, height, op) { -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "handleEvent", -function (e) { -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "coalescePaintEvent", -function (e) { -}, "java.awt.event.PaintEvent"); -Clazz_overrideMethod (c$, "getLocationOnScreen", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getPreferredSize", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getMinimumSize", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getColorModel", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getToolkit", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getGraphics", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -return null; -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "dispose", -function () { -}); -Clazz_overrideMethod (c$, "setForeground", -function (c) { -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setBackground", -function (c) { -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setFont", -function (f) { -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "updateCursorImmediately", -function () { -}); -Clazz_overrideMethod (c$, "requestFocus", -function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { -return false; -}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); -Clazz_overrideMethod (c$, "isFocusable", -function () { -return false; -}); -Clazz_defineMethod (c$, "createImage", -function (producer) { -return null; -}, "java.awt.image.ImageProducer"); -Clazz_defineMethod (c$, "createImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "createVolatileImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "prepareImage", -function (img, w, h, o) { -return false; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "checkImage", -function (img, w, h, o) { -return 0; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "getGraphicsConfiguration", -function () { -return null; -}); -Clazz_overrideMethod (c$, "handlesWheelScrolling", -function () { -return false; -}); -Clazz_overrideMethod (c$, "getBackBuffer", -function () { -return null; -}); -Clazz_overrideMethod (c$, "destroyBuffers", -function () { -}); -Clazz_overrideMethod (c$, "reparent", -function (newContainer) { -}, "java.awt.peer.ContainerPeer"); -Clazz_overrideMethod (c$, "isReparentSupported", -function () { -return false; -}); -Clazz_overrideMethod (c$, "layout", -function () { -}); -Clazz_overrideMethod (c$, "getBounds", -function () { -return null; -}); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.awt.peer.FramePeer"], "swingjs.JSWindowPeer", ["java.lang.Thread", "java.awt.GraphicsEnvironment", "$.Insets", "$.Point", "$.Toolkit"], function () { -c$ = Clazz_decorateAsClass (function () { -this.window = null; -this.isFrame = false; -this.applet = null; -this.graphics = null; -this.font = null; -Clazz_instantialize (this, arguments); -}, swingjs, "JSWindowPeer", null, java.awt.peer.FramePeer); -Clazz_overrideMethod (c$, "setFrame", -function (target, isFrame) { -this.isFrame = isFrame; -this.window = target; -var jc = this; -jc.myThread = Thread.currentThread (); -jc.threadGroup = jc.myThread.getThreadGroup (); -this.applet = (jc.threadGroup).getHtmlApplet (); -this.graphics = (java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ()).createGraphicsSized (target, 500, 300); -return this; -}, "java.awt.Window,~B"); -Clazz_overrideMethod (c$, "getGraphics", -function () { -this.graphics.setFont (this.window.getFont ()); -return this.graphics; -}); -Clazz_overrideMethod (c$, "getToolkit", -function () { -return java.awt.Toolkit.getDefaultToolkit (); -}); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -if (!font.equals (this.font)) this.window.setFont (this.font = font); -return this.graphics.getFontMetrics (font); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "getInsets", -function () { -return new java.awt.Insets (0, 0, 0, 0); -}); -Clazz_overrideMethod (c$, "beginValidate", -function () { -}); -Clazz_overrideMethod (c$, "endValidate", -function () { -}); -Clazz_overrideMethod (c$, "beginLayout", -function () { -}); -Clazz_overrideMethod (c$, "endLayout", -function () { -}); -Clazz_overrideMethod (c$, "isObscured", -function () { -return false; -}); -Clazz_overrideMethod (c$, "canDetermineObscurity", -function () { -return false; -}); -Clazz_overrideMethod (c$, "setVisible", -function (b) { -}, "~B"); -Clazz_overrideMethod (c$, "setEnabled", -function (b) { -}, "~B"); -Clazz_overrideMethod (c$, "paint", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "repaint", -function (tm, x, y, width, height) { -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "print", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "setBounds", -function (x, y, width, height, op) { -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "handleEvent", -function (e) { -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "coalescePaintEvent", -function (e) { -}, "java.awt.event.PaintEvent"); -Clazz_overrideMethod (c$, "getLocationOnScreen", -function () { -return new java.awt.Point (); -}); -Clazz_overrideMethod (c$, "getPreferredSize", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getMinimumSize", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getColorModel", -function () { -return null; -}); -Clazz_overrideMethod (c$, "dispose", -function () { -}); -Clazz_overrideMethod (c$, "setForeground", -function (c) { -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setBackground", -function (c) { -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setFont", -function (f) { -this.font = f; -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "updateCursorImmediately", -function () { -}); -Clazz_overrideMethod (c$, "requestFocus", -function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { -return false; -}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); -Clazz_overrideMethod (c$, "isFocusable", -function () { -return false; -}); -Clazz_defineMethod (c$, "createImage", -function (producer) { -return null; -}, "java.awt.image.ImageProducer"); -Clazz_defineMethod (c$, "createImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "createVolatileImage", -function (width, height) { -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "prepareImage", -function (img, w, h, o) { -return false; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "checkImage", -function (img, w, h, o) { -return 0; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "getGraphicsConfiguration", -function () { -return null; -}); -Clazz_overrideMethod (c$, "handlesWheelScrolling", -function () { -return false; -}); -Clazz_overrideMethod (c$, "getBackBuffer", -function () { -return null; -}); -Clazz_overrideMethod (c$, "destroyBuffers", -function () { -}); -Clazz_overrideMethod (c$, "reparent", -function (newContainer) { -}, "java.awt.peer.ContainerPeer"); -Clazz_overrideMethod (c$, "isReparentSupported", -function () { -return false; -}); -Clazz_overrideMethod (c$, "layout", -function () { -}); -Clazz_overrideMethod (c$, "getBounds", -function () { -return null; -}); -Clazz_overrideMethod (c$, "toFront", -function () { -}); -Clazz_overrideMethod (c$, "toBack", -function () { -}); -Clazz_overrideMethod (c$, "updateAlwaysOnTopState", -function () { -}); -Clazz_overrideMethod (c$, "updateFocusableWindowState", -function () { -}); -Clazz_overrideMethod (c$, "requestWindowFocus", -function () { -return false; -}); -Clazz_overrideMethod (c$, "setModalBlocked", -function (blocker, blocked) { -}, "java.awt.Dialog,~B"); -Clazz_overrideMethod (c$, "updateMinimumSize", -function () { -}); -Clazz_overrideMethod (c$, "updateIconImages", -function () { -}); -Clazz_overrideMethod (c$, "setOpacity", -function (opacity) { -}, "~N"); -Clazz_overrideMethod (c$, "setOpaque", -function (isOpaque) { -}, "~B"); -Clazz_overrideMethod (c$, "updateWindow", -function (backBuffer) { -}, "java.awt.image.BufferedImage"); -Clazz_overrideMethod (c$, "repositionSecurityWarning", -function () { -}); -Clazz_overrideMethod (c$, "setTitle", -function (title) { -}, "~S"); -Clazz_overrideMethod (c$, "setMenuBar", -function (mb) { -}, "~O"); -Clazz_overrideMethod (c$, "setResizable", -function (resizeable) { -}, "~B"); -Clazz_overrideMethod (c$, "setState", -function (state) { -}, "~N"); -Clazz_overrideMethod (c$, "getState", -function () { -return 0; -}); -Clazz_overrideMethod (c$, "setMaximizedBounds", -function (bounds) { -}, "java.awt.Rectangle"); -Clazz_overrideMethod (c$, "setBoundsPrivate", -function (x, y, width, height) { -}, "~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "getBoundsPrivate", -function () { -return null; -}); -}); -Clazz_declarePackage ("swingjs"); -Clazz_load (["java.awt.GraphicsEnvironment"], "swingjs.JSGraphicsEnvironment", ["swingjs.JSGraphics2D", "$.JSToolkit", "swingjs.api.DOMNode"], function () { -c$ = Clazz_declareType (swingjs, "JSGraphicsEnvironment", java.awt.GraphicsEnvironment); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, swingjs.JSGraphicsEnvironment, []); -System.out.println ("JSGraphicsEnvironment initialized"); -}); -Clazz_overrideMethod (c$, "createGraphics", -function (img) { -return this.createGraphicsSized (img, img.getWidth (), img.getHeight ()); -}, "java.awt.image.BufferedImage"); -Clazz_defineMethod (c$, "createGraphicsSized", -function (img, width, height) { -var g = null; -{ -g = img._g; -}if (g == null) { -var canvas = swingjs.api.DOMNode.createElement ("canvas", "img" + System.currentTimeMillis ()); -{ -canvas.width = width; -canvas.height = height; -img._canvas = canvas; -}g = new swingjs.JSGraphics2D (canvas); -{ -img._g = g; -}}return g; -}, "~O,~N,~N"); -Clazz_overrideMethod (c$, "getAllFonts", -function () { -return null; -}); -Clazz_defineMethod (c$, "getAvailableFontFamilyNames", -function () { -return null; -}); -Clazz_defineMethod (c$, "getAvailableFontFamilyNames", -function (l) { -return null; -}, "java.util.Locale"); -Clazz_overrideMethod (c$, "getDefaultScreenDevice", -function () { -if (swingjs.JSGraphicsEnvironment.device == null) swingjs.JSGraphicsEnvironment.device = swingjs.JSToolkit.getInstance ("swingjs.JSScreenDevice"); -return swingjs.JSGraphicsEnvironment.device; -}); -Clazz_defineStatics (c$, -"device", null); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["javax.swing.LookAndFeel"], "swingjs.plaf.HTML5LookAndFeel", ["java.lang.Boolean", "$.Long", "java.awt.Color", "$.Dimension", "javax.swing.DefaultListCellRenderer", "$.UIDefaults", "javax.swing.UIDefaults.ActiveValue", "javax.swing.plaf.ColorUIResource", "$.DimensionUIResource", "$.FontUIResource", "$.InsetsUIResource"], function () { -c$ = Clazz_declareType (swingjs.plaf, "HTML5LookAndFeel", javax.swing.LookAndFeel); -Clazz_overrideMethod (c$, "getDefaults", -function () { -var table = new javax.swing.UIDefaults (610, 0.75); -this.initClassDefaults (table); -this.initSystemColorDefaults (table); -this.initComponentDefaults (table); -return table; -}); -Clazz_overrideMethod (c$, "initialize", -function () { -}); -Clazz_defineMethod (c$, "installAWTEventListener", -function () { -}); -Clazz_overrideMethod (c$, "uninitialize", -function () { -}); -Clazz_defineMethod (c$, "initClassDefaults", -function (table) { -var packageName = "swingjs.plaf."; -var uiDefaults = Clazz_newArray (-1, ["ButtonUI", "swingjs.plaf.JSButtonUI", "CheckBoxUI", "swingjs.plaf.JSCheckBoxUI", "ColorChooserUI", "swingjs.plaf.JSColorChooserUI", "FormattedTextFieldUI", "swingjs.plaf.JSFormattedTextFieldUI", "MenuBarUI", "swingjs.plaf.JSMenuBarUI", "MenuUI", "swingjs.plaf.JSMenuUI", "MenuItemUI", "swingjs.plaf.JSMenuItemUI", "CheckBoxMenuItemUI", "swingjs.plaf.JSCheckBoxMenuItemUI", "RadioButtonMenuItemUI", "swingjs.plaf.JSRadioButtonMenuItemUI", "RadioButtonUI", "swingjs.plaf.JSRadioButtonUI", "ToggleButtonUI", "swingjs.plaf.JSToggleButtonUI", "PopupMenuUI", "swingjs.plaf.JSPopupMenuUI", "ProgressBarUI", "swingjs.plaf.JSProgressBarUI", "ScrollBarUI", "swingjs.plaf.JSScrollBarUI", "ScrollPaneUI", "swingjs.plaf.JSScrollPaneUI", "SplitPaneUI", "swingjs.plaf.JSSplitPaneUI", "SliderUI", "swingjs.plaf.JSSliderUI", "SeparatorUI", "swingjs.plaf.JSSeparatorUI", "SpinnerUI", "swingjs.plaf.JSSpinnerUI", "ToolBarSeparatorUI", "swingjs.plaf.JSToolBarSeparatorUI", "PopupMenuSeparatorUI", "swingjs.plaf.JSPopupMenuSeparatorUI", "TabbedPaneUI", "swingjs.plaf.JSTabbedPaneUI", "TextAreaUI", "swingjs.plaf.JSTextAreaUI", "TextFieldUI", "swingjs.plaf.JSTextFieldUI", "PasswordFieldUI", "swingjs.plaf.JSPasswordFieldUI", "TextPaneUI", "swingjs.plaf.JSTextPaneUI", "EditorPaneUI", "swingjs.plaf.JSEditorPaneUI", "TreeUI", "swingjs.plaf.JSTreeUI", "LabelUI", "swingjs.plaf.JSLabelUI", "ListUI", "swingjs.plaf.JSListUI", "ToolBarUI", "swingjs.plaf.JSToolBarUI", "ToolTipUI", "swingjs.plaf.JSToolTipUI", "ComboBoxUI", "swingjs.plaf.JSComboBoxUI", "TableUI", "swingjs.plaf.JSTableUI", "TableHeaderUI", "swingjs.plaf.JSTableHeaderUI", "InternalFrameUI", "swingjs.plaf.JSInternalFrameUI", "DesktopPaneUI", "swingjs.plaf.JSDesktopPaneUI", "DesktopIconUI", "swingjs.plaf.JSDesktopIconUI", "OptionPaneUI", "swingjs.plaf.JSOptionPaneUI", "PanelUI", "swingjs.plaf.JSPanelUI", "ViewportUI", "swingjs.plaf.JSViewportUI", "RootPaneUI", "swingjs.plaf.JSRootPaneUI"]); -table.putDefaults (uiDefaults); -}, "javax.swing.UIDefaults"); -Clazz_defineMethod (c$, "initSystemColorDefaults", -function (table) { -var defaultSystemColors = Clazz_newArray (-1, ["window", "#FFFFFF", "windowText", "#333333", "menu", "#C0C0C0", "menuText", "#333333", "text", "#C0C0C0", "textText", "#333333", "control", "#EEEEEE", "controlText", "#333333", "scrollbar", "#E0E0E0", "info", "#FFFFE1", "infoText", "#000000"]); -this.loadSystemColors (table, defaultSystemColors, this.isNativeLookAndFeel ()); -}, "javax.swing.UIDefaults"); -Clazz_defineMethod (c$, "loadSystemColors", -function (table, systemColors, useNative) { -for (var i = 0; i < systemColors.length; i += 2) { -var color = java.awt.Color.black; -try { -color = java.awt.Color.decode (systemColors[i + 1]); -} catch (e) { -if (Clazz_exceptionOf (e, NumberFormatException)) { -e.printStackTrace (); -} else { -throw e; -} -} -table.put (systemColors[i], new javax.swing.plaf.ColorUIResource (color)); -} -}, "javax.swing.UIDefaults,~A,~B"); -Clazz_defineMethod (c$, "initResourceBundle", - function (table) { -}, "javax.swing.UIDefaults"); -Clazz_defineMethod (c$, "initComponentDefaults", -function (table) { -this.initResourceBundle (table); -var oneThousand = new Long (1000); -var twelve = new Integer (12); -var fontPlain = new Integer (0); -var serifPlain12 = new javax.swing.plaf.FontUIResource ("Serif", 0, 12); -var sansSerifPlain12 = new javax.swing.plaf.FontUIResource ("SansSerif", 0, 12); -var dialogPlain12 = new javax.swing.plaf.FontUIResource ("Dialog", 0, 12); -var monospacedPlain12 = new javax.swing.plaf.FontUIResource ("Monospaced", 0, 12); -var black = new javax.swing.plaf.ColorUIResource (java.awt.Color.black); -var white = new javax.swing.plaf.ColorUIResource (java.awt.Color.white); -var gray = new javax.swing.plaf.ColorUIResource (java.awt.Color.gray); -var darkGray = new javax.swing.plaf.ColorUIResource (java.awt.Color.darkGray); -var control = table.getColor ("control"); -var controlText = table.getColor ("controlText"); -var menu = table.getColor ("menu"); -var menuText = table.getColor ("menuText"); -var textText = table.getColor ("textText"); -var window = table.getColor ("window"); -var zeroInsets = new javax.swing.plaf.InsetsUIResource (0, 0, 0, 0); -var twoInsets = new javax.swing.plaf.InsetsUIResource (2, 2, 2, 2); -var threeInsets = new javax.swing.plaf.InsetsUIResource (3, 3, 3, 3); -var listCellRendererActiveValue = ((Clazz_isClassDefined ("swingjs.plaf.HTML5LookAndFeel$1") ? 0 : swingjs.plaf.HTML5LookAndFeel.$HTML5LookAndFeel$1$ ()), Clazz_innerTypeInstance (swingjs.plaf.HTML5LookAndFeel$1, this, null)); -var zero = new Integer (0); -var tabbedPaneTabInsets = new javax.swing.plaf.InsetsUIResource (0, 4, 1, 4); -var tabbedPaneTabPadInsets = new javax.swing.plaf.InsetsUIResource (2, 2, 2, 1); -var tabbedPaneTabAreaInsets = new javax.swing.plaf.InsetsUIResource (3, 2, 0, 2); -var tabbedPaneContentBorderInsets = new javax.swing.plaf.InsetsUIResource (2, 2, 3, 3); -var editorMargin = threeInsets; -var four = new Integer (4); -var defaults = Clazz_newArray (-1, ["*.font", dialogPlain12, "*.background", control, "*.foreground", controlText, "Button.margin", new javax.swing.plaf.InsetsUIResource (2, 14, 2, 14), "ToggleButton.margin", new javax.swing.plaf.InsetsUIResource (2, 14, 2, 14), "ToggleButton.textIconGap", four, "ToggleButton.textShiftOffset", zero, "RadioButton.margin", twoInsets, "RadioButton.textIconGap", four, "RadioButton.textShiftOffset", zero, "CheckBox.margin", twoInsets, "CheckBox.textIconGap", four, "CheckBox.textShiftOffset", zero, "ColorChooser.swatchesSwatchSize", new java.awt.Dimension (10, 10), "ColorChooser.swatchesRecentSwatchSize", new java.awt.Dimension (10, 10), "ColorChooser.swatchesDefaultRecentColor", control, "ComboBox.font", sansSerifPlain12, "ComboBox.background", window, "ComboBox.foreground", textText, "ComboBox.timeFactor", oneThousand, "ComboBox.isEnterSelectablePopup", Boolean.FALSE, "FileChooser.readOnly", Boolean.FALSE, "Label.border", null, "List.background", window, "List.foreground", textText, "List.cellRenderer", listCellRendererActiveValue, "List.timeFactor", oneThousand, "MenuBar.font", dialogPlain12, "MenuBar.background", menu, "MenuBar.foreground", menuText, "MenuItem.font", dialogPlain12, "MenuItem.background", menu, "MenuItem.foreground", menuText, "MenuItem.margin", twoInsets, "RadioButtonMenuItem.font", dialogPlain12, "RadioButtonMenuItem.background", menu, "RadioButtonMenuItem.foreground", menuText, "RadioButtonMenuItem.margin", twoInsets, "CheckBoxMenuItem.font", dialogPlain12, "CheckBoxMenuItem.background", menu, "CheckBoxMenuItem.foreground", menuText, "CheckBoxMenuItem.margin", twoInsets, "Menu.background", menu, "Menu.foreground", menuText, "Menu.margin", twoInsets, "PopupMenu.background", menu, "PopupMenu.foreground", menuText, "PopupMenu.consumeEventOnClose", Boolean.FALSE, "OptionPane.messageForeground", controlText, "Panel.font", dialogPlain12, "Panel.background", control, "Panel.foreground", textText, "ProgressBar.cellLength", new Integer (1), "ProgressBar.cellSpacing", zero, "ProgressBar.repaintInterval", new Integer (50), "ProgressBar.cycleTime", new Integer (3000), "ProgressBar.horizontalSize", new javax.swing.plaf.DimensionUIResource (146, 12), "ProgressBar.verticalSize", new javax.swing.plaf.DimensionUIResource (12, 146), "ScrollBar.foreground", control, "ScrollBar.width", new Integer (16), "Viewport.foreground", textText, "Slider.horizontalSize", new java.awt.Dimension (200, 21), "Slider.verticalSize", new java.awt.Dimension (21, 200), "Slider.minimumHorizontalSize", new java.awt.Dimension (36, 21), "Slider.minimumVerticalSize", new java.awt.Dimension (21, 36), "Spinner.font", monospacedPlain12, "Spinner.arrowButtonSize", new java.awt.Dimension (16, 5), "Spinner.editorAlignment", new Integer (11), "SplitPane.background", control, "SplitPane.dividerSize", new Integer (7), "SplitPaneDivider.draggingColor", darkGray, "TabbedPane.selected", null, "TabbedPane.textIconGap", four, "TabbedPane.tabsOverlapBorder", Boolean.FALSE, "TabbedPane.labelShift", new Integer (1), "TabbedPane.selectedLabelShift", new Integer (-1), "TabbedPane.tabInsets", tabbedPaneTabInsets, "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets, "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets, "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets, "TabbedPane.tabRunOverlay", new Integer (2), "Table.background", window, "Table.dropLineShortColor", black, "Table.gridColor", gray, "Table.focusCellBackground", window, "Table.focusCellForeground", controlText, "TextField.font", sansSerifPlain12, "TextField.background", window, "TextField.foreground", textText, "TextField.margin", zeroInsets, "FormattedTextField.font", sansSerifPlain12, "FormattedTextField.background", window, "FormattedTextField.foreground", textText, "FormattedTextField.caretForeground", textText, "FormattedTextField.margin", zeroInsets, "PasswordField.font", monospacedPlain12, "PasswordField.background", window, "PasswordField.foreground", textText, "PasswordField.margin", zeroInsets, "PasswordField.echoChar", new Character ('*'), "TextArea.font", monospacedPlain12, "TextArea.background", window, "TextArea.foreground", textText, "TextArea.margin", zeroInsets, "TextPane.font", serifPlain12, "TextPane.background", white, "TextPane.foreground", textText, "TextPane.margin", editorMargin, "EditorPane.font", serifPlain12, "EditorPane.background", white, "EditorPane.foreground", textText, "EditorPane.margin", editorMargin, "TitledBorder.titleColor", controlText, "Tree.paintLines", Boolean.TRUE, "Tree.lineTypeDashed", Boolean.FALSE, "Tree.background", window, "Tree.foreground", textText, "Tree.hash", gray, "Tree.textForeground", textText, "Tree.textBackground", table.get ("text"), "Tree.leftChildIndent", new Integer (7), "Tree.rightChildIndent", new Integer (13), "Tree.rowHeight", new Integer (16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.timeFactor", oneThousand]); -table.putDefaults (defaults); -}, "javax.swing.UIDefaults"); -Clazz_overrideMethod (c$, "getName", -function () { -return "SwingJS"; -}); -Clazz_overrideMethod (c$, "getID", -function () { -return "SwingJS"; -}); -Clazz_overrideMethod (c$, "getDescription", -function () { -return "SwingJS L&F"; -}); -Clazz_overrideMethod (c$, "isNativeLookAndFeel", -function () { -return true; -}); -Clazz_overrideMethod (c$, "isSupportedLookAndFeel", -function () { -return true; -}); -c$.$HTML5LookAndFeel$1$ = function () { -Clazz_pu$h(self.c$); -c$ = Clazz_declareAnonymous (swingjs.plaf, "HTML5LookAndFeel$1", null, javax.swing.UIDefaults.ActiveValue); -Clazz_overrideMethod (c$, "createValue", -function (table) { -return new javax.swing.DefaultListCellRenderer.UIResource (); -}, "javax.swing.UIDefaults"); -c$ = Clazz_p0p (); -}; -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["javax.swing.plaf.ComponentUI", "swingjs.plaf.JSEventHandler"], "swingjs.plaf.JSComponentUI", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Color", "$.Component", "$.Dimension", "$.Point", "$.Toolkit", "java.awt.event.FocusEvent", "swingjs.JSToolkit", "swingjs.api.DOMNode"], function () { -c$ = Clazz_decorateAsClass (function () { -this.id = null; -this.c = null; -this.outerNode = null; -this.domNode = null; -this.enableNode = null; -this.textNode = null; -this.valueNode = null; -this.scrollNode = null; -this.focusNode = null; -this.components = null; -this.num = 0; -this.isTainted = true; -this.x = 0; -this.y = 0; -this.preferredSize = null; -this.isContainer = false; -this.parent = null; -this.currentText = null; -this.scrollerNode = null; -this.classID = null; -this.document = null; -this.body = null; -this.needPreferred = false; -Clazz_instantialize (this, arguments); -}, swingjs.plaf, "JSComponentUI", javax.swing.plaf.ComponentUI, swingjs.plaf.JSEventHandler); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, swingjs.plaf.JSComponentUI, []); -this.setDoc (); -}); -Clazz_defineMethod (c$, "setDoc", -function () { -{ -this.document = document; -this.body = document.body; -}}); -Clazz_overrideMethod (c$, "installUI", -function (c) { -}, "javax.swing.JComponent"); -Clazz_overrideMethod (c$, "uninstallUI", -function (c) { -this.uninstallJSUI (); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "$", -function (node) { -return swingjs.JSToolkit.getJQuery ().$ (node); -}, "swingjs.api.DOMNode"); -Clazz_defineMethod (c$, "setTainted", -function () { -this.isTainted = true; -}); -Clazz_defineMethod (c$, "set", -function (target) { -this.c = target; -this.newID (); -if (this.needPreferred) this.getPreferredSize (this.c); -this.installJSUI (); -return this; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "newID", -function () { -this.classID = this.c.getUIClassID (); -if (this.id == null) { -this.num = ++swingjs.plaf.JSComponentUI.incr; -this.id = this.c.getHTMLName (this.classID) + "_" + this.num; -}}); -Clazz_defineMethod (c$, "setCssFont", -function (obj, font) { -if (font != null) { -var istyle = font.getStyle (); -var name = font.getFamily (); -if (name === "Dialog") name = "Arial"; -swingjs.api.DOMNode.setStyles (obj, ["font-family", name, "font-size", font.getSize () + "px", "font-style", ((istyle & 2) == 0 ? "normal" : "italic"), "font-weight", ((istyle & 1) == 0 ? "normal" : "bold")]); -}if (this.c.isBackgroundSet ()) this.setBackground (this.c.getBackground ()); -this.setForeground (this.c.getForeground ()); -return obj; -}, "swingjs.api.DOMNode,java.awt.Font"); -Clazz_defineMethod (c$, "createDOMObject", -function (key, id, attr) { -var obj = swingjs.api.DOMNode.createElement (key, id); -for (var i = 0; i < attr.length; ) swingjs.api.DOMNode.setAttr (obj, attr[i++], attr[i++]); - -if (!this.c.isEnabled ()) this.setEnabled (false); -return obj; -}, "~S,~S,~A"); -Clazz_defineMethod (c$, "bindMouse", -function (node) { -swingjs.api.DOMNode.setAttr (node, "data-UI", this); -}, "swingjs.api.DOMNode"); -Clazz_overrideMethod (c$, "handleJSEvent", -function (target, eventType, jQueryEvent) { -return false; -}, "~O,~N,~O"); -Clazz_defineMethod (c$, "wrap", -function (type, id, elements) { -return this.append (this.createDOMObject (type, id + type, []), elements); -}, "~S,~S,~A"); -Clazz_defineMethod (c$, "append", -function (obj, elements) { -for (var i = 0; i < elements.length; i++) { -obj.appendChild (elements[i]); -} -return obj; -}, "swingjs.api.DOMNode,~A"); -Clazz_defineMethod (c$, "debugDump", -function (d) { -System.out.println (swingjs.api.DOMNode.getAttr (d, "outerHTML")); -}, "swingjs.api.DOMNode"); -c$.vCenter = Clazz_defineMethod (c$, "vCenter", -function (obj, offset) { -swingjs.api.DOMNode.setStyles (obj, ["top", "50%", "transform", "translateY(" + offset + "%)"]); -}, "swingjs.api.DOMNode,~N"); -Clazz_defineMethod (c$, "setHTMLSize", -function (obj, addCSS) { -return this.setHTMLSize1 (obj, addCSS, true); -}, "swingjs.api.DOMNode,~B"); -Clazz_defineMethod (c$, "setHTMLSize1", -function (node, addCSS, usePreferred) { -if (node == null) return null; -var h; -var w; -var w0 = null; -var h0 = null; -var parentNode = null; -if (this.scrollerNode != null) { -w = this.scrollerNode.c.getWidth (); -h = this.scrollerNode.c.getHeight (); -} else if (usePreferred && this.preferredSize != null) { -w = this.preferredSize.width; -h = this.preferredSize.height; -} else { -parentNode = swingjs.api.DOMNode.remove (node); -{ -w0 = node.style.width; -h0 = node.style.height; -}swingjs.api.DOMNode.setStyles (node, ["position", null, "width", null, "height", null]); -var div; -if (swingjs.api.DOMNode.getAttr (node, "tagName") === "DIV") div = node; - else div = this.wrap ("div", this.id + "_temp", [node]); -swingjs.api.DOMNode.setStyles (div, ["position", "absolute"]); -this.body.appendChild (div); -w = Clazz_doubleToInt (Math.ceil (this.$ (div).width () + 0.5)); -h = Clazz_doubleToInt (Math.ceil (this.$ (div).height () + 0.5)); -this.body.removeChild (div); -}var size = this.getCSSDimension (w, h); -if (addCSS) { -swingjs.api.DOMNode.setStyles (node, ["position", "absolute"]); -swingjs.api.DOMNode.setSize (node, size.width, size.height); -} else { -swingjs.api.DOMNode.setStyles (node, ["position", null]); -if (w0 != null) swingjs.api.DOMNode.setStyles (node, ["width", w0, "height", h0]); -}if (parentNode != null) parentNode.appendChild (node); -return size; -}, "swingjs.api.DOMNode,~B,~B"); -Clazz_defineMethod (c$, "getCSSDimension", -function (w, h) { -return new java.awt.Dimension (w, h); -}, "~N,~N"); -Clazz_defineMethod (c$, "setHTMLElement", -function () { -if (!this.isTainted) return this.outerNode; -var root = (this.isContainer ? this.c.getRootPane () : null); -if (this.c === root) { -this.isTainted = false; -return this.outerNode; -}this.domNode = this.getDOMObject (); -if (this.outerNode == null) { -this.outerNode = this.wrap ("div", this.id, [this.domNode]); -if (root != null && root.getContentPane () === this.c) swingjs.JSToolkit.getHTML5Applet (this.c)._getContentLayer ().appendChild (this.outerNode); -}swingjs.api.DOMNode.setStyles (this.outerNode, ["position", "absolute", "left", (this.x = this.c.getX ()) + "px", "top", (this.y = this.c.getY ()) + "px"]); -if (this.isContainer) { -System.out.println ("JSComponentUI container " + this.id + " " + this.c.getBounds ()); -swingjs.api.DOMNode.setSize (this.outerNode, this.c.getWidth (), this.c.getHeight ()); -var children = (this.components == null ? this.c.getComponents () : this.components); -for (var i = children.length; --i >= 0; ) { -var ui = swingjs.JSToolkit.getUI (children[i], false); -if (ui == null) { -continue; -}if (ui.outerNode == null) ui.setHTMLElement (); -if (ui.outerNode == null) { -System.out.println ("JSCUI could not add " + ui.c.getName () + " to " + this.c.getName ()); -} else { -this.outerNode.appendChild (ui.outerNode); -}ui.parent = this; -} -}this.isTainted = false; -return this.outerNode; -}); -Clazz_defineMethod (c$, "getPreferredSize", -function (c) { -var d = this.setHTMLSize (this.getDOMObject (), false); -return d; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "paint", -function (g, c) { -if (c.isOpaque ()) { -g.setColor (c.getBackground ()); -g.fillRect (0, 0, c.getWidth (), c.getHeight ()); -}}, "java.awt.Graphics,javax.swing.JComponent"); -Clazz_overrideMethod (c$, "update", -function (g, c) { -var testing = false; -if (testing) { -g.setColor (java.awt.Color.red); -g.drawRect (0, 0, c.getWidth (), c.getHeight ()); -System.out.println ("drawing " + c.getWidth () + " " + c.getHeight ()); -}this.setHTMLElement (); -this.paint (g, c); -}, "java.awt.Graphics,javax.swing.JComponent"); -Clazz_defineMethod (c$, "getMinimumSize", -function (c) { -return this.getPreferredSize (c); -}, "javax.swing.JComponent"); -Clazz_overrideMethod (c$, "getMaximumSize", -function (c) { -return null; -}, "javax.swing.JComponent"); -Clazz_overrideMethod (c$, "contains", -function (c, x, y) { -return c.inside (x, y); -}, "javax.swing.JComponent,~N,~N"); -c$.createUI = Clazz_overrideMethod (c$, "createUI", -function (c) { -return null; -}, "javax.swing.JComponent"); -Clazz_overrideMethod (c$, "getBaseline", -function (c, width, height) { -if (c == null) { -throw new NullPointerException ("Component must be non-null"); -}if (width < 0 || height < 0) { -throw new IllegalArgumentException ("Width and height must be >= 0"); -}return -1; -}, "javax.swing.JComponent,~N,~N"); -Clazz_overrideMethod (c$, "getBaselineResizeBehavior", -function (c) { -if (c == null) { -throw new NullPointerException ("Component must be non-null"); -}return java.awt.Component.BaselineResizeBehavior.OTHER; -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "getJSTextValue", -function () { -return swingjs.api.DOMNode.getAttr (this.domNode, this.valueNode == null ? "innerHTML" : "value"); -}); -Clazz_defineMethod (c$, "notifyPropertyChanged", -function (prop) { -var obj = null; -var val = null; -if (prop === "text") { -val = (this.c).getText (); -if (val.equals (this.currentText)) return; -this.currentText = val; -if (this.textNode != null) { -prop = "innerHTML"; -obj = this.textNode; -} else if (this.valueNode != null) { -prop = "value"; -obj = this.valueNode; -}} else if (prop === "preferredSize") { -this.preferredSize = this.c.getPreferredSize (); -this.getPreferredSize (); -return; -}if (obj == null) { -System.out.println ("JSComponentUI: unrecognized prop: " + prop); -} else { -System.out.println ("JSComponentUI: setting " + this.id + " " + prop); -this.setProp (obj, prop, val); -}}, "~S"); -Clazz_defineMethod (c$, "setProp", -function (obj, prop, val) { -return swingjs.api.DOMNode.setAttr (obj, prop, val); -}, "swingjs.api.DOMNode,~S,~S"); -Clazz_overrideMethod (c$, "isObscured", -function () { -swingjs.JSToolkit.notImplemented (""); -return false; -}); -Clazz_overrideMethod (c$, "canDetermineObscurity", -function () { -swingjs.JSToolkit.notImplemented (""); -return false; -}); -Clazz_overrideMethod (c$, "setVisible", -function (b) { -swingjs.api.DOMNode.setStyles (this.outerNode, ["display", b ? "block" : "none"]); -}, "~B"); -Clazz_overrideMethod (c$, "setEnabled", -function (b) { -if (this.enableNode != null) swingjs.api.DOMNode.setAttr (this.enableNode, "disabled", (b ? null : "TRUE")); -}, "~B"); -Clazz_defineMethod (c$, "paint", -function (g) { -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "repaint", -function (tm, x, y, width, height) { -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "print", -function (g) { -swingjs.JSToolkit.notImplemented (""); -}, "java.awt.Graphics"); -Clazz_overrideMethod (c$, "setBounds", -function (x, y, width, height, op) { -switch (op) { -case 2: -case 3: -case 4: -if (this.scrollerNode != null) { -width = Math.min (width, this.scrollerNode.c.getWidth ()); -height = Math.min (height, this.scrollerNode.c.getHeight ()); -}System.out.println (this.id + " setBounds " + x + " " + y + " " + width + " " + height + " op=" + op); -if (this.domNode != null) swingjs.api.DOMNode.setSize (this.domNode, width, height); -break; -} -}, "~N,~N,~N,~N,~N"); -Clazz_overrideMethod (c$, "handleEvent", -function (e) { -swingjs.JSToolkit.notImplemented (""); -}, "java.awt.AWTEvent"); -Clazz_overrideMethod (c$, "coalescePaintEvent", -function (e) { -swingjs.JSToolkit.notImplemented (""); -}, "java.awt.event.PaintEvent"); -Clazz_overrideMethod (c$, "getLocationOnScreen", -function () { -var offset = this.$ (this.outerNode).offset (); -return new java.awt.Point (offset.left, offset.top); -}); -Clazz_defineMethod (c$, "getPreferredSize", -function () { -return this.getPreferredSize (this.c); -}); -Clazz_defineMethod (c$, "getMinimumSize", -function () { -swingjs.JSToolkit.notImplemented (""); -return this.getPreferredSize (this.c); -}); -Clazz_overrideMethod (c$, "getColorModel", -function () { -return java.awt.Toolkit.getDefaultToolkit ().getColorModel (); -}); -Clazz_overrideMethod (c$, "getToolkit", -function () { -return java.awt.Toolkit.getDefaultToolkit (); -}); -Clazz_overrideMethod (c$, "getGraphics", -function () { -return null; -}); -Clazz_overrideMethod (c$, "getFontMetrics", -function (font) { -return this.c.getFontMetrics (font); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "dispose", -function () { -swingjs.JSToolkit.notImplemented (""); -}); -Clazz_overrideMethod (c$, "setForeground", -function (color) { -if (this.domNode != null) swingjs.api.DOMNode.setStyles (this.domNode, ["color", swingjs.JSToolkit.getCSSColor (color == null ? java.awt.Color.black : color)]); -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setBackground", -function (color) { -if (this.domNode != null) swingjs.api.DOMNode.setStyles (this.domNode, ["background-color", swingjs.JSToolkit.getCSSColor (color == null ? java.awt.Color.white : color)]); -}, "java.awt.Color"); -Clazz_overrideMethod (c$, "setFont", -function (f) { -if (this.domNode != null) this.setCssFont (this.domNode, f); -}, "java.awt.Font"); -Clazz_overrideMethod (c$, "updateCursorImmediately", -function () { -swingjs.JSToolkit.notImplemented (""); -}); -Clazz_overrideMethod (c$, "requestFocus", -function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { -if (this.focusNode == null) return false; -this.$ (this.focusNode).focus (); -if (this.textNode != null) this.$ (this.textNode).select (); -return true; -}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); -Clazz_overrideMethod (c$, "isFocusable", -function () { -return (this.focusNode != null); -}); -Clazz_defineMethod (c$, "createImage", -function (producer) { -swingjs.JSToolkit.notImplemented (""); -return null; -}, "java.awt.image.ImageProducer"); -Clazz_defineMethod (c$, "createImage", -function (width, height) { -swingjs.JSToolkit.notImplemented (""); -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "createVolatileImage", -function (width, height) { -swingjs.JSToolkit.notImplemented (""); -return null; -}, "~N,~N"); -Clazz_overrideMethod (c$, "prepareImage", -function (img, w, h, o) { -swingjs.JSToolkit.notImplemented (""); -return false; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "checkImage", -function (img, w, h, o) { -swingjs.JSToolkit.notImplemented (""); -return 0; -}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); -Clazz_overrideMethod (c$, "getGraphicsConfiguration", -function () { -swingjs.JSToolkit.notImplemented (""); -return null; -}); -Clazz_overrideMethod (c$, "handlesWheelScrolling", -function () { -swingjs.JSToolkit.notImplemented (""); -return false; -}); -Clazz_overrideMethod (c$, "getBackBuffer", -function () { -swingjs.JSToolkit.notImplemented (""); -return null; -}); -Clazz_overrideMethod (c$, "destroyBuffers", -function () { -swingjs.JSToolkit.notImplemented (""); -}); -Clazz_overrideMethod (c$, "reparent", -function (newContainer) { -swingjs.JSToolkit.notImplemented (""); -}, "java.awt.peer.ContainerPeer"); -Clazz_overrideMethod (c$, "isReparentSupported", -function () { -swingjs.JSToolkit.notImplemented (""); -return false; -}); -Clazz_overrideMethod (c$, "layout", -function () { -swingjs.JSToolkit.notImplemented (""); -}); -Clazz_overrideMethod (c$, "getBounds", -function () { -swingjs.JSToolkit.notImplemented (""); -return null; -}); -Clazz_defineMethod (c$, "hasFocus", -function () { -return this.focusNode != null && this.focusNode === swingjs.api.DOMNode.getAttr (this.document, "activeElement"); -}); -Clazz_defineMethod (c$, "notifyFocus", -function (focusGained) { -java.awt.Toolkit.getEventQueue ().postEvent ( new java.awt.event.FocusEvent (this.c, focusGained ? 1004 : 1005)); -}, "~B"); -Clazz_defineStatics (c$, -"incr", 0); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSPanelUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () { -c$ = Clazz_declareType (swingjs.plaf, "JSPanelUI", swingjs.plaf.JSComponentUI); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, swingjs.plaf.JSPanelUI, []); -this.isContainer = true; -this.setDoc (); -}); -Clazz_overrideMethod (c$, "getDOMObject", -function () { -if (this.domNode == null) this.domNode = this.createDOMObject ("label", this.id, []); -return this.domNode; -}); -Clazz_overrideMethod (c$, "setHTMLSize", -function (obj, addCSS) { -return new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ()); -}, "swingjs.api.DOMNode,~B"); -Clazz_defineMethod (c$, "getPreferredSize", -function (c) { -return null; -}, "javax.swing.JComponent"); -Clazz_overrideMethod (c$, "installJSUI", -function () { -javax.swing.LookAndFeel.installColorsAndFont (this.c, "Panel.background", "Panel.foreground", "Panel.font"); -}); -Clazz_overrideMethod (c$, "uninstallJSUI", -function () { -}); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSRadioButtonUI", ["java.util.HashMap", "javax.swing.DefaultButtonModel", "swingjs.api.DOMNode"], function () { -c$ = Clazz_decorateAsClass (function () { -this.label = null; -Clazz_instantialize (this, arguments); -}, swingjs.plaf, "JSRadioButtonUI", swingjs.plaf.JSButtonUI); -Clazz_overrideMethod (c$, "getDOMObject", -function () { -return this.getButtonObject ("radio"); -}); -Clazz_overrideMethod (c$, "getPropertyPrefix", -function () { -return "RadioButton."; -}); -Clazz_overrideMethod (c$, "setHTMLSize", -function (obj, addCSS) { -swingjs.api.DOMNode.setStyles (this.domBtn, ["position", null]); -swingjs.api.DOMNode.setStyles (this.label, ["position", null]); -var d = this.setHTMLSize1 (obj, addCSS, false); -swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); -swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute"]); -return d; -}, "swingjs.api.DOMNode,~B"); -Clazz_defineMethod (c$, "getButtonObject", -function (myType) { -var b = this.c; -var isNew = false; -var doAll = false; -if (this.domNode == null) { -doAll = true; -if (swingjs.plaf.JSRadioButtonUI.groupNames == null) swingjs.plaf.JSRadioButtonUI.groupNames = new java.util.HashMap (); -var bg = null; -var name = this.id; -isNew = true; -if (Clazz_instanceOf (b.getModel (), javax.swing.DefaultButtonModel)) { -bg = (b.getModel ()).getGroup (); -name = swingjs.plaf.JSRadioButtonUI.groupNames.get (bg); -if (name == null) swingjs.plaf.JSRadioButtonUI.groupNames.put (bg, name = this.id); - else isNew = false; -}this.domBtn = this.enableNode = this.createDOMObject ("input", this.id, ["type", myType, "name", name]); -this.label = this.textNode = this.createDOMObject ("label", this.id + "l", ["htmlFor", this.id]); -}if (b.isSelected () || isNew) swingjs.api.DOMNode.setAttr (this.domBtn, "checked", "true"); -this.setCssFont (swingjs.api.DOMNode.setAttr (this.label, "innerHTML", (this.c).getText ()), this.c.getFont ()); -var drad = this.setHTMLSize1 (this.domBtn, false, false); -this.setHTMLSize1 (this.label, false, false); -var obj = this.wrap ("div", "", [this.domBtn, this.label]); -var dobj = this.setHTMLSize1 (obj, true, true); -swingjs.plaf.JSComponentUI.vCenter (this.domBtn, -75); -swingjs.plaf.JSComponentUI.vCenter (this.label, -50); -swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute", "left", drad.width + "px"]); -swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); -if (doAll) { -obj = this.wrap ("div", this.id + "_0", [this.domBtn, this.label]); -swingjs.api.DOMNode.setStyles (obj, ["position", "absolute"]); -} else { -obj = this.domNode; -obj.appendChild (this.domBtn); -obj.appendChild (this.label); -}return swingjs.api.DOMNode.setSize (obj, dobj.width, dobj.height); -}, "~S"); -Clazz_defineStatics (c$, -"groupNames", null); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSRootPaneUI", null, function () { -c$ = Clazz_declareType (swingjs.plaf, "JSRootPaneUI", swingjs.plaf.JSComponentUI); -Clazz_makeConstructor (c$, -function () { -Clazz_superConstructor (this, swingjs.plaf.JSRootPaneUI, []); -this.isContainer = true; -this.setDoc (); -}); -Clazz_overrideMethod (c$, "getDOMObject", -function () { -return null; -}); -Clazz_overrideMethod (c$, "installJSUI", -function () { -}); -Clazz_overrideMethod (c$, "uninstallJSUI", -function () { -}); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["java.awt.event.FocusListener", "$.MouseListener", "$.MouseMotionListener", "java.beans.PropertyChangeListener", "javax.swing.event.ChangeListener", "jssun.swing.UIAction"], "swingjs.plaf.JSButtonListener", ["javax.swing.AbstractButton", "$.KeyStroke", "$.SwingUtilities", "javax.swing.plaf.ComponentInputMapUIResource", "swingjs.plaf.LazyActionMap"], function () { -c$ = Clazz_decorateAsClass (function () { -this.lastPressedTimestamp = -1; -this.shouldDiscardRelease = false; -this.btn = null; -Clazz_instantialize (this, arguments); -}, swingjs.plaf, "JSButtonListener", null, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.FocusListener, javax.swing.event.ChangeListener, java.beans.PropertyChangeListener]); -c$.loadActionMap = Clazz_defineMethod (c$, "loadActionMap", -function (map) { -map.put ( new swingjs.plaf.JSButtonListener.Actions ("pressed")); -map.put ( new swingjs.plaf.JSButtonListener.Actions ("released")); -}, "swingjs.plaf.LazyActionMap"); -Clazz_makeConstructor (c$, -function (b) { -this.btn = b; -}, "javax.swing.AbstractButton"); -Clazz_overrideMethod (c$, "propertyChange", -function (e) { -var prop = e.getPropertyName (); -if (prop === "mnemonic") { -this.updateMnemonicBinding (e.getSource ()); -} else if (prop === "contentAreaFilled") { -this.checkOpacity (e.getSource ()); -} else if (prop === "text" || "font" === prop || "foreground" === prop) { -var b = e.getSource (); -(b.getUI ()).notifyPropertyChanged (prop); -}}, "java.beans.PropertyChangeEvent"); -Clazz_defineMethod (c$, "checkOpacity", -function (b) { -b.setOpaque (b.isContentAreaFilled ()); -}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "installKeyboardActions", -function (c) { -var b = c; -this.updateMnemonicBinding (b); -swingjs.plaf.LazyActionMap.installLazyActionMap (c, swingjs.plaf.JSButtonListener, "Button.actionMap"); -var km = this.getInputMap (0, c); -javax.swing.SwingUtilities.replaceUIInputMap (c, 0, km); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "uninstallKeyboardActions", -function (c) { -javax.swing.SwingUtilities.replaceUIInputMap (c, 2, null); -javax.swing.SwingUtilities.replaceUIInputMap (c, 0, null); -javax.swing.SwingUtilities.replaceUIActionMap (c, null); -}, "javax.swing.JComponent"); -Clazz_defineMethod (c$, "getInputMap", -function (condition, c) { -return null; -}, "~N,javax.swing.JComponent"); -Clazz_defineMethod (c$, "updateMnemonicBinding", -function (b) { -var m = b.getMnemonic (); -if (m != 0) { -var map = javax.swing.SwingUtilities.getUIInputMap (b, 2); -if (map == null) { -map = new javax.swing.plaf.ComponentInputMapUIResource (b); -javax.swing.SwingUtilities.replaceUIInputMap (b, 2, map); -}map.clear (); -map.put (javax.swing.KeyStroke.getKeyStroke (m, 8, false), "pressed"); -map.put (javax.swing.KeyStroke.getKeyStroke (m, 8, true), "released"); -map.put (javax.swing.KeyStroke.getKeyStroke (m, 0, true), "released"); -} else { -var map = javax.swing.SwingUtilities.getUIInputMap (b, 2); -if (map != null) { -map.clear (); -}}}, "javax.swing.AbstractButton"); -Clazz_overrideMethod (c$, "stateChanged", -function (e) { -var b = e.getSource (); -b.repaint (); -}, "javax.swing.event.ChangeEvent"); -Clazz_overrideMethod (c$, "focusGained", -function (e) { -}, "java.awt.event.FocusEvent"); -Clazz_overrideMethod (c$, "focusLost", -function (e) { -var b = e.getSource (); -var model = b.getModel (); -model.setArmed (false); -model.setPressed (false); -}, "java.awt.event.FocusEvent"); -Clazz_overrideMethod (c$, "mouseMoved", -function (e) { -}, "java.awt.event.MouseEvent"); -Clazz_overrideMethod (c$, "mouseDragged", -function (e) { -}, "java.awt.event.MouseEvent"); -Clazz_overrideMethod (c$, "mouseClicked", -function (e) { -}, "java.awt.event.MouseEvent"); -Clazz_overrideMethod (c$, "mousePressed", -function (e) { -if (javax.swing.SwingUtilities.isLeftMouseButton (e)) { -var b = e.getSource (); -if (!b.contains (e.getX (), e.getY ())) return; -(b.getUI ()).verifyButtonClick (false); -var multiClickThreshhold = b.getMultiClickThreshhold (); -var lastTime = this.lastPressedTimestamp; -var currentTime = this.lastPressedTimestamp = e.getWhen (); -if (lastTime != -1 && currentTime - lastTime < multiClickThreshhold) { -this.shouldDiscardRelease = true; -return; -}var model = b.getModel (); -if (!model.isEnabled ()) { -return; -}if (!model.isArmed ()) { -model.setArmed (true); -}model.setPressed (true); -if (!b.hasFocus () && b.isRequestFocusEnabled ()) { -b.requestFocus (); -}}}, "java.awt.event.MouseEvent"); -Clazz_overrideMethod (c$, "mouseReleased", -function (e) { -if (javax.swing.SwingUtilities.isLeftMouseButton (e)) { -if (this.shouldDiscardRelease) { -this.shouldDiscardRelease = false; -return; -}var b = e.getSource (); -if (!(b.getUI ()).verifyButtonClick (true)) return; -var model = b.getModel (); -model.setPressed (false); -model.setArmed (false); -}}, "java.awt.event.MouseEvent"); -Clazz_overrideMethod (c$, "mouseEntered", -function (e) { -var b = e.getSource (); -var model = b.getModel (); -if (b.isRolloverEnabled () && !javax.swing.SwingUtilities.isLeftMouseButton (e)) { -model.setRollover (true); -}if (model.isPressed ()) model.setArmed (true); -}, "java.awt.event.MouseEvent"); -Clazz_overrideMethod (c$, "mouseExited", -function (e) { -var b = e.getSource (); -var model = b.getModel (); -if (b.isRolloverEnabled ()) { -model.setRollover (false); -}model.setArmed (false); -}, "java.awt.event.MouseEvent"); -Clazz_pu$h(self.c$); -c$ = Clazz_declareType (swingjs.plaf.JSButtonListener, "Actions", jssun.swing.UIAction); -Clazz_overrideMethod (c$, "actionPerformed", -function (a) { -var b = a.getSource (); -var c = this.getName (); -if (c === "pressed") { -var d = b.getModel (); -d.setArmed (true); -d.setPressed (true); -if (!b.hasFocus ()) { -b.requestFocus (); -}} else if (c === "released") { -var d = b.getModel (); -d.setPressed (false); -d.setArmed (false); -}}, "java.awt.event.ActionEvent"); -Clazz_defineMethod (c$, "isEnabled", -function (a) { -if (a != null && (Clazz_instanceOf (a, javax.swing.AbstractButton)) && !(a).getModel ().isEnabled ()) { -return false; -} else { -return true; -}}, "~O"); -Clazz_defineStatics (c$, -"PRESS", "pressed", -"RELEASE", "released"); -c$ = Clazz_p0p (); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSButtonUI", ["javax.swing.LookAndFeel", "$.UIManager", "javax.swing.plaf.UIResource", "swingjs.api.DOMNode", "swingjs.plaf.JSButtonListener"], function () { -c$ = Clazz_decorateAsClass (function () { -this.domBtn = null; -this.shiftOffset = 0; -this.defaultTextShiftOffset = 0; -Clazz_instantialize (this, arguments); -}, swingjs.plaf, "JSButtonUI", swingjs.plaf.JSComponentUI); -Clazz_overrideMethod (c$, "getDOMObject", -function () { -if (this.domNode == null) this.domBtn = this.enableNode = this.valueNode = this.domNode = this.createDOMObject ("input", this.id, ["type", "button"]); -this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "value", (this.c).getText ()), this.c.getFont ()); -return this.domNode; -}); -Clazz_defineMethod (c$, "verifyButtonClick", -function (isRelease) { -return true; -}, "~B"); -Clazz_overrideMethod (c$, "installJSUI", -function () { -this.installDefaults (this.c); -this.installListeners (this.c); -this.installKeyboardActions (this.c); -}); -Clazz_overrideMethod (c$, "uninstallJSUI", -function () { -this.uninstallKeyboardActions (this.c); -this.uninstallListeners (this.c); -}); -Clazz_defineMethod (c$, "installListeners", -function (b) { -var listener = new swingjs.plaf.JSButtonListener (b); -if (listener != null) { -b.addMouseListener (listener); -b.addMouseMotionListener (listener); -b.addFocusListener (listener); -b.addPropertyChangeListener (listener); -b.addChangeListener (listener); -}}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "uninstallListeners", -function (b) { -var listener = this.getButtonListener (b); -if (listener != null) { -b.removeMouseListener (listener); -b.removeMouseMotionListener (listener); -b.removeFocusListener (listener); -b.removeChangeListener (listener); -b.removePropertyChangeListener (listener); -}}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "installKeyboardActions", -function (b) { -var listener = this.getButtonListener (b); -if (listener != null) { -listener.installKeyboardActions (b); -}}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "uninstallKeyboardActions", -function (b) { -var listener = this.getButtonListener (b); -if (listener != null) { -listener.uninstallKeyboardActions (b); -}}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "getButtonListener", -function (b) { -var listeners = b.getMouseMotionListeners (); -if (listeners != null) { -for (var counter = 0; counter < listeners.length; counter++) { -if (Clazz_instanceOf (listeners[counter], swingjs.plaf.JSButtonListener)) { -return listeners[counter]; -}} -}return null; -}, "javax.swing.AbstractButton"); -Clazz_defineMethod (c$, "getPropertyPrefix", -function () { -return "Button."; -}); -Clazz_defineMethod (c$, "installDefaults", -function (b) { -var pp = this.getPropertyPrefix (); -this.defaultTextShiftOffset = javax.swing.UIManager.getInt (pp + "textShiftOffset"); -if (b.getMargin () == null || (Clazz_instanceOf (b.getMargin (), javax.swing.plaf.UIResource))) { -b.setMargin (javax.swing.UIManager.getInsets (pp + "margin")); -}javax.swing.LookAndFeel.installColorsAndFont (b, pp + "background", pp + "foreground", pp + "font"); -javax.swing.LookAndFeel.installProperty (b, "iconTextGap", new Integer (4)); -}, "javax.swing.AbstractButton"); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSToggleButtonUI", ["swingjs.api.DOMNode"], function () { -c$ = Clazz_decorateAsClass (function () { -this.isDomChecked = false; -Clazz_instantialize (this, arguments); -}, swingjs.plaf, "JSToggleButtonUI", swingjs.plaf.JSButtonUI); -Clazz_overrideMethod (c$, "verifyButtonClick", -function (isRelease) { -var checked = ((swingjs.api.DOMNode.getAttr (this.domBtn, "checked")).booleanValue () === true); -if (isRelease && this.isDomChecked == checked) return false; -this.isDomChecked = checked; -return true; -}, "~B"); -Clazz_overrideMethod (c$, "getPropertyPrefix", -function () { -return "ToggleButton."; -}); -}); -Clazz_declarePackage ("swingjs.plaf"); -Clazz_load (["javax.swing.plaf.ActionMapUIResource"], "swingjs.plaf.LazyActionMap", ["javax.swing.SwingUtilities", "$.UIManager"], function () { -c$ = Clazz_decorateAsClass (function () { -this._loader = null; -Clazz_instantialize (this, arguments); -}, swingjs.plaf, "LazyActionMap", javax.swing.plaf.ActionMapUIResource); -c$.installLazyActionMap = Clazz_defineMethod (c$, "installLazyActionMap", -function (c, loaderClass, defaultsKey) { -var map = javax.swing.UIManager.get (defaultsKey); -if (map == null) { -map = new swingjs.plaf.LazyActionMap (loaderClass); -}javax.swing.SwingUtilities.replaceUIActionMap (c, map); -}, "javax.swing.JComponent,Class,~S"); -c$.getActionMap = Clazz_defineMethod (c$, "getActionMap", -function (loaderClass, defaultsKey) { -var map = javax.swing.UIManager.get (defaultsKey); -if (map == null) { -map = new swingjs.plaf.LazyActionMap (loaderClass); -}return map; -}, "Class,~S"); -Clazz_makeConstructor (c$, - function (loader) { -Clazz_superConstructor (this, swingjs.plaf.LazyActionMap, []); -this._loader = loader; -}, "Class"); -Clazz_defineMethod (c$, "put", -function (action) { -this.put (action.getValue ("Name"), action); -}, "javax.swing.Action"); -Clazz_defineMethod (c$, "put", -function (key, action) { -this.loadIfNecessary (); -Clazz_superCall (this, swingjs.plaf.LazyActionMap, "put", [key, action]); -}, "~O,javax.swing.Action"); -Clazz_defineMethod (c$, "get", -function (key) { -this.loadIfNecessary (); -return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "get", [key]); -}, "~O"); -Clazz_defineMethod (c$, "remove", -function (key) { -this.loadIfNecessary (); -Clazz_superCall (this, swingjs.plaf.LazyActionMap, "remove", [key]); -}, "~O"); -Clazz_defineMethod (c$, "clear", -function () { -this.loadIfNecessary (); -Clazz_superCall (this, swingjs.plaf.LazyActionMap, "clear", []); -}); -Clazz_defineMethod (c$, "keys", -function () { -this.loadIfNecessary (); -return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "keys", []); -}); -Clazz_defineMethod (c$, "size", -function () { -this.loadIfNecessary (); -return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "size", []); -}); -Clazz_defineMethod (c$, "allKeys", -function () { -this.loadIfNecessary (); -return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "allKeys", []); -}); -Clazz_defineMethod (c$, "setParent", -function (map) { -this.loadIfNecessary (); -Clazz_superCall (this, swingjs.plaf.LazyActionMap, "setParent", [map]); -}, "javax.swing.ActionMap"); -Clazz_defineMethod (c$, "loadIfNecessary", - function () { -if (this._loader != null) { -{ -this._loader.loadActionMap(this); -this._loader = null; -}}}); -}); +// JSmolJavaExt.js + + +// This library will be wrapped by an additional anonymous function using ANT in +// build_03_tojs.xml. This task will also modify variable names. References +// to Clazz._ will not be changed, but other Clazz_xxx will be changed to +// (local scope) Clazz_xxx, allowing them to be further compressed using +// Google Closure Compiler in that same ANT task. + +// BH 5/31/2015 5:53:04 PM Number.compareTo added +// BH 5/21/2015 5:46:30 PM Number("0xFFFFFFFF") is not -1 +// BH 4/23/2015 9:08:59 AM xx.getComponentType() is nonfunctional. Array.newInstance now defines a wrapper for .getClass().getComponentType() that works +// BH 4/12/2015 1:37:44 PM adding Math.rint = Math.round +// BH 1/16/2015 10:09:38 AM Chrome failure jqGrig due to new String("x").toString() not being a simple string +// BH 8/14/2014 6:49:22 PM Character class efficiencies +// BH 7/24/2014 9:02:18 AM most browsers do not support String.codePointAt() +// BH 7/11/2014 4:17:22 PM fix for Boolean.valueOf("false") not being false +// BH 5/27/2014 6:29:59 AM ensure floats and doubles have decimal point in toString +// BH 4/1/2014 12:23:41 PM Encoding moved to Clazz._Encoding; +// BH 4/1/2014 7:51:46 AM removing java.lang.B00lean +// BH 3/7/2014 9:17:10 AM removing Array.toString; moving that code here from j2sJmol.js +// BH 1/30/2014 9:04:25 AM adding Throwable.getStackTrace() as a STRING +// BH 12/4/2013 9:20:44 PM fix for reassigning Date.prototype.toString() +// BH 12/3/2013 11:43:10 AM bizarre Safari bug in reassigning Boolean (OK, I admit, we shouldn't have done that...) +// BH 12/1/2013 6:50:16 AM evit Number.prototype.toString assignment removed! +// BH 11/30/2013 1:46:31 PM fixing Byte, Short, Long, Integer, Float, Double to reflect proper bounds and error conditions +// BH 11/29/2013 8:58:49 PM removing Boolean.toString(boolean) +// BH 11/4/2013 7:34:26 AM changing "var nativeClazz" to "var nativeClass" to avoid ANT replacement of "nativeClazz_" to "nativeClazz_" +// BH 10/19/2013 1:29:27 PM fixed String.$replace() +// BH 10/18/2013 6:09:23 PM fixed (Double|Float).valueOf(NaN).valueOf(), which should return NaN, not throw an error +// BH 10/12/2013 11:18:44 AM fixed bug in Double(String) and Float(String) that was returning typeof "string" +// BH 10/10/2013 2:40:20 PM added Math.log10 +// BH 7/23/2013 7:24:01 AM fixing Number.shortValue() and Number.byteValue() for negative values +// BH 6/16/2013 1:31:30 PM adding /| in String.replace -- thank you David Koes +// BH 3/13/2013 12:49:23 PM setting Boolean.valueOf() "@" +// BH 3/2/2013 10:46:45 PM removed Double.valueOf(String) +// BH 11/6/2012 8:26:33 PM added instanceof Int32Array in String.instantialize +// BH 10/13/2012 11:38:07 PM corrected Integer.parseInt to allow only +-0123456789; created Integer.parseIntRadix +// BH 11/1/2012 added Short +// BH 9/10/2012 6:27:21 AM added java.net.URL... classes +// BH 1/7/2013 7:40:06 AM added Clazz_dateToString + +;(function(Clazz) { + +// moved here from package.js +// these classes will be created as objects prior to any others +// and are then available immediately + + Clazz._Loader.registerPackages("java", [ "io", "lang", "lang.reflect", "util" ]); + + var sJU = "java.util"; + + //var sJU = "JU"; + //Clazz._Loader.registerPackages (sJU, ["regex", "zip"]); + //var javautil = JU; + + var javautil = java.util; + + Clazz._Loader.ignore([ + "net.sf.j2s.ajax.HttpRequest", + sJU + ".MapEntry.Type", + //"java.net.UnknownServiceException", + "java.lang.Runtime", + "java.security.AccessController", + "java.security.PrivilegedExceptionAction", + "java.io.File", + "java.io.FileInputStream", + "java.io.FileWriter", + "java.io.OutputStreamWriter", +// sJU + ".Calendar", // bypassed in ModelCollection +// "java.text.SimpleDateFormat", // not used +// "java.text.DateFormat", // not used + sJU + ".concurrent.Executors" + ]) + +Math.rint = Math.round; + +Math.log10||(Math.log10=function(a){return Math.log(a)/2.302585092994046}); + +if(Clazz._supportsNativeObject){ + // Number and Array are special -- do not override prototype.toString -- "length - 2" here + for(var i=0;i 0 ? x - 0x10000 : x); +}); + +Clazz_defineMethod(Number,"byteValue", +function(){ +var x = Math.round(this)&0xff; +return (this < 0 && x > 0 ? x - 0x100 : x); +}); + +Clazz_defineMethod(Number,"intValue", +function(){ +return Math.round(this)&0xffffffff; +}); + +Clazz_defineMethod(Number,"longValue", +function(){ +return Math.round(this); +}); + +Clazz_defineMethod(Number,"floatValue", +function(){ +return this.valueOf(); +}); +Clazz_defineMethod(Number,"doubleValue", +function(){ +return parseFloat(this.valueOf()); +}); + +Clazz_overrideMethod(Number,"hashCode", +function(){ +return this.valueOf(); +}); + +java.lang.Integer=Integer=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Integer,"Integer",Number,Comparable,null,true); +Integer.prototype.valueOf=function(){return 0;}; +Integer.toString=Integer.prototype.toString=function(){ +if(arguments.length!=0){ +return""+arguments[0]; +} else if(this===Integer){ +return"class java.lang.Integer"; +} +return""+this.valueOf(); +}; + +/* + +Clazz_makeConstructor(Integer, +function(){ +this.valueOf=function(){ +return 0; +}; +}); +*/ + + +Clazz_overrideConstructor(Integer, function(v){ + v == null && (v = 0); + if (typeof v != "number") + v = Integer.parseIntRadix(v, 10); + this.valueOf=function(){return v;}; +}); //BH +/* +Clazz_makeConstructor(Integer, +function(s){ +var value=Integer.parseInt(s,10); +this.valueOf=function(){ +return value; +}; +},"String"); +*/ +Integer.MIN_VALUE=Integer.prototype.MIN_VALUE=-0x80000000; +Integer.MAX_VALUE=Integer.prototype.MAX_VALUE=0x7fffffff; +Integer.TYPE=Integer.prototype.TYPE=Integer; + + +Clazz_defineMethod(Integer,"bitCount", +function(i) { + i = i - ((i >>> 1) & 0x55555555); + i = (i & 0x33333333) + ((i >>> 2) & 0x33333333); + i = (i + (i >>> 4)) & 0x0f0f0f0f; + i = i + (i >>> 8); + i = i + (i >>> 16); + return i & 0x3f; +},"Number"); +Integer.bitCount=Integer.prototype.bitCount; + +Clazz_defineMethod(Integer,"numberOfLeadingZeros", +function(i) { + if (i == 0) return 32; + var n = 1; + if (i >>> 16 == 0) { n += 16; i <<= 16; } + if (i >>> 24 == 0) { n += 8; i <<= 8; } + if (i >>> 28 == 0) { n += 4; i <<= 4; } + if (i >>> 30 == 0) { n += 2; i <<= 2; } + n -= i >>> 31; + return n; +},"Number"); +Integer.numberOfLeadingZeros=Integer.prototype.numberOfLeadingZeros; + +Clazz_defineMethod(Integer,"numberOfTrailingZeros", +function(i) { + if (i == 0) return 32; + var n = 31; + var y = i <<16; if (y != 0) { n = n -16; i = y; } + y = i << 8; if (y != 0) { n = n - 8; i = y; } + y = i << 4; if (y != 0) { n = n - 4; i = y; } + y = i << 2; if (y != 0) { n = n - 2; i = y; } + return n - ((i << 1) >>> 31); +},"Number"); +Integer.numberOfTrailingZeros=Integer.prototype.numberOfTrailingZeros; + +Clazz_defineMethod(Integer,"parseIntRadix", +function(s,radix){ +if(s==null){ +throw new NumberFormatException("null"); +}if(radix<2){ +throw new NumberFormatException("radix "+radix+" less than Character.MIN_RADIX"); +}if(radix>36){ +throw new NumberFormatException("radix "+radix+" greater than Character.MAX_RADIX"); +} +if (radix == 10) { + for (var i = s.length; --i >= 0;) { + var c = s.charCodeAt(i); + if (c >= 48 && c <= 57) continue; + if (i > 0 || c != 43 && c != 45) + throw new NumberFormatException("Not a Number : "+s); + + } +} +var i=parseInt(s,radix); +if(isNaN(i)){ +throw new NumberFormatException("Not a Number : "+s); +} +return i; +},"String, Number"); +Integer.parseIntRadix=Integer.prototype.parseIntRadix; + +Clazz_defineMethod(Integer,"parseInt", +function(s){ +return Integer.parseIntRadix(s,10); +},"String"); +Integer.parseInt=Integer.prototype.parseInt; + +/* +Clazz_defineMethod(Integer,"$valueOf", +function(s){ +return new Integer(Integer.parseIntRadix(s,10)); +},"String"); +*/ + +Clazz_overrideMethod(Integer,"$valueOf", +function(s){ +return new Integer(s); +}); + +/* +Clazz_defineMethod(Integer,"$valueOf", +function(s,r){ +return new Integer(Integer.parseIntRadix(s,r)); +},"String, Number"); +*/ + +Integer.$valueOf=Integer.prototype.$valueOf; + + +Clazz_overrideMethod(Integer,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Integer)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); +Integer.toHexString=Integer.prototype.toHexString=function(d){ +if(d.valueOf)d=d.valueOf(); +if (d < 0) { +var b = d & 0xFFFFFF; +var c = ((d>>24)&0xFF); +return c._numberToString(16) + (b = "000000" + b._numberToString(16)).substring(b.length - 6); +} +return d._numberToString(16);}; +Integer.toOctalString=Integer.prototype.toOctalString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(8);}; +Integer.toBinaryString=Integer.prototype.toBinaryString=function(d){if(d.valueOf)d=d.valueOf();return d._numberToString(2);}; + +Integer.decodeRaw=Clazz_defineMethod(Integer,"decodeRaw", function(n){ +if (n.indexOf(".") >= 0)n = ""; +var i = (n.startsWith("-") ? 1 : 0); +n = n.replace(/\#/, "0x").toLowerCase(); +var radix=(n.startsWith("0x", i) ? 16 : n.startsWith("0", i) ? 8 : 10); +// The general problem with parseInt is that is not strict -- ParseInt("10whatever") == 10. +// Number is strict, but Number("055") does not work, though ParseInt("055", 8) does. +// need to make sure negative numbers are negative +n = Number(n) & 0xFFFFFFFF; +return (radix == 8 ? parseInt(n, 8) : n); +},"~S"); + +Integer.decode=Clazz_defineMethod(Integer,"decode", function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n) || n < Integer.MIN_VALUE|| n > Integer.MAX_VALUE) + throw new NumberFormatException("Invalid Integer"); + return new Integer(n); +},"~S"); + +Clazz_overrideMethod(Integer,"hashCode", +function(){ +return this.valueOf(); +}); + +// Note that Long is problematic in JavaScript + +java.lang.Long=Long=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Long,"Long",Number,Comparable,null,true); +Long.prototype.valueOf=function(){return 0;}; +Long.toString=Long.prototype.toString=function(){ +if(arguments.length!=0){ +return""+arguments[0]; +}else if(this===Long){ +return"class java.lang.Long"; +} +return""+this.valueOf(); +}; + +Clazz_overrideConstructor(Long, function(v){ + v == null && (v = 0); + v = (typeof v == "number" ? Math.round(v) : Integer.parseIntRadix(v, 10)); +this.valueOf=function(){return v;}; +}); + +//Long.MIN_VALUE=Long.prototype.MIN_VALUE=-0x8000000000000000; +//Long.MAX_VALUE=Long.prototype.MAX_VALUE=0x7fffffffffffffff; +Long.TYPE=Long.prototype.TYPE=Long; + +Clazz_defineMethod(Long,"parseLong", +function(s,radix){ + return Integer.parseInt(s, radix || 10); +}); + +Long.parseLong=Long.prototype.parseLong; + +Clazz_overrideMethod(Long,"$valueOf", +function(s){ +return new Long(s); +}); +/* +Clazz_defineMethod(Long,"$valueOf", +function(s){ +return new Long(s); +},"Number"); + +Clazz_defineMethod(Long,"$valueOf", +function(s,r){ +return new Long(Long.parseLong(s,r)); +},"String, Number"); +*/ +Long.$valueOf=Long.prototype.$valueOf; +Clazz_overrideMethod(Long,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Long)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); +Long.toHexString=Long.prototype.toHexString=function(i){ +return i.toString(16); +}; +Long.toOctalString=Long.prototype.toOctalString=function(i){ +return i.toString(8); +}; +Long.toBinaryString=Long.prototype.toBinaryString=function(i){ +return i.toString(2); +}; + + +Long.decode=Clazz_defineMethod(Long,"decode", +function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n)) + throw new NumberFormatException("Invalid Long"); + return new Long(n); +},"~S"); + +java.lang.Short = Short = function () { +Clazz_instantialize (this, arguments); +}; +Clazz_decorateAsType (Short, "Short", Number, Comparable, null, true); +Short.prototype.valueOf = function () { return 0; }; +Short.toString = Short.prototype.toString = function () { + if (arguments.length != 0) { + return "" + arguments[0]; + } else if (this === Short) { + return "class java.lang.Short"; // Short.class.toString + } + return "" + this.valueOf (); +}; + +Clazz_overrideConstructor(Short, +function (v) { + v == null && (v = 0); + if (typeof v != "number") + v = Integer.parseIntRadix(v, 10); + v = v.shortValue(); + this.valueOf = function () {return v;}; +}); + + +Short.MIN_VALUE = Short.prototype.MIN_VALUE = -32768; +Short.MAX_VALUE = Short.prototype.MAX_VALUE = 32767; +Short.TYPE = Short.prototype.TYPE = Short; + +Clazz_defineMethod(Short, "parseShortRadix", +function (s, radix) { +return Integer.parseIntRadix(s, radix).shortValue(); +}, "String, Number"); +Short.parseShortRadix = Short.prototype.parseShortRadix; + +Clazz_defineMethod(Short, "parseShort", +function (s) { +return Short.parseShortRadix (s, 10); +}, "String"); + +Short.parseShort = Short.prototype.parseShort; + +/* +Clazz_defineMethod(Short, "$valueOf", +function (s) { +return new Short(Short.parseShort (s, 10)); +}, "String"); + */ + +Clazz_overrideMethod(Short, "$valueOf", +function (s) { +return new Short(s); +}); + +/* +Clazz_defineMethod(Short, "$valueOf", +function (s, r) { +return new Short(Short.parseShort (s, r)); +}, "String, Number"); + */ + +Short.$valueOf = Short.prototype.$valueOf; +Clazz_overrideMethod(Short, "equals", +function (s) { +if(s == null || !Clazz_instanceOf(s, Short) ){ + return false; +} +return s.valueOf() == this.valueOf(); +}, "Object"); +Short.toHexString = Short.prototype.toHexString = function (i) { + return i.toString (16); +}; +Short.toOctalString = Short.prototype.toOctalString = function (i) { + return i.toString (8); +}; +Short.toBinaryString = Short.prototype.toBinaryString = function (i) { + return i.toString (2); +}; +Short.decode = Clazz_defineMethod(Short, "decode", +function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n) || n < -32768|| n > 32767) + throw new NumberFormatException("Invalid Short"); + return new Short(n); +}, "~S"); + +java.lang.Byte=Byte=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Byte,"Byte",Number,Comparable,null,true); +Byte.prototype.valueOf=function(){return 0;}; +Byte.toString=Byte.prototype.toString=function(){ +if(arguments.length!=0){ +return""+arguments[0]; +}else if(this===Byte){ +return"class java.lang.Byte"; +} +return""+this.valueOf(); +}; +Clazz_makeConstructor(Byte, +function(v){ + if (typeof v != "number") + v = Integer.parseIntRadix(v, 10); + v = v.byteValue(); +this.valueOf=function(){ +return v; +}; +}); + +Byte.serialVersionUID=Byte.prototype.serialVersionUID=-7183698231559129828; +Byte.MIN_VALUE=Byte.prototype.MIN_VALUE=-128; +Byte.MAX_VALUE=Byte.prototype.MAX_VALUE=127; +Byte.SIZE=Byte.prototype.SIZE=8; +Byte.TYPE=Byte.prototype.TYPE=Byte; + +Clazz_defineMethod(Byte,"parseByteRadix", +function(s,radix){ + return Integer.parseIntRadix(s, radix).byteValue(); +},"String, Number"); +Byte.parseByteRadix=Byte.prototype.parseByteRadix; + +Clazz_defineMethod(Byte,"parseByte", +function(s){ +return Byte.parseByte(s,10); +},"String"); + +Byte.parseByte=Byte.prototype.parseByte; + +Clazz_overrideMethod(Byte, "$valueOf", +function (s) { +return new Byte(s); +}); + +Byte.$valueOf=Byte.prototype.$valueOf; +Clazz_overrideMethod(Byte,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Byte)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); +Byte.toHexString=Byte.prototype.toHexString=function(i){ +return i.toString(16); +}; +Byte.toOctalString=Byte.prototype.toOctalString=function(i){ +return i.toString(8); +}; +Byte.toBinaryString=Byte.prototype.toBinaryString=function(i){ +return i.toString(2); +}; +Byte.decode=Clazz_defineMethod(Byte,"decode", +function(n){ + n = Integer.decodeRaw(n); + if (isNaN(n) || n < -128|| n > 127) + throw new NumberFormatException("Invalid Byte"); +return new Byte(n); +},"~S"); + +Clazz._floatToString = function(f) { + var s = ""+f + if (s.indexOf(".") < 0 && s.indexOf("e") < 0) + s += ".0"; + return s; +} + +java.lang.Float=Float=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Float,"Float",Number,Comparable,null,true); +Float.prototype.valueOf=function(){return 0;}; +Float.toString=Float.prototype.toString=function(){ +if(arguments.length!=0){ +return Clazz._floatToString(arguments[0]); +}else if(this===Float){ +return"class java.lang.Float"; +} +return Clazz._floatToString(this.valueOf()); +}; + +Clazz_overrideConstructor(Float, function(v){ + v == null && (v = 0); + if (typeof v != "number") + v = Number(v); + this.valueOf=function(){return v;} +}); + +Float.serialVersionUID=Float.prototype.serialVersionUID=-2671257302660747028; +Float.MIN_VALUE=Float.prototype.MIN_VALUE=3.4028235e+38; +Float.MAX_VALUE=Float.prototype.MAX_VALUE=1.4e-45; +Float.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; +Float.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; +Float.NaN=Number.NaN; +Float.TYPE=Float.prototype.TYPE=Float; + +Clazz_defineMethod(Float,"parseFloat", +function(s){ +if(s==null){ +throw new NumberFormatException("null"); +} +if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here +var floatVal=Number(s); +if(isNaN(floatVal)){ +throw new NumberFormatException("Not a Number : "+s); +} +return floatVal; +},"String"); +Float.parseFloat=Float.prototype.parseFloat; + +Clazz_overrideMethod(Float,"$valueOf", +function(s){ +return new Float(s); +}); + +Float.$valueOf=Float.prototype.$valueOf; + +Clazz_defineMethod(Float,"isNaN", +function(num){ +return isNaN(num); +},"Number"); +Float.isNaN=Float.prototype.isNaN; +Clazz_defineMethod(Float,"isInfinite", +function(num){ +return!isFinite(num); +},"Number"); +Float.isInfinite=Float.prototype.isInfinite; + +Clazz_overrideMethod(Float,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Float)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); + +java.lang.Double=Double=function(){ +Clazz_instantialize(this,arguments); +}; +Clazz_decorateAsType(Double,"Double",Number,Comparable,null,true); +Double.prototype.valueOf=function(){return 0;}; +Double.toString=Double.prototype.toString=function(){ +if(arguments.length!=0){ +return Clazz._floatToString(arguments[0]); +}else if(this===Double){ +return"class java.lang.Double"; +} +return Clazz._floatToString(this.valueOf()); +}; + +Clazz_overrideConstructor(Double, function(v){ + v == null && (v = 0); + if (typeof v != "number") + v = Double.parseDouble(v); + this.valueOf=function(){return v;}; +}); // BH + +Double.serialVersionUID=Double.prototype.serialVersionUID=-9172774392245257468; +Double.MIN_VALUE=Double.prototype.MIN_VALUE=4.9e-324; +Double.MAX_VALUE=Double.prototype.MAX_VALUE=1.7976931348623157e+308; +Double.NEGATIVE_INFINITY=Number.NEGATIVE_INFINITY; +Double.POSITIVE_INFINITY=Number.POSITIVE_INFINITY; +Double.NaN=Number.NaN; +Double.TYPE=Double.prototype.TYPE=Double; + +Clazz_defineMethod(Double,"isNaN", +function(num){ +return isNaN(num); +},"Number"); +Double.isNaN=Double.prototype.isNaN; +Clazz_defineMethod(Double,"isInfinite", +function(num){ +return!isFinite(num); +},"Number"); +Double.isInfinite=Double.prototype.isInfinite; + +Clazz_defineMethod(Double,"parseDouble", +function(s){ +if(s==null){ +throw new NumberFormatException("null"); +} +if (typeof s == "number")return s; // important -- typeof NaN is "number" and is OK here +var doubleVal=Number(s); +if(isNaN(doubleVal)){ +throw new NumberFormatException("Not a Number : "+s); +} +return doubleVal; +},"String"); +Double.parseDouble=Double.prototype.parseDouble; + +/* +Clazz_defineMethod(Double,"$valueOf", +function(s){ +return new Double(this.parseDouble(s)); +},"String"); +*/ + +Clazz_defineMethod(Double,"$valueOf", +function(v){ +return new Double(v); +},"Number"); + +Double.$valueOf=Double.prototype.$valueOf; + +Clazz_overrideMethod(Double,"equals", +function(s){ +if(s==null||!Clazz_instanceOf(s,Double)){ +return false; +} +return s.valueOf()==this.valueOf(); +},"Object"); + + +//java.lang.B00lean = Boolean; ?? BH why this? +Boolean = java.lang.Boolean = Boolean || function () {Clazz_instantialize (this, arguments);}; +if (Clazz._supportsNativeObject) { + for (var i = 0; i < Clazz._extendedObjectMethods.length; i++) { + var p = Clazz._extendedObjectMethods[i]; + Boolean.prototype[p] = Clazz._O.prototype[p]; + } +} +Boolean.__CLASS_NAME__="Boolean"; +Clazz_implementOf(Boolean,[java.io.Serializable,java.lang.Comparable]); +Boolean.equals=Clazz._innerFunctions.equals; +Boolean.getName=Clazz._innerFunctions.getName; +Boolean.serialVersionUID=Boolean.prototype.serialVersionUID=-3665804199014368530; + +//Clazz_makeConstructor(Boolean, +//function(value){ +//this.valueOf=function(){ +//return value; +//}; +//},"~B"); + +Clazz_overrideConstructor(Boolean, +function(s){ + var b = ((typeof s == "string" ? Boolean.toBoolean(s) : s) ? true : false); + this.valueOf=function(){return b;}; +},"~O"); + +Boolean.parseBoolean=Clazz_defineMethod(Boolean,"parseBoolean", +function(s){ +return Boolean.toBoolean(s); +},"~S"); +Clazz_defineMethod(Boolean,"booleanValue", +function(){ +return this.valueOf(); +}); +Boolean.$valueOf=Clazz_overrideMethod(Boolean,"$valueOf", +function(b){ +return((typeof b == "string"? "true".equalsIgnoreCase(b) : b)?Boolean.TRUE:Boolean.FALSE); +}); + +/* +Boolean.toString=Clazz_defineMethod(Boolean,"toString", +function(b){ +return b?"true":"false"; +},"~B"); +*/ + +Clazz_overrideMethod(Boolean,"toString", +function(){ +return this.valueOf()?"true":"false"; +}); +Clazz_overrideMethod(Boolean,"hashCode", +function(){ +return this.valueOf()?1231:1237; +}); +Clazz_overrideMethod(Boolean,"equals", +function(obj){ +if(Clazz_instanceOf(obj,Boolean)){ +return this.booleanValue()==obj.booleanValue(); +}return false; +},"~O"); +Boolean.getBoolean=Clazz_defineMethod(Boolean,"getBoolean", +function(name){ +var result=false; +try{ +result=Boolean.toBoolean(System.getProperty(name)); +}catch(e){ +if(Clazz_instanceOf(e,IllegalArgumentException)){ +}else if(Clazz_instanceOf(e,NullPointerException)){ +}else{ +throw e; +} +} +return result; +},"~S"); +Clazz_overrideMethod(Boolean,"compareTo", +function(b){ +return(b.value==this.value?0:(this.value?1:-1)); +},"Boolean"); +Boolean.toBoolean=Clazz_defineMethod(Boolean,"toBoolean", +($fz=function(name){ +return((name!=null)&&name.equalsIgnoreCase("true")); +},$fz.isPrivate=true,$fz),"~S"); +Boolean.TRUE=Boolean.prototype.TRUE=new Boolean(true); +Boolean.FALSE=Boolean.prototype.FALSE=new Boolean(false); +Boolean.TYPE=Boolean.prototype.TYPE=Boolean; + + +Clazz._Encoding=new Object(); + +(function(Encoding) { + +Encoding.UTF8="utf-8"; +Encoding.UTF16="utf-16"; +Encoding.ASCII="ascii"; + + +Encoding.guessEncoding=function(str){ +if(str.charCodeAt(0)==0xEF&&str.charCodeAt(1)==0xBB&&str.charCodeAt(2)==0xBF){ +return Encoding.UTF8; +}else if(str.charCodeAt(0)==0xFF&&str.charCodeAt(1)==0xFE){ +return Encoding.UTF16; +}else{ +return Encoding.ASCII; +} +}; + +Encoding.readUTF8=function(str){ +var encoding=this.guessEncoding(str); +var startIdx=0; +if(encoding==Encoding.UTF8){ +startIdx=3; +}else if(encoding==Encoding.UTF16){ +startIdx=2; +} +var arrs=new Array(); +for(var i=startIdx;i0xc0&&charCode<0xe0){ +var c1=charCode&0x1f; +i++; +var c2=str.charCodeAt(i)&0x3f; +var c=(c1<<6)+c2; +arrs[arrs.length]=String.fromCharCode(c); +}else if(charCode>=0xe0){ +var c1=charCode&0x0f; +i++; +var c2=str.charCodeAt(i)&0x3f; +i++; +var c3=str.charCodeAt(i)&0x3f; +var c=(c1<<12)+(c2<<6)+c3; +arrs[arrs.length]=String.fromCharCode(c); +} +} +return arrs.join(''); +}; + +Encoding.convert2UTF8=function(str){ +var encoding=this.guessEncoding(str); +var startIdx=0; +if(encoding==Encoding.UTF8){ +return str; +}else if(encoding==Encoding.UTF16){ +startIdx=2; +} + +var offset=0; +var arrs=new Array(offset+str.length-startIdx); + +for(var i=startIdx;i>6); +var c2=0x80+(charCode&0x003f); +arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2); +}else{ +var c1=0xe0+((charCode&0xf000)>>12); +var c2=0x80+((charCode&0x0fc0)>>6); +var c3=0x80+(charCode&0x003f); +arrs[offset+i-startIdx]=String.fromCharCode(c1)+String.fromCharCode(c2)+String.fromCharCode(c3); +} +} +return arrs.join(''); +}; +Encoding.base64Chars=new Array( +'A','B','C','D','E','F','G','H', +'I','J','K','L','M','N','O','P', +'Q','R','S','T','U','V','W','X', +'Y','Z','a','b','c','d','e','f', +'g','h','i','j','k','l','m','n', +'o','p','q','r','s','t','u','v', +'w','x','y','z','0','1','2','3', +'4','5','6','7','8','9','+','/' +); +Encoding.encodeBase64=function(str){ +if(str==null||str.length==0)return str; +var b64=Encoding.base64Chars; +var length=str.length; +var index=0; +var buf=[]; +var c0,c1,c2; +while(index>2]; +if(index>4)]; +if(index>6)]; +buf[buf.length]=b64[c2&0x3F]; +}else{ +buf[buf.length]=b64[((c1<<2)&0x3c)]; +buf[buf.length]='='; +} +}else{ +buf[buf.length]=b64[(c0<<4)&0x30]; +buf[buf.length]='='; +buf[buf.length]='='; +} +} +return buf.join(''); +}; +Encoding.decodeBase64=function(str){ +if(str==null||str.length==0)return str; +var b64=Encoding.base64Chars; +var xb64=Encoding.xBase64Chars; +if(Encoding.xBase64Chars==null){ +xb64=new Object(); +for(var i=0;i>4); +if(c2!=null){ +buf[buf.length]=String.fromCharCode(((c1<<4)&0xff)|c2>>2); +if(c3!=null){ +buf[buf.length]=String.fromCharCode(((c2<<6)&0xff)|c3); +} +} +} +return buf.join(''); +}; + +if(String.prototype.$replace==null){ +java.lang.String=String; +if(Clazz._supportsNativeObject){ +for(var i=0;i= 0) c1 = "\\" + c1; + } else { + c1=c1.replace(/([\\\$\.\*\+\|\?\^\{\}\(\)\[\]])/g,function($0,$1){return"\\"+$1;}); + } + return this.replace(new RegExp(c1,"gm"),c2); +}; +sp.$generateExpFunction=function(str){ +var arr=[]; +var orders=[]; +var idx=0; +arr[0]=""; +var i=0; +for(;ithis.length-len)|| +(ooffset>other.length-len)){ +return false; +} +var s1=this.substring(toffset,toffset+len); +var s2=other.substring(ooffset,ooffset+len); +if(ignoreCase){ +s1=s1.toLowerCase(); +s2=s2.toLowerCase(); +} +return s1==s2; +}; + + + +sp.$plit=function(regex,limit){ +if (!limit && regex == " ") + return this.split(regex); + +if(limit!=null&&limit>0){ +if(limit==1){ +return this; +} +var regExp=new RegExp("("+regex+")","gm"); +var count=1; +var s=this.replace(regExp,function($0,$1){ +count++; +if(count==limit){ +return"@@_@@"; +}else if(count>limit){ +return $0; +}else{ +return $0; +} +}); +regExp=new RegExp(regex,"gm"); +var arr=this.split(regExp); +if(arr.length>limit){ +arr[limit-1]=s.substring(s.indexOf("@@_@@")+5); +arr.length=limit; +} +return arr; +}else{ +var regExp=new RegExp(regex,"gm"); +return this.split(regExp); +} +}; +/* +sp.trim=function(){ +var len=this.length; +var st=0; + +while((st0)||(lens.length-pc)){ +return false; +} +while(--pc>=0){ +if(s.charAt(to++)!=prefix.charAt(po++)){ +return false; +} +} +return true; +}; + +sp.startsWith=function(prefix){ +if(arguments.length==1){ +return sn(this,arguments[0],0); +}else if(arguments.length==2){ +return sn(this,arguments[0],arguments[1]); +}else{ +return false; +} +}; + +sp.endsWith=function(suffix){ +return sn(this, suffix,this.length-suffix.length); +}; + +} + +sp.equals=function(anObject){ +return this.valueOf()==anObject; +}; + +sp.equalsIgnoreCase=function(anotherString){ +return(anotherString==null)?false:(this==anotherString +||this.toLowerCase()==anotherString.toLowerCase()); +}; + + +sp.hash=0; + +sp.hashCode=function(){ +var h=this.hash; +if(h==0){ +var off=0; +var len=this.length; +for(var i=0;i255){ +arrs[ii]=0x1a; +arrs[ii+1]=c&0xff; +arrs[ii+2]=(c&0xff00)>>8; +ii+=2; +}else{ +arrs[ii]=c; +} +ii++; +} +return arrs; +}; + +/* +sp.compareTo=function(anotherString){ +if(anotherString==null){ +throw new java.lang.NullPointerException(); +} +var len1=this.length; +var len2=anotherString.length; +var n=Math.min(len1,len2); +var k=0; +while(k= 0} // bh added +sp.compareTo = function(a){return this > a ? 1 : this < a ? -1 : 0} // bh added + + + +sp.toCharArray=function(){ +var result=new Array(this.length); +for(var i=0;is2){ +return 1; +}else{ +return-1; +} +} +}; + +sp.contentEquals=function(sb){ +if(this.length!=sb.length()){ +return false; +} +var v=sb.getValue(); +var i=0; +var j=0; +var n=this.length; +while(n--!=0){ +if(this.charCodeAt(i++)!=v[j++]){ +return false; +} +} +return true; +}; + +sp.getChars=function(srcBegin,srcEnd,dst,dstBegin){ +if(srcBegin<0){ +throw new StringIndexOutOfBoundsException(srcBegin); +} +if(srcEnd>this.length){ +throw new StringIndexOutOfBoundsException(srcEnd); +} +if(srcBegin>srcEnd){ +throw new StringIndexOutOfBoundsException(srcEnd-srcBegin); +} +if(dst==null){ +throw new NullPointerException(); +} +for(var i=0;i=sourceCount){ +return(targetCount==0?sourceCount:-1); +} +if(fromIndex<0){ +fromIndex=0; +} +if(targetCount==0){ +return fromIndex; +} + +var first=target[targetOffset]; +var i=sourceOffset+fromIndex; +var max=sourceOffset+(sourceCount-targetCount); + +startSearchForFirstChar: +while(true){ + +while(i<=max&&source[i]!=first){ +i++; +} +if(i>max){ +return-1; +} + + +var j=i+1; +var end=j+targetCount-1; +var k=targetOffset+1; +while(j0&&typeof x[0]=="number"){ +var arr=new Array(x.length); +for(var i=0;ibytes.length){ +throw new IndexOutOfBoundsException(); +} +if(length>0){ +var isChar=(bytes[offset].length!=null); +if(isChar){ +for(var i=0;i0;){ +value[i]=String.fromCharCode(bytes[i+offset]&0xff); +} +}else{ +hibyte<<=8; +for(var i=count;i-->0;){ +value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); +} +} +return value.join(''); +} +}else{ +var s=""; +for(var i=0;ibytes.length){ + throw new IndexOutOfBoundsException(); + } + if(length>0){ + var isChar=(bytes[offset].length!=null); + if(isChar){ + for(var i=0;i0;){ + value[i]=String.fromCharCode(bytes[i+offset]&0xff); + } + }else{ + hibyte<<=8; + for(var i=count;i-->0;){ + value[i]=String.fromCharCode(hibyte|(bytes[i+offset]&0xff)); + } + } + return value.join(''); +default: + var s=""; + for(var i=0;i= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd || c == 0x1680 + || c >= 0x2000 && c != 0x2007 && (c <= 0x200b || c == 0x2028 || c == 0x2029 || c == 0x3000)); +},"~N"); +c$.isLetter=Clazz_defineMethod(c$,"isLetter", +function(c){ +c = c.charCodeAt(0); +return (65 <= c && c <= 90 || 97 <= c && c <= 122); +},"~N"); +c$.isLetterOrDigit=Clazz_defineMethod(c$,"isLetterOrDigit", +function(c){ +c = c.charCodeAt(0); +return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57); +},"~N"); +c$.isSpaceChar=Clazz_defineMethod(c$,"isSpaceChar", +function(c){ + var i = c.charCodeAt(0); +if(i==0x20||i==0xa0||i==0x1680)return true; +if(i<0x2000)return false; +return i<=0x200b||i==0x2028||i==0x2029||i==0x202f||i==0x3000; +},"~N"); +c$.digit=Clazz_defineMethod(c$,"digit", +function(c,radix){ +var i = c.charCodeAt(0); +if(radix >= 2 && radix <= 36){ + if(i < 128){ + var result = -1; + if(48 <= i && i <= 57){ + result = i - 48; + }else if(97 <= i && i <= 122){ + result = i - 87; + }else if(65 <= i && i <= 90){ + result=i-(55); + } + return (result < radix ? result : -1); + } +} +return -1; +},"~N,~N"); +Clazz_overrideMethod(c$,"toString", +function(){ +var buf=[this.value]; +return String.valueOf(buf); +}); +c$.toString=Clazz_overrideMethod(c$,"toString", +function(c){ +{ +if(this===Character){ +return"class java.lang.Character"; +} +}return String.valueOf(c); +},"~N"); +Clazz_defineStatics(c$, +"MIN_VALUE",'\u0000', +"MAX_VALUE",'\uffff', +"MIN_RADIX",2, +"MAX_RADIX",36, +"TYPE",null); + +java.lang.Character.TYPE=java.lang.Character.prototype.TYPE=java.lang.Character; + + + +Clazz._ArrayWrapper = function(a, type) { + return { + a: a, + __CLASS_NAME__:"Array", + superClazz: Array, + getComponentType: function() {return type}, + instanceOf: function(o) { return Clazz_instanceOf(type, o) }, + getName: function() { return this.__CLASS_NAME__ } + }; +} +c$=Clazz_declareType(java.lang.reflect,"Array"); +c$.newInstance=Clazz_defineMethod(c$,"newInstance", +function(componentType,size){ +var a = Clazz_newArray(size); + a.getClass = function() { return new Clazz._ArrayWrapper(this, componentType);}; +return a; +},"Class,~N"); + +javautil.Date=Date; +Date.TYPE="javautil.Date"; +Date.__CLASS_NAME__="Date"; +Clazz_implementOf(Date,[java.io.Serializable,java.lang.Comparable]); + +Clazz_defineMethod(javautil.Date,"clone", +function(){ +return new Date(this.getTime()); +}); + +Clazz_defineMethod(javautil.Date,"before", +function(when){ +return this.getTime()when.getTime(); +},"javautil.Date"); +Clazz_defineMethod(javautil.Date,"equals", +function(obj){ +return Clazz_instanceOf(obj,javautil.Date)&&this.getTime()==(obj).getTime(); +},"Object"); +Clazz_defineMethod(javautil.Date,"compareTo", +function(anotherDate){ +var thisTime=this.getTime(); +var anotherTime=anotherDate.getTime(); +return(thisTime>32)); +}); + +c$=Clazz_decorateAsClass(function(){ +this.source=null; +Clazz_instantialize(this,arguments); +},javautil,"EventObject",null,java.io.Serializable); +Clazz_makeConstructor(c$, +function(source){ +if(source!=null)this.source=source; +else throw new IllegalArgumentException(); +},"~O"); +Clazz_defineMethod(c$,"getSource", +function(){ +return this.source; +}); +Clazz_overrideMethod(c$,"toString", +function(){ +return this.getClass().getName()+"[source="+String.valueOf(this.source)+']'; +}); +Clazz_declareInterface(javautil,"EventListener"); + +c$=Clazz_decorateAsClass(function(){ +this.listener=null; +Clazz_instantialize(this,arguments); +},javautil,"EventListenerProxy",null,javautil.EventListener); +Clazz_makeConstructor(c$, +function(listener){ +this.listener=listener; +},"javautil.EventListener"); +Clazz_defineMethod(c$,"getListener", +function(){ +return this.listener; +}); +Clazz_declareInterface(javautil,"Iterator"); + +Clazz_declareInterface(javautil,"ListIterator",javautil.Iterator); +Clazz_declareInterface(javautil,"Enumeration"); +Clazz_declareInterface(javautil,"Collection",Iterable); + +Clazz_declareInterface(javautil,"Set",javautil.Collection); +Clazz_declareInterface(javautil,"Map"); +Clazz_declareInterface(javautil.Map,"Entry"); + +Clazz_declareInterface(javautil,"List",javautil.Collection); + +Clazz_declareInterface(javautil,"Queue",javautil.Collection); +Clazz_declareInterface(javautil,"RandomAccess"); +c$=Clazz_decorateAsClass(function(){ +this.detailMessage=null; +this.cause=null; +this.stackTrace=null; +Clazz_instantialize(this,arguments); +},java.lang,"Throwable",null,java.io.Serializable); +Clazz_prepareFields(c$,function(){ +this.cause=this; +//alert("e0 "+ arguments.callee.caller.caller.caller.caller.caller) +}); +Clazz_makeConstructor(c$, +function(){ +this.fillInStackTrace(); +}); +Clazz_makeConstructor(c$, +function(message){ +this.fillInStackTrace(); +this.detailMessage=message; +},"~S"); +Clazz_makeConstructor(c$, +function(message,cause){ +this.fillInStackTrace(); +this.detailMessage=message; +this.cause=cause; +},"~S,Throwable"); +Clazz_makeConstructor(c$, +function(cause){ +this.fillInStackTrace(); +this.detailMessage=(cause==null?null:cause.toString()); +this.cause=cause; +},"Throwable"); +Clazz_defineMethod(c$,"getMessage", +function(){ +return (this.message || this.detailMessage || this.toString()); +}); +Clazz_defineMethod(c$,"getLocalizedMessage", +function(){ +return this.getMessage(); +}); +Clazz_defineMethod(c$,"getCause", +function(){ +return(this.cause===this?null:this.cause); +}); +Clazz_defineMethod(c$,"initCause", +function(cause){ +if(this.cause!==this)throw new IllegalStateException("Can't overwrite cause"); +if(cause===this)throw new IllegalArgumentException("Self-causation not permitted"); +this.cause=cause; +return this; +},"Throwable"); +Clazz_overrideMethod(c$,"toString", +function(){ +var s=this.getClass().getName(); +var message=this.message || this.detailMessage; +return(message ? s+": "+message : s); +}); +Clazz_defineMethod(c$,"printStackTrace", +function(){ +System.err.println(this.getStackTrace ? this.getStackTrace() : this.message + " " + Clazz_getStackTrace()); +}); + +Clazz_defineMethod(c$,"getStackTrace", +function(){ +var s = "" + this + "\n"; +for(var i=0;i-1||caller!=null){ +var clazzName=null; +var nativeClass=null; +if(!noLooping||caller==Clazz_tryToSearchAndExecute||caller==Clazz_superCall||caller==null){ +if(index<0){ +break; +} +noLooping=true; +superCaller=Clazz._callingStackTraces[index].caller; +nativeClass=Clazz._callingStackTraces[index].owner; +index--; +}else{ +superCaller=caller; +if(superCaller.claxxOwner!=null){ +nativeClass=superCaller.claxxOwner; +}else if(superCaller.exClazz!=null){ +nativeClass=superCaller.exClazz; +} +} +var st=new StackTraceElement( +((nativeClass!=null&&nativeClass.__CLASS_NAME__.length!=0)? +nativeClass.__CLASS_NAME__:"anonymous"), +((superCaller.exName==null)?"anonymous":superCaller.exName) ++" ("+Clazz_getParamsType(superCaller.arguments)+")", +null,-1); +st.nativeClazz=nativeClass; +this.stackTrace[this.stackTrace.length]=st; +for(var i=0;i":this.declaringClass; +}); +Clazz_defineMethod(c$,"getFileName", +function(){ +return this.fileName; +}); +Clazz_defineMethod(c$,"getLineNumber", +function(){ +return this.lineNumber; +}); +Clazz_defineMethod(c$,"getMethodName", +function(){ +return(this.methodName==null)?"":this.methodName; +}); +Clazz_overrideMethod(c$,"hashCode", +function(){ +if(this.methodName==null){ +return 0; +}return this.methodName.hashCode()^this.declaringClass.hashCode(); +}); +Clazz_defineMethod(c$,"isNativeMethod", +function(){ +return this.lineNumber==-2; +}); +Clazz_overrideMethod(c$,"toString", +function(){ +var buf=new StringBuilder(80); +buf.append(this.getClassName()); +buf.append('.'); +buf.append(this.getMethodName()); +if(this.isNativeMethod()){ +buf.append("(Native Method)"); +}else{ +var fName=this.getFileName(); +if(fName==null){ +buf.append("(Unknown Source)"); +}else{ +var lineNum=this.getLineNumber(); +buf.append('('); +buf.append(fName); +if(lineNum>=0){ +buf.append(':'); +buf.append(lineNum); +}buf.append(')'); +}}return buf.toString(); +}); +TypeError.prototype.getMessage || (TypeError.prototype.getMessage = function(){ return (this.message || this.toString()) + (this.getStackTrace ? this.getStackTrace() : Clazz_getStackTrace())}); +c$=Clazz_declareType(java.lang,"Error",Throwable); + +c$=Clazz_declareType(java.lang,"LinkageError",Error); + +c$=Clazz_declareType(java.lang,"IncompatibleClassChangeError",LinkageError); + +c$=Clazz_declareType(java.lang,"AbstractMethodError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"AssertionError",Error); +Clazz_makeConstructor(c$, +function(detailMessage){ +Clazz_superConstructor(this,AssertionError,[String.valueOf(detailMessage),(Clazz_instanceOf(detailMessage,Throwable)?detailMessage:null)]); +},"~O"); +Clazz_makeConstructor(c$, +function(detailMessage){ +this.construct("" + detailMessage); +},"~B"); +Clazz_makeConstructor(c$, +function(detailMessage){ +this.construct("" + detailMessage); +},"~N"); + +c$=Clazz_declareType(java.lang,"ClassCircularityError",LinkageError); + +c$=Clazz_declareType(java.lang,"ClassFormatError",LinkageError); + +c$=Clazz_decorateAsClass(function(){ +this.exception=null; +Clazz_instantialize(this,arguments); +},java.lang,"ExceptionInInitializerError",LinkageError); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,ExceptionInInitializerError); +this.initCause(null); +}); +Clazz_makeConstructor(c$, +function(detailMessage){ +Clazz_superConstructor(this,ExceptionInInitializerError,[detailMessage]); +this.initCause(null); +},"~S"); +Clazz_makeConstructor(c$, +function(exception){ +Clazz_superConstructor(this,ExceptionInInitializerError); +this.exception=exception; +this.initCause(exception); +},"Throwable"); +Clazz_defineMethod(c$,"getException", +function(){ +return this.exception; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.exception; +}); + +c$=Clazz_declareType(java.lang,"IllegalAccessError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"InstantiationError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"VirtualMachineError",Error); + +c$=Clazz_declareType(java.lang,"InternalError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"NoClassDefFoundError",LinkageError); + +c$=Clazz_declareType(java.lang,"NoSuchFieldError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"NoSuchMethodError",IncompatibleClassChangeError); + +c$=Clazz_declareType(java.lang,"OutOfMemoryError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"StackOverflowError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"UnknownError",VirtualMachineError); + +c$=Clazz_declareType(java.lang,"UnsatisfiedLinkError",LinkageError); + +c$=Clazz_declareType(java.lang,"UnsupportedClassVersionError",ClassFormatError); + +c$=Clazz_declareType(java.lang,"VerifyError",LinkageError); + +c$=Clazz_declareType(java.lang,"ThreadDeath",Error); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,ThreadDeath,[]); +}); + +c$=Clazz_declareType(java.lang,"Exception",Throwable); + +c$=Clazz_declareType(java.lang,"RuntimeException",Exception); + +c$=Clazz_declareType(java.lang,"ArithmeticException",RuntimeException); + +c$=Clazz_declareType(java.lang,"IndexOutOfBoundsException",RuntimeException); + +c$=Clazz_declareType(java.lang,"ArrayIndexOutOfBoundsException",IndexOutOfBoundsException); +Clazz_makeConstructor(c$, +function(index){ +Clazz_superConstructor(this,ArrayIndexOutOfBoundsException,["Array index out of range: "+index]); +},"~N"); + +c$=Clazz_declareType(java.lang,"ArrayStoreException",RuntimeException); + +c$=Clazz_declareType(java.lang,"ClassCastException",RuntimeException); + +c$=Clazz_decorateAsClass(function(){ +this.ex=null; +Clazz_instantialize(this,arguments); +},java.lang,"ClassNotFoundException",Exception); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,ClassNotFoundException,[Clazz_castNullAs("Throwable")]); +}); +Clazz_makeConstructor(c$, +function(detailMessage){ +Clazz_superConstructor(this,ClassNotFoundException,[detailMessage,null]); +},"~S"); +Clazz_makeConstructor(c$, +function(detailMessage,exception){ +Clazz_superConstructor(this,ClassNotFoundException,[detailMessage]); +this.ex=exception; +},"~S,Throwable"); +Clazz_defineMethod(c$,"getException", +function(){ +return this.ex; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.ex; +}); + +c$=Clazz_declareType(java.lang,"CloneNotSupportedException",Exception); + +c$=Clazz_declareType(java.lang,"IllegalAccessException",Exception); + +c$=Clazz_declareType(java.lang,"IllegalArgumentException",RuntimeException); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,IllegalArgumentException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_declareType(java.lang,"IllegalMonitorStateException",RuntimeException); + +c$=Clazz_declareType(java.lang,"IllegalStateException",RuntimeException); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,IllegalStateException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_declareType(java.lang,"IllegalThreadStateException",IllegalArgumentException); + +c$=Clazz_declareType(java.lang,"InstantiationException",Exception); + +c$=Clazz_declareType(java.lang,"InterruptedException",Exception); + +c$=Clazz_declareType(java.lang,"NegativeArraySizeException",RuntimeException); + +c$=Clazz_declareType(java.lang,"NoSuchFieldException",Exception); + +c$=Clazz_declareType(java.lang,"NoSuchMethodException",Exception); + +c$=Clazz_declareType(java.lang,"NullPointerException",RuntimeException); + +c$=Clazz_declareType(java.lang,"NumberFormatException",IllegalArgumentException); + +c$=Clazz_declareType(java.lang,"SecurityException",RuntimeException); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,SecurityException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_declareType(java.lang,"StringIndexOutOfBoundsException",IndexOutOfBoundsException); +Clazz_makeConstructor(c$, +function(index){ +Clazz_superConstructor(this,StringIndexOutOfBoundsException,["String index out of range: "+index]); +},"~N"); + +c$=Clazz_declareType(java.lang,"UnsupportedOperationException",RuntimeException); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,UnsupportedOperationException,[]); +}); +Clazz_makeConstructor(c$, +function(cause){ +Clazz_superConstructor(this,UnsupportedOperationException,[(cause==null?null:cause.toString()),cause]); +},"Throwable"); + +c$=Clazz_decorateAsClass(function(){ +this.target=null; +Clazz_instantialize(this,arguments); +},java.lang.reflect,"InvocationTargetException",Exception); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[Clazz_castNullAs("Throwable")]); +}); +Clazz_makeConstructor(c$, +function(exception){ +Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[null,exception]); +this.target=exception; +},"Throwable"); +Clazz_makeConstructor(c$, +function(exception,detailMessage){ +Clazz_superConstructor(this,java.lang.reflect.InvocationTargetException,[detailMessage,exception]); +this.target=exception; +},"Throwable,~S"); +Clazz_defineMethod(c$,"getTargetException", +function(){ +return this.target; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.target; +}); + +c$=Clazz_decorateAsClass(function(){ +this.undeclaredThrowable=null; +Clazz_instantialize(this,arguments); +},java.lang.reflect,"UndeclaredThrowableException",RuntimeException); +Clazz_makeConstructor(c$, +function(exception){ +Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException); +this.undeclaredThrowable=exception; +this.initCause(exception); +},"Throwable"); +Clazz_makeConstructor(c$, +function(exception,detailMessage){ +Clazz_superConstructor(this,java.lang.reflect.UndeclaredThrowableException,[detailMessage]); +this.undeclaredThrowable=exception; +this.initCause(exception); +},"Throwable,~S"); +Clazz_defineMethod(c$,"getUndeclaredThrowable", +function(){ +return this.undeclaredThrowable; +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.undeclaredThrowable; +}); + +c$=Clazz_declareType(java.io,"IOException",Exception); + + +c$=Clazz_declareType(java.io,"CharConversionException",java.io.IOException); + +c$=Clazz_declareType(java.io,"EOFException",java.io.IOException); + +c$=Clazz_declareType(java.io,"FileNotFoundException",java.io.IOException); + +c$=Clazz_decorateAsClass(function(){ +this.bytesTransferred=0; +Clazz_instantialize(this,arguments); +},java.io,"InterruptedIOException",java.io.IOException); + +c$=Clazz_declareType(java.io,"ObjectStreamException",java.io.IOException); + +c$=Clazz_decorateAsClass(function(){ +this.classname=null; +Clazz_instantialize(this,arguments); +},java.io,"InvalidClassException",java.io.ObjectStreamException); +Clazz_makeConstructor(c$, +function(className,detailMessage){ +Clazz_superConstructor(this,java.io.InvalidClassException,[detailMessage]); +this.classname=className; +},"~S,~S"); +Clazz_defineMethod(c$,"getMessage", +function(){ +var msg=Clazz_superCall(this,java.io.InvalidClassException,"getMessage",[]); +if(this.classname!=null){ +msg=this.classname+';' + ' '+msg; +}return msg; +}); + +c$=Clazz_declareType(java.io,"InvalidObjectException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"NotActiveException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"NotSerializableException",java.io.ObjectStreamException); + +c$=Clazz_decorateAsClass(function(){ +this.eof=false; +this.length=0; +Clazz_instantialize(this,arguments); +},java.io,"OptionalDataException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"StreamCorruptedException",java.io.ObjectStreamException); + +c$=Clazz_declareType(java.io,"SyncFailedException",java.io.IOException); + +c$=Clazz_declareType(java.io,"UnsupportedEncodingException",java.io.IOException); + +c$=Clazz_declareType(java.io,"UTFDataFormatException",java.io.IOException); + +c$=Clazz_decorateAsClass(function(){ +this.detail=null; +Clazz_instantialize(this,arguments); +},java.io,"WriteAbortedException",java.io.ObjectStreamException); +Clazz_makeConstructor(c$, +function(detailMessage,rootCause){ +Clazz_superConstructor(this,java.io.WriteAbortedException,[detailMessage]); +this.detail=rootCause; +this.initCause(rootCause); +},"~S,Exception"); +Clazz_defineMethod(c$,"getMessage", +function(){ +var msg=Clazz_superCall(this,java.io.WriteAbortedException,"getMessage",[]); +return (this.detail ? msg + "; "+this.detail.toString() : msg); +}); +Clazz_overrideMethod(c$,"getCause", +function(){ +return this.detail; +}); + +c$=Clazz_declareType(javautil,"ConcurrentModificationException",RuntimeException); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,javautil.ConcurrentModificationException,[]); +}); + +c$=Clazz_declareType(javautil,"EmptyStackException",RuntimeException); + +c$=Clazz_decorateAsClass(function(){ +this.className=null; +this.key=null; +Clazz_instantialize(this,arguments); +},javautil,"MissingResourceException",RuntimeException); +Clazz_makeConstructor(c$, +function(detailMessage,className,resourceName){ +Clazz_superConstructor(this,javautil.MissingResourceException,[detailMessage]); +this.className=className; +this.key=resourceName; +},"~S,~S,~S"); +Clazz_defineMethod(c$,"getClassName", +function(){ +return this.className; +}); +Clazz_defineMethod(c$,"getKey", +function(){ +return this.key; +}); + +c$=Clazz_declareType(javautil,"NoSuchElementException",RuntimeException); + +c$=Clazz_declareType(javautil,"TooManyListenersException",Exception); + +c$=Clazz_declareType(java.lang,"Void"); +Clazz_defineStatics(c$, +"TYPE",null); +{ +java.lang.Void.TYPE=java.lang.Void; +}Clazz_declareInterface(java.lang.reflect,"GenericDeclaration"); +Clazz_declareInterface(java.lang.reflect,"AnnotatedElement"); + +c$=Clazz_declareType(java.lang.reflect,"AccessibleObject",null,java.lang.reflect.AnnotatedElement); +Clazz_makeConstructor(c$, +function(){ +}); +Clazz_defineMethod(c$,"isAccessible", +function(){ +return false; +}); +c$.setAccessible=Clazz_defineMethod(c$,"setAccessible", +function(objects,flag){ +return; +},"~A,~B"); +Clazz_defineMethod(c$,"setAccessible", +function(flag){ +return; +},"~B"); +Clazz_overrideMethod(c$,"isAnnotationPresent", +function(annotationType){ +return false; +},"Class"); +Clazz_overrideMethod(c$,"getDeclaredAnnotations", +function(){ +return new Array(0); +}); +Clazz_overrideMethod(c$,"getAnnotations", +function(){ +return new Array(0); +}); +Clazz_overrideMethod(c$,"getAnnotation", +function(annotationType){ +return null; +},"Class"); +c$.marshallArguments=Clazz_defineMethod(c$,"marshallArguments", +function(parameterTypes,args){ +return null; +},"~A,~A"); +Clazz_defineMethod(c$,"invokeV", +function(receiver,args){ +return; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeL", +function(receiver,args){ +return null; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeI", +function(receiver,args){ +return 0; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeJ", +function(receiver,args){ +return 0; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeF", +function(receiver,args){ +return 0.0; +},"~O,~A"); +Clazz_defineMethod(c$,"invokeD", +function(receiver,args){ +return 0.0; +},"~O,~A"); +c$.emptyArgs=c$.prototype.emptyArgs=new Array(0); +Clazz_declareInterface(java.lang.reflect,"InvocationHandler"); +c$=Clazz_declareInterface(java.lang.reflect,"Member"); +Clazz_defineStatics(c$, +"PUBLIC",0, +"DECLARED",1); + +c$=Clazz_declareType(java.lang.reflect,"Modifier"); +Clazz_makeConstructor(c$, +function(){ +}); +c$.isAbstract=Clazz_defineMethod(c$,"isAbstract", +function(modifiers){ +return((modifiers&1024)!=0); +},"~N"); +c$.isFinal=Clazz_defineMethod(c$,"isFinal", +function(modifiers){ +return((modifiers&16)!=0); +},"~N"); +c$.isInterface=Clazz_defineMethod(c$,"isInterface", +function(modifiers){ +return((modifiers&512)!=0); +},"~N"); +c$.isNative=Clazz_defineMethod(c$,"isNative", +function(modifiers){ +return((modifiers&256)!=0); +},"~N"); +c$.isPrivate=Clazz_defineMethod(c$,"isPrivate", +function(modifiers){ +return((modifiers&2)!=0); +},"~N"); +c$.isProtected=Clazz_defineMethod(c$,"isProtected", +function(modifiers){ +return((modifiers&4)!=0); +},"~N"); +c$.isPublic=Clazz_defineMethod(c$,"isPublic", +function(modifiers){ +return((modifiers&1)!=0); +},"~N"); +c$.isStatic=Clazz_defineMethod(c$,"isStatic", +function(modifiers){ +return((modifiers&8)!=0); +},"~N"); +c$.isStrict=Clazz_defineMethod(c$,"isStrict", +function(modifiers){ +return((modifiers&2048)!=0); +},"~N"); +c$.isSynchronized=Clazz_defineMethod(c$,"isSynchronized", +function(modifiers){ +return((modifiers&32)!=0); +},"~N"); +c$.isTransient=Clazz_defineMethod(c$,"isTransient", +function(modifiers){ +return((modifiers&128)!=0); +},"~N"); +c$.isVolatile=Clazz_defineMethod(c$,"isVolatile", +function(modifiers){ +return((modifiers&64)!=0); +},"~N"); +c$.toString=Clazz_defineMethod(c$,"toString", +function(modifiers){ +var sb=new Array(0); +if(java.lang.reflect.Modifier.isPublic(modifiers))sb[sb.length]="public"; +if(java.lang.reflect.Modifier.isProtected(modifiers))sb[sb.length]="protected"; +if(java.lang.reflect.Modifier.isPrivate(modifiers))sb[sb.length]="private"; +if(java.lang.reflect.Modifier.isAbstract(modifiers))sb[sb.length]="abstract"; +if(java.lang.reflect.Modifier.isStatic(modifiers))sb[sb.length]="static"; +if(java.lang.reflect.Modifier.isFinal(modifiers))sb[sb.length]="final"; +if(java.lang.reflect.Modifier.isTransient(modifiers))sb[sb.length]="transient"; +if(java.lang.reflect.Modifier.isVolatile(modifiers))sb[sb.length]="volatile"; +if(java.lang.reflect.Modifier.isSynchronized(modifiers))sb[sb.length]="synchronized"; +if(java.lang.reflect.Modifier.isNative(modifiers))sb[sb.length]="native"; +if(java.lang.reflect.Modifier.isStrict(modifiers))sb[sb.length]="strictfp"; +if(java.lang.reflect.Modifier.isInterface(modifiers))sb[sb.length]="interface"; +if(sb.length>0){ +return sb.join(" "); +}return""; +},"~N"); +Clazz_defineStatics(c$, +"PUBLIC",0x1, +"PRIVATE",0x2, +"PROTECTED",0x4, +"STATIC",0x8, +"FINAL",0x10, +"SYNCHRONIZED",0x20, +"VOLATILE",0x40, +"TRANSIENT",0x80, +"NATIVE",0x100, +"INTERFACE",0x200, +"ABSTRACT",0x400, +"STRICT",0x800, +"BRIDGE",0x40, +"VARARGS",0x80, +"SYNTHETIC",0x1000, +"ANNOTATION",0x2000, +"ENUM",0x4000); + +c$=Clazz_decorateAsClass(function(){ +this.clazz=null; +this.parameterTypes=null; +this.exceptionTypes=null; +this.modifiers=0; +Clazz_instantialize(this,arguments); +},java.lang.reflect,"Constructor",java.lang.reflect.AccessibleObject,[java.lang.reflect.GenericDeclaration,java.lang.reflect.Member]); +Clazz_makeConstructor(c$, +function(declaringClass,parameterTypes,checkedExceptions,modifiers){ +Clazz_superConstructor(this,java.lang.reflect.Constructor,[]); +this.clazz=declaringClass; +this.parameterTypes=parameterTypes; +this.exceptionTypes=checkedExceptions; +this.modifiers=modifiers; +},"Class,~A,~A,~N"); +Clazz_overrideMethod(c$,"getTypeParameters", +function(){ +return null; +}); +Clazz_defineMethod(c$,"toGenericString", +function(){ +return null; +}); +Clazz_defineMethod(c$,"getGenericParameterTypes", +function(){ +return null; +}); +Clazz_defineMethod(c$,"getGenericExceptionTypes", +function(){ +return null; +}); +Clazz_defineMethod(c$,"getParameterAnnotations", +function(){ +return null; +}); +Clazz_defineMethod(c$,"isVarArgs", +function(){ +return false; +}); +Clazz_overrideMethod(c$,"isSynthetic", +function(){ +return false; +}); +Clazz_overrideMethod(c$,"equals", +function(object){ +if(object!=null&&Clazz_instanceOf(object,java.lang.reflect.Constructor)){ +var other=object; +if(this.getDeclaringClass()===other.getDeclaringClass()){ +var params1=this.parameterTypes; +var params2=other.parameterTypes; +if(params1.length==params2.length){ +for(var i=0;i 0.0) { +allzero = false; +} else if (d < 0.0) { +throw new IllegalArgumentException ("negative dash length"); +}} +if (allzero) { +throw new IllegalArgumentException ("dash lengths all zero"); +}}this.width = width; +this.cap = cap; +this.join = join; +this.miterlimit = miterlimit; +if (dash != null) { +this.dash = dash.clone (); +}this.dash_phase = dash_phase; +}, "~N,~N,~N,~N,~A,~N"); +Clazz_makeConstructor (c$, +function (width, cap, join, miterlimit) { +this.construct (width, cap, join, miterlimit, null, 0.0); +}, "~N,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (width, cap, join) { +this.construct (width, cap, join, 10.0, null, 0.0); +}, "~N,~N,~N"); +Clazz_makeConstructor (c$, +function (width) { +this.construct (width, 2, 0, 10.0, null, 0.0); +}, "~N"); +Clazz_makeConstructor (c$, +function () { +this.construct (1.0, 2, 0, 10.0, null, 0.0); +}); +Clazz_overrideMethod (c$, "createStrokedShape", +function (s) { +return s; +}, "java.awt.Shape"); +Clazz_defineMethod (c$, "getLineWidth", +function () { +return this.width; +}); +Clazz_defineMethod (c$, "getEndCap", +function () { +return this.cap; +}); +Clazz_defineMethod (c$, "getLineJoin", +function () { +return this.join; +}); +Clazz_defineMethod (c$, "getMiterLimit", +function () { +return this.miterlimit; +}); +Clazz_defineMethod (c$, "getDashArray", +function () { +if (this.dash == null) { +return null; +}return this.dash.clone (); +}); +Clazz_defineMethod (c$, "getDashPhase", +function () { +return this.dash_phase; +}); +Clazz_overrideMethod (c$, "hashCode", +function () { +var hash = Float.floatToIntBits (this.width); +hash = hash * 31 + this.join; +hash = hash * 31 + this.cap; +hash = hash * 31 + Float.floatToIntBits (this.miterlimit); +if (this.dash != null) { +hash = hash * 31 + Float.floatToIntBits (this.dash_phase); +for (var i = 0; i < this.dash.length; i++) { +hash = hash * 31 + Float.floatToIntBits (this.dash[i]); +} +}return hash; +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (!(Clazz_instanceOf (obj, java.awt.BasicStroke))) { +return false; +}var bs = obj; +if (this.width != bs.width) { +return false; +}if (this.join != bs.join) { +return false; +}if (this.cap != bs.cap) { +return false; +}if (this.miterlimit != bs.miterlimit) { +return false; +}if (this.dash != null) { +if (this.dash_phase != bs.dash_phase) { +return false; +}if (!java.util.Arrays.equals (this.dash, bs.dash)) { +return false; +}} else if (bs.dash != null) { +return false; +}return true; +}, "~O"); +Clazz_defineStatics (c$, +"JOIN_MITER", 0, +"JOIN_ROUND", 1, +"JOIN_BEVEL", 2, +"CAP_BUTT", 0, +"CAP_ROUND", 1, +"CAP_SQUARE", 2); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "Stroke"); +Clazz_declarePackage ("java.util"); +Clazz_load (["java.util.HashMap"], "java.util.Locale", ["java.lang.InternalError", "$.NullPointerException", "$.StringBuilder"], function () { +c$ = Clazz_decorateAsClass (function () { +this.language = null; +this.country = null; +this.variant = null; +this.hashCodeValue = 0; +Clazz_instantialize (this, arguments); +}, java.util, "Locale", null, [Cloneable, java.io.Serializable]); +Clazz_makeConstructor (c$, +function (language, country, variant) { +this.language = language.intern (); +this.country = country.intern (); +this.variant = variant.intern (); +}, "~S,~S,~S"); +Clazz_makeConstructor (c$, +function (language, country) { +this.construct (language, country, ""); +}, "~S,~S"); +Clazz_makeConstructor (c$, +function (language) { +this.construct (language, "", ""); +}, "~S"); +Clazz_makeConstructor (c$, + function (language, country, flag) { +this.language = language; +this.country = country; +this.variant = ""; +}, "~S,~S,~B"); +c$.createSingleton = Clazz_defineMethod (c$, "createSingleton", + function (key, language, country) { +var locale = new java.util.Locale (language, country, false); +java.util.Locale.cache.put (key, locale); +return locale; +}, "~S,~S,~S"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function (language, country, variant) { +if (language == null || country == null || variant == null) { +throw new NullPointerException (); +}var sb = new StringBuilder (); +sb.append (language).append ('_').append (country).append ('_').append (variant); +var key = sb.toString (); +var locale = java.util.Locale.cache.get (key); +if (locale == null) { +locale = new java.util.Locale (language, country, variant); +var l = java.util.Locale.cache.put (key, locale); +if (l != null) { +locale = l; +}}return locale; +}, "~S,~S,~S"); +c$.getDefault = Clazz_defineMethod (c$, "getDefault", +function () { +if (java.util.Locale.defaultLocale == null) { +var language; +var country; +var variant; +language = "en"; +country = ""; +variant = ""; +java.util.Locale.defaultLocale = java.util.Locale.getInstance (language, country, variant); +}return java.util.Locale.defaultLocale; +}); +c$.setDefault = Clazz_defineMethod (c$, "setDefault", +function (newLocale) { +if (newLocale == null) throw new NullPointerException ("Can't set default locale to NULL"); +java.util.Locale.defaultLocale = newLocale; +}, "java.util.Locale"); +Clazz_defineMethod (c$, "getLanguage", +function () { +return this.language; +}); +Clazz_defineMethod (c$, "getCountry", +function () { +return this.country; +}); +Clazz_defineMethod (c$, "getVariant", +function () { +return this.variant; +}); +Clazz_overrideMethod (c$, "toString", +function () { +var l = this.language.length != 0; +var c = this.country.length != 0; +var v = this.variant.length != 0; +var result = new StringBuilder (this.language); +if (c || (l && v)) { +result.append ('_').append (this.country); +}if (v && (l || c)) { +result.append ('_').append (this.variant); +}return result.toString (); +}); +Clazz_defineMethod (c$, "getDisplayLanguage", +function () { +return this.getDisplayLanguage (java.util.Locale.getDefault ()); +}); +Clazz_defineMethod (c$, "getDisplayLanguage", +function (inLocale) { +return this.getDisplayString (this.language, inLocale, 0); +}, "java.util.Locale"); +Clazz_defineMethod (c$, "getDisplayCountry", +function () { +return this.getDisplayCountry (java.util.Locale.getDefault ()); +}); +Clazz_defineMethod (c$, "getDisplayCountry", +function (inLocale) { +return this.getDisplayString (this.country, inLocale, 1); +}, "java.util.Locale"); +Clazz_defineMethod (c$, "getDisplayString", + function (code, inLocale, type) { +if (code.length == 0) { +return ""; +}if (inLocale == null) { +throw new NullPointerException (); +}return inLocale.toString (); +}, "~S,java.util.Locale,~N"); +Clazz_defineMethod (c$, "getDisplayVariant", +function () { +return this.getDisplayVariant (java.util.Locale.getDefault ()); +}); +Clazz_defineMethod (c$, "getDisplayVariant", +function (inLocale) { +if (this.variant.length == 0) return ""; +return this.variant; +}, "java.util.Locale"); +Clazz_defineMethod (c$, "getDisplayName", +function () { +return this.getDisplayName (java.util.Locale.getDefault ()); +}); +Clazz_defineMethod (c$, "getDisplayName", +function (inLocale) { +return inLocale.toString (); +}, "java.util.Locale"); +Clazz_defineMethod (c$, "clone", +function () { +try { +var that = Clazz_superCall (this, java.util.Locale, "clone", []); +return that; +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_overrideMethod (c$, "hashCode", +function () { +var hc = this.hashCodeValue; +if (hc == 0) { +hc = (this.language.hashCode () << 8) ^ this.country.hashCode () ^ (this.variant.hashCode () << 4); +this.hashCodeValue = hc; +}return hc; +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (this === obj) return true; +if (!(Clazz_instanceOf (obj, java.util.Locale))) return false; +var other = obj; +return this.language === other.language && this.country === other.country && this.variant === other.variant; +}, "~O"); +c$.cache = c$.prototype.cache = new java.util.HashMap (32); +c$.ENGLISH = c$.prototype.ENGLISH = java.util.Locale.createSingleton ("en__", "en", ""); +c$.ROOT = c$.prototype.ROOT = java.util.Locale.createSingleton ("__", "", ""); +Clazz_defineStatics (c$, +"DISPLAY_LANGUAGE", 0, +"DISPLAY_COUNTRY", 1, +"defaultLocale", null); +}); +Clazz_declarePackage ("java.util"); +Clazz_load (["java.util.Arrays", "$.Collections", "$.HashMap"], "java.util.ResourceBundle", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "java.lang.ClassNotFoundException", "$.IllegalArgumentException", "$.InternalError", "$.InterruptedException", "$.NullPointerException", "$.StringBuilder", "$.Thread", "java.util.ArrayList", "$.HashSet", "java.util.Locale", "$.MissingResourceException", "swingjs.JSToolkit", "swingjs.api.Interface"], function () { +c$ = Clazz_decorateAsClass (function () { +this.parent = null; +this.locale = null; +this.expired = false; +this.$keySet = null; +Clazz_instantialize (this, arguments); +}, java.util, "ResourceBundle"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "getString", +function (key) { +return this.getObject (key); +}, "~S"); +Clazz_defineMethod (c$, "getStringArray", +function (key) { +return this.getObject (key); +}, "~S"); +Clazz_defineMethod (c$, "getObject", +function (key) { +var obj = this.handleGetObject (key); +if (obj == null) { +if (this.parent != null) { +obj = this.parent.getObject (key); +}if (obj == null) throw new java.util.MissingResourceException ("Can't find resource for bundle " + this.getClass ().getName () + ", key " + key, this.getClass ().getName (), key); +}return obj; +}, "~S"); +Clazz_defineMethod (c$, "getLocale", +function () { +return this.locale; +}); +Clazz_defineMethod (c$, "setParent", +function (parent) { +this.parent = parent; +}, "java.util.ResourceBundle"); +c$.getBundle = Clazz_defineMethod (c$, "getBundle", +function (baseName, targetLocale, loader, control) { +var n = 4; +{ +n = arguments.length; +}switch (n) { +case 2: +if ((Clazz_instanceOf (targetLocale, java.util.ResourceBundle.Control))) { +control = targetLocale; +targetLocale = null; +}break; +case 3: +if ((Clazz_instanceOf (loader, java.util.ResourceBundle.Control))) { +control = loader; +loader = null; +}break; +} +if (targetLocale == null) targetLocale = java.util.Locale.getDefault (); +if (control == null) control = java.util.ResourceBundle.Control.getControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); +return java.util.ResourceBundle.getBundleImpl (baseName, targetLocale, loader, control); +}, "~S,~O,~O,java.util.ResourceBundle.Control"); +c$.getBundleImpl = Clazz_defineMethod (c$, "getBundleImpl", + function (baseName, locale, loader, control) { +if (control == null) { +throw new NullPointerException ("ResourceBundle locale or control is null"); +}var cacheKey = new java.util.ResourceBundle.CacheKey (baseName, locale, loader); +var bundle = null; +var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); +if (bundleRef != null) { +bundle = bundleRef; +bundleRef = null; +}if (java.util.ResourceBundle.isValidBundle (bundle)) { +return bundle; +}var formats = control.getFormats (baseName); +var baseBundle = null; +for (var targetLocale = locale; targetLocale != null; targetLocale = control.getFallbackLocale (baseName, targetLocale)) { +var candidateLocales = control.getCandidateLocales (baseName, targetLocale); +bundle = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, 0, control, baseBundle); +if (java.util.ResourceBundle.isValidBundle (bundle)) { +var isBaseBundle = java.util.Locale.ROOT.equals (bundle.locale); +if (!isBaseBundle || bundle.locale.equals (locale) || (candidateLocales.size () == 1 && bundle.locale.equals (candidateLocales.get (0)))) { +break; +}if (isBaseBundle && baseBundle == null) { +baseBundle = bundle; +}}} +if (bundle == null) { +if (baseBundle == null) { +java.util.ResourceBundle.throwMissingResourceException (baseName, locale, cacheKey.getCause ()); +}bundle = baseBundle; +}return bundle; +}, "~S,java.util.Locale,~O,java.util.ResourceBundle.Control"); +c$.findBundle = Clazz_defineMethod (c$, "findBundle", + function (cacheKey, candidateLocales, formats, index, control, baseBundle) { +var targetLocale = candidateLocales.get (index); +var parent = null; +if (index != candidateLocales.size () - 1) { +parent = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, index + 1, control, baseBundle); +} else if (baseBundle != null && java.util.Locale.ROOT.equals (targetLocale)) { +return baseBundle; +}var expiredBundle = false; +cacheKey.setLocale (targetLocale); +var bundle = java.util.ResourceBundle.findBundleInCache (cacheKey, control); +if (java.util.ResourceBundle.isValidBundle (bundle)) { +expiredBundle = bundle.expired; +if (!expiredBundle) { +if (bundle.parent === parent) { +return bundle; +}var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); +if (bundleRef != null && bundleRef === bundle) { +java.util.ResourceBundle.cacheList.remove (cacheKey); +}}}if (bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE) { +var constKey = cacheKey.clone (); +try { +try { +bundle = java.util.ResourceBundle.loadBundle (cacheKey, formats, control, expiredBundle); +if (bundle != null) { +if (bundle.parent == null) { +bundle.setParent (parent); +}bundle.locale = targetLocale; +bundle = java.util.ResourceBundle.putBundleInCache (cacheKey, bundle, control); +return bundle; +}java.util.ResourceBundle.putBundleInCache (cacheKey, java.util.ResourceBundle.NONEXISTENT_BUNDLE, control); +} finally { +} +} finally { +if (Clazz_instanceOf (constKey.getCause (), InterruptedException)) { +Thread.currentThread ().interrupt (); +}} +}return parent; +}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.List,~N,java.util.ResourceBundle.Control,java.util.ResourceBundle"); +c$.loadBundle = Clazz_defineMethod (c$, "loadBundle", + function (cacheKey, formats, control, reload) { +var targetLocale = cacheKey.getLocale (); +var bundle = null; +var size = formats.size (); +for (var i = 0; i < size; i++) { +var format = formats.get (i); +try { +bundle = control.newBundle (cacheKey.getName (), targetLocale, format, null, reload); +} catch (e$$) { +if (Clazz_exceptionOf (e$$, LinkageError)) { +var error = e$$; +{ +cacheKey.setCause (error); +} +} else if (Clazz_exceptionOf (e$$, Exception)) { +var cause = e$$; +{ +cacheKey.setCause (cause); +} +} else { +throw e$$; +} +} +if (bundle != null) { +cacheKey.setFormat (format); +bundle.locale = targetLocale; +bundle.expired = false; +break; +}} +return bundle; +}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.ResourceBundle.Control,~B"); +c$.isValidBundle = Clazz_defineMethod (c$, "isValidBundle", + function (bundle) { +return bundle != null && bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE; +}, "java.util.ResourceBundle"); +c$.throwMissingResourceException = Clazz_defineMethod (c$, "throwMissingResourceException", + function (baseName, locale, cause) { +if (Clazz_instanceOf (cause, java.util.MissingResourceException)) { +cause = null; +}throw new java.util.MissingResourceException ("Can't find bundle for base name " + baseName + ", locale " + locale, baseName + "_" + locale, "", cause); +}, "~S,java.util.Locale,Throwable"); +c$.findBundleInCache = Clazz_defineMethod (c$, "findBundleInCache", + function (cacheKey, control) { +var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); +if (bundleRef == null) { +return null; +}var bundle = bundleRef; +return bundle; +}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle.Control"); +c$.putBundleInCache = Clazz_defineMethod (c$, "putBundleInCache", + function (cacheKey, bundle, control) { +var key = cacheKey.clone (); +java.util.ResourceBundle.cacheList.put (key, bundle); +return bundle; +}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle,java.util.ResourceBundle.Control"); +c$.clearCache = Clazz_defineMethod (c$, "clearCache", +function () { +java.util.ResourceBundle.cacheList.clear (); +}); +Clazz_defineMethod (c$, "containsKey", +function (key) { +if (key == null) { +throw new NullPointerException (); +}for (var rb = this; rb != null; rb = rb.parent) { +if (rb.handleKeySet ().contains (key)) { +return true; +}} +return false; +}, "~S"); +Clazz_defineMethod (c$, "keySet", +function () { +var keys = new java.util.HashSet (); +for (var rb = this; rb != null; rb = rb.parent) { +keys.addAll (rb.handleKeySet ()); +} +return keys; +}); +Clazz_defineMethod (c$, "handleKeySet", +function () { +if (this.$keySet == null) { +{ +if (this.$keySet == null) { +var keys = new java.util.HashSet (); +var enumKeys = this.getKeys (); +while (enumKeys.hasMoreElements ()) { +var key = enumKeys.nextElement (); +if (this.handleGetObject (key) != null) { +keys.add (key); +}} +this.$keySet = keys; +}}}return this.$keySet; +}); +c$.$ResourceBundle$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (java.util, "ResourceBundle$1", java.util.ResourceBundle); +Clazz_defineMethod (c$, "getKeys", +function () { +return null; +}); +Clazz_defineMethod (c$, "handleGetObject", +function (key) { +return null; +}, "~S"); +Clazz_overrideMethod (c$, "toString", +function () { +return "NONEXISTENT_BUNDLE"; +}); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.name = null; +this.locale = null; +this.format = null; +this.cause = null; +this.hashCodeCache = 0; +Clazz_instantialize (this, arguments); +}, java.util.ResourceBundle, "CacheKey", null, Cloneable); +Clazz_makeConstructor (c$, +function (a, b, c) { +this.name = a; +this.locale = b; +if (this.name != null) this.calculateHashCode (); +}, "~S,java.util.Locale,~O"); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getLocale", +function () { +return this.locale; +}); +Clazz_defineMethod (c$, "setLocale", +function (a) { +if (!this.locale.equals (a)) { +this.locale = a; +this.calculateHashCode (); +}return this; +}, "java.util.Locale"); +Clazz_overrideMethod (c$, "equals", +function (a) { +if (this === a) { +return true; +}try { +var b = a; +if (this.hashCodeCache != b.hashCodeCache) { +return false; +}if (!this.name.equals (b.name)) { +return false; +}if (!this.locale.equals (b.locale)) { +return false; +}return true; +} catch (e$$) { +if (Clazz_exceptionOf (e$$, NullPointerException)) { +var e = e$$; +{ +} +} else if (Clazz_exceptionOf (e$$, ClassCastException)) { +var e = e$$; +{ +} +} else { +throw e$$; +} +} +return false; +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +return this.hashCodeCache; +}); +Clazz_defineMethod (c$, "calculateHashCode", + function () { +this.hashCodeCache = this.name.hashCode () << 3; +this.hashCodeCache ^= this.locale.hashCode (); +}); +Clazz_defineMethod (c$, "clone", +function () { +try { +var a = Clazz_superCall (this, java.util.ResourceBundle.CacheKey, "clone", []); +a.cause = null; +return a; +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_defineMethod (c$, "setFormat", +function (a) { +this.format = a; +}, "~S"); +Clazz_defineMethod (c$, "setCause", + function (a) { +if (this.cause == null) { +this.cause = a; +} else { +if (Clazz_instanceOf (this.cause, ClassNotFoundException)) { +this.cause = a; +}}}, "Throwable"); +Clazz_defineMethod (c$, "getCause", + function () { +return this.cause; +}); +Clazz_overrideMethod (c$, "toString", +function () { +var a = this.locale.toString (); +if (a.length == 0) { +if (this.locale.getVariant ().length != 0) { +a = "__" + this.locale.getVariant (); +} else { +a = "\"\""; +}}return "CacheKey[" + this.name + ", lc=" + a + "(format=" + this.format + ")]"; +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.util.ResourceBundle, "Control"); +Clazz_makeConstructor (c$, +function () { +}); +c$.getControl = Clazz_defineMethod (c$, "getControl", +function (a) { +if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { +return java.util.ResourceBundle.SingleFormatControl.PROPERTIES_ONLY; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { +return java.util.ResourceBundle.SingleFormatControl.CLASS_ONLY; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { +return java.util.ResourceBundle.Control.INSTANCE; +}throw new IllegalArgumentException (); +}, "java.util.List"); +c$.getNoFallbackControl = Clazz_defineMethod (c$, "getNoFallbackControl", +function (a) { +if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { +return java.util.ResourceBundle.NoFallbackControl.NO_FALLBACK; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { +return java.util.ResourceBundle.NoFallbackControl.PROPERTIES_ONLY_NO_FALLBACK; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { +return java.util.ResourceBundle.NoFallbackControl.CLASS_ONLY_NO_FALLBACK; +}throw new IllegalArgumentException (); +}, "java.util.List"); +Clazz_defineMethod (c$, "getFormats", +function (a) { +if (a == null) { +throw new NullPointerException (); +}return java.util.ResourceBundle.Control.FORMAT_DEFAULT; +}, "~S"); +Clazz_defineMethod (c$, "getCandidateLocales", +function (a, b) { +if (a == null) { +throw new NullPointerException (); +}var c = b.getLanguage (); +var d = b.getCountry (); +var e = b.getVariant (); +var f = new java.util.ArrayList (4); +if (e.length > 0) { +f.add (b); +}if (d.length > 0) { +f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, d, "")); +}if (c.length > 0) { +f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, "", "")); +}f.add (java.util.Locale.ROOT); +return f; +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "getFallbackLocale", +function (a, b) { +if (a == null) { +throw new NullPointerException (); +}var c = java.util.Locale.getDefault (); +return b.equals (c) ? null : c; +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "newBundle", +function (a, b, c, d, e) { +var f = this.toBundleName (a, b); +var g = null; +if (c.equals ("java.class")) { +g = swingjs.api.Interface.getInstance (f, false); +} else if (c.equals ("java.properties")) { +var h = this.toResourceName0 (f, "properties"); +if (h == null) { +return null; +}var i = swingjs.JSToolkit.getJavaResource (h); +var j = null; +j = (i == null ? null : new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (i.getBytes ()))); +if (j != null) { +try { +g = this.newPropertyBundle (j); +} finally { +j.close (); +} +}} else { +throw new IllegalArgumentException ("unknown format: " + c); +}return g; +}, "~S,java.util.Locale,~S,~O,~B"); +Clazz_defineMethod (c$, "newPropertyBundle", + function (a) { +return (swingjs.api.Interface.getInstance ("java.util.PropertyResourceBundle", false)).setStream (a); +}, "java.io.InputStream"); +Clazz_defineMethod (c$, "getTimeToLive", +function (a, b) { +if (a == null || b == null) { +throw new NullPointerException (); +}return -2; +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "toBundleName", +function (a, b) { +if (b === java.util.Locale.ROOT) { +return a; +}var c = b.getLanguage (); +var d = b.getCountry (); +var e = b.getVariant (); +if (c === "" && d === "" && e === "") { +return a; +}var f = new StringBuilder (a); +f.append ('_'); +if (e !== "") { +f.append (c).append ('_').append (d).append ('_').append (e); +} else if (d !== "") { +f.append (c).append ('_').append (d); +} else { +f.append (c); +}return f.toString (); +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "toResourceName", +function (a, b) { +var c = new StringBuilder (a.length + 1 + b.length); +c.append (a.$replace ('.', '/')).append ('.').append (b); +return c.toString (); +}, "~S,~S"); +Clazz_defineMethod (c$, "toResourceName0", + function (a, b) { +if (a.contains ("://")) { +return null; +} else { +return this.toResourceName (a, b); +}}, "~S,~S"); +c$.FORMAT_DEFAULT = c$.prototype.FORMAT_DEFAULT = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class", "java.properties"])); +c$.FORMAT_CLASS = c$.prototype.FORMAT_CLASS = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class"])); +c$.FORMAT_PROPERTIES = c$.prototype.FORMAT_PROPERTIES = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.properties"])); +Clazz_defineStatics (c$, +"TTL_DONT_CACHE", -1, +"TTL_NO_EXPIRATION_CONTROL", -2); +c$.INSTANCE = c$.prototype.INSTANCE = new java.util.ResourceBundle.Control (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.formats = null; +Clazz_instantialize (this, arguments); +}, java.util.ResourceBundle, "SingleFormatControl", java.util.ResourceBundle.Control); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.util.ResourceBundle.SingleFormatControl, []); +this.formats = a; +}, "java.util.List"); +Clazz_overrideMethod (c$, "getFormats", +function (a) { +if (a == null) { +throw new NullPointerException (); +}return this.formats; +}, "~S"); +c$.PROPERTIES_ONLY = c$.prototype.PROPERTIES_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); +c$.CLASS_ONLY = c$.prototype.CLASS_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_CLASS); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.util.ResourceBundle, "NoFallbackControl", java.util.ResourceBundle.SingleFormatControl); +Clazz_overrideMethod (c$, "getFallbackLocale", +function (a, b) { +if (a == null || b == null) { +throw new NullPointerException (); +}return null; +}, "~S,java.util.Locale"); +c$.NO_FALLBACK = c$.prototype.NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_DEFAULT); +c$.PROPERTIES_ONLY_NO_FALLBACK = c$.prototype.PROPERTIES_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); +c$.CLASS_ONLY_NO_FALLBACK = c$.prototype.CLASS_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_CLASS); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"INITIAL_CACHE_SIZE", 32); +c$.NONEXISTENT_BUNDLE = c$.prototype.NONEXISTENT_BUNDLE = ((Clazz_isClassDefined ("java.util.ResourceBundle$1") ? 0 : java.util.ResourceBundle.$ResourceBundle$1$ ()), Clazz_innerTypeInstance (java.util.ResourceBundle$1, this, null)); +c$.cacheList = c$.prototype.cacheList = new java.util.HashMap (32); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["javajs.api.GenericLineReader"], "JU.Rdr", ["java.io.BufferedInputStream", "$.BufferedReader", "$.ByteArrayInputStream", "$.InputStreamReader", "$.StringReader", "JU.AU", "$.Base64", "$.Encoding", "$.SB"], function () { +c$ = Clazz_decorateAsClass (function () { +this.reader = null; +Clazz_instantialize (this, arguments); +}, JU, "Rdr", null, javajs.api.GenericLineReader); +Clazz_makeConstructor (c$, +function (reader) { +this.reader = reader; +}, "java.io.BufferedReader"); +Clazz_overrideMethod (c$, "readNextLine", +function () { +return this.reader.readLine (); +}); +c$.readCifData = Clazz_defineMethod (c$, "readCifData", +function (parser, br) { +return parser.set (null, br).getAllCifData (); +}, "javajs.api.GenericCifDataParser,java.io.BufferedReader"); +c$.fixUTF = Clazz_defineMethod (c$, "fixUTF", +function (bytes) { +var encoding = JU.Rdr.getUTFEncoding (bytes); +if (encoding !== JU.Encoding.NONE) try { +var s = String.instantialize (bytes, encoding.name ().$replace ('_', '-')); +switch (encoding) { +case JU.Encoding.UTF8: +case JU.Encoding.UTF_16BE: +case JU.Encoding.UTF_16LE: +s = s.substring (1); +break; +default: +break; +} +return s; +} catch (e) { +if (Clazz_exceptionOf (e, java.io.UnsupportedEncodingException)) { +System.out.println (e); +} else { +throw e; +} +} +return String.instantialize (bytes); +}, "~A"); +c$.getUTFEncoding = Clazz_defineMethod (c$, "getUTFEncoding", + function (bytes) { +if (bytes.length >= 3 && bytes[0] == 0xEF && bytes[1] == 0xBB && bytes[2] == 0xBF) return JU.Encoding.UTF8; +if (bytes.length >= 4 && bytes[0] == 0 && bytes[1] == 0 && bytes[2] == 0xFE && bytes[3] == 0xFF) return JU.Encoding.UTF_32BE; +if (bytes.length >= 4 && bytes[0] == 0xFF && bytes[1] == 0xFE && bytes[2] == 0 && bytes[3] == 0) return JU.Encoding.UTF_32LE; +if (bytes.length >= 2 && bytes[0] == 0xFF && bytes[1] == 0xFE) return JU.Encoding.UTF_16LE; +if (bytes.length >= 2 && bytes[0] == 0xFE && bytes[1] == 0xFF) return JU.Encoding.UTF_16BE; +return JU.Encoding.NONE; +}, "~A"); +c$.getUTFEncodingForStream = Clazz_defineMethod (c$, "getUTFEncodingForStream", + function (is) { +{ +is.resetStream(); +}var abMagic = Clazz_newByteArray (4, 0); +abMagic[3] = 1; +try { +is.mark (5); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +return JU.Encoding.NONE; +} else { +throw e; +} +} +is.read (abMagic, 0, 4); +is.reset (); +return JU.Rdr.getUTFEncoding (abMagic); +}, "java.io.BufferedInputStream"); +c$.isBase64 = Clazz_defineMethod (c$, "isBase64", +function (sb) { +return (sb.indexOf (";base64,") == 0); +}, "JU.SB"); +c$.isCompoundDocumentS = Clazz_defineMethod (c$, "isCompoundDocumentS", +function (is) { +return JU.Rdr.isCompoundDocumentB (JU.Rdr.getMagic (is, 8)); +}, "java.io.InputStream"); +c$.isCompoundDocumentB = Clazz_defineMethod (c$, "isCompoundDocumentB", +function (bytes) { +return (bytes.length >= 8 && bytes[0] == 0xD0 && bytes[1] == 0xCF && bytes[2] == 0x11 && bytes[3] == 0xE0 && bytes[4] == 0xA1 && bytes[5] == 0xB1 && bytes[6] == 0x1A && bytes[7] == 0xE1); +}, "~A"); +c$.isGzipS = Clazz_defineMethod (c$, "isGzipS", +function (is) { +return JU.Rdr.isGzipB (JU.Rdr.getMagic (is, 2)); +}, "java.io.InputStream"); +c$.isGzipB = Clazz_defineMethod (c$, "isGzipB", +function (bytes) { +return (bytes != null && bytes.length >= 2 && bytes[0] == 0x1F && bytes[1] == 0x8B); +}, "~A"); +c$.isPickleS = Clazz_defineMethod (c$, "isPickleS", +function (is) { +return JU.Rdr.isPickleB (JU.Rdr.getMagic (is, 2)); +}, "java.io.InputStream"); +c$.isPickleB = Clazz_defineMethod (c$, "isPickleB", +function (bytes) { +return (bytes != null && bytes.length >= 2 && bytes[0] == 0x7D && bytes[1] == 0x71); +}, "~A"); +c$.isPngZipStream = Clazz_defineMethod (c$, "isPngZipStream", +function (is) { +return JU.Rdr.isPngZipB (JU.Rdr.getMagic (is, 55)); +}, "java.io.InputStream"); +c$.isPngZipB = Clazz_defineMethod (c$, "isPngZipB", +function (bytes) { +return (bytes[50] == 0 && bytes[51] == 0x50 && bytes[52] == 0x4E && bytes[53] == 0x47 && bytes[54] == 0x4A); +}, "~A"); +c$.isZipS = Clazz_defineMethod (c$, "isZipS", +function (is) { +return JU.Rdr.isZipB (JU.Rdr.getMagic (is, 4)); +}, "java.io.InputStream"); +c$.isZipB = Clazz_defineMethod (c$, "isZipB", +function (bytes) { +return (bytes.length >= 4 && bytes[0] == 0x50 && bytes[1] == 0x4B && bytes[2] == 0x03 && bytes[3] == 0x04); +}, "~A"); +c$.getMagic = Clazz_defineMethod (c$, "getMagic", + function (is, n) { +var abMagic = Clazz_newByteArray (n, 0); +{ +is.resetStream(); +}try { +is.mark (n + 1); +is.read (abMagic, 0, n); +} catch (e) { +if (Clazz_exceptionOf (e, java.io.IOException)) { +} else { +throw e; +} +} +try { +is.reset (); +} catch (e) { +if (Clazz_exceptionOf (e, java.io.IOException)) { +} else { +throw e; +} +} +return abMagic; +}, "java.io.InputStream,~N"); +c$.getBIS = Clazz_defineMethod (c$, "getBIS", +function (bytes) { +return new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (bytes)); +}, "~A"); +c$.getBR = Clazz_defineMethod (c$, "getBR", +function (string) { +return new java.io.BufferedReader ( new java.io.StringReader (string)); +}, "~S"); +c$.getUnzippedInputStream = Clazz_defineMethod (c$, "getUnzippedInputStream", +function (jzt, bis) { +while (JU.Rdr.isGzipS (bis)) bis = new java.io.BufferedInputStream (JU.Rdr.newGZIPInputStream (jzt, bis)); + +return bis; +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream"); +c$.getBytesFromSB = Clazz_defineMethod (c$, "getBytesFromSB", +function (sb) { +return (JU.Rdr.isBase64 (sb) ? JU.Base64.decodeBase64 (sb.substring (8)) : sb.toBytes (0, -1)); +}, "JU.SB"); +c$.getStreamAsBytes = Clazz_defineMethod (c$, "getStreamAsBytes", +function (bis, out) { +var buf = Clazz_newByteArray (1024, 0); +var bytes = (out == null ? Clazz_newByteArray (4096, 0) : null); +var len = 0; +var totalLen = 0; +while ((len = bis.read (buf, 0, 1024)) > 0) { +totalLen += len; +if (out == null) { +if (totalLen >= bytes.length) bytes = JU.AU.ensureLengthByte (bytes, totalLen * 2); +System.arraycopy (buf, 0, bytes, totalLen - len, len); +} else { +out.write (buf, 0, len); +}} +bis.close (); +if (out == null) { +return JU.AU.arrayCopyByte (bytes, totalLen); +}return totalLen + " bytes"; +}, "java.io.BufferedInputStream,JU.OC"); +c$.getBufferedReader = Clazz_defineMethod (c$, "getBufferedReader", +function (bis, charSet) { +if (JU.Rdr.getUTFEncodingForStream (bis) === JU.Encoding.NONE) return new java.io.BufferedReader ( new java.io.InputStreamReader (bis, (charSet == null ? "UTF-8" : charSet))); +var bytes = JU.Rdr.getLimitedStreamBytes (bis, -1); +bis.close (); +return JU.Rdr.getBR (charSet == null ? JU.Rdr.fixUTF (bytes) : String.instantialize (bytes, charSet)); +}, "java.io.BufferedInputStream,~S"); +c$.getLimitedStreamBytes = Clazz_defineMethod (c$, "getLimitedStreamBytes", +function (is, n) { +var buflen = (n > 0 && n < 1024 ? n : 1024); +var buf = Clazz_newByteArray (buflen, 0); +var bytes = Clazz_newByteArray (n < 0 ? 4096 : n, 0); +var len = 0; +var totalLen = 0; +if (n < 0) n = 2147483647; +while (totalLen < n && (len = is.read (buf, 0, buflen)) > 0) { +totalLen += len; +if (totalLen > bytes.length) bytes = JU.AU.ensureLengthByte (bytes, totalLen * 2); +System.arraycopy (buf, 0, bytes, totalLen - len, len); +if (n != 2147483647 && totalLen + buflen > bytes.length) buflen = bytes.length - totalLen; +} +if (totalLen == bytes.length) return bytes; +buf = Clazz_newByteArray (totalLen, 0); +System.arraycopy (bytes, 0, buf, 0, totalLen); +return buf; +}, "java.io.InputStream,~N"); +c$.StreamToUTF8String = Clazz_defineMethod (c$, "StreamToUTF8String", +function (bis) { +var data = new Array (1); +try { +JU.Rdr.readAllAsString (JU.Rdr.getBufferedReader (bis, "UTF-8"), -1, true, data, 0); +} catch (e) { +if (Clazz_exceptionOf (e, java.io.IOException)) { +} else { +throw e; +} +} +return data[0]; +}, "java.io.BufferedInputStream"); +c$.readAllAsString = Clazz_defineMethod (c$, "readAllAsString", +function (br, nBytesMax, allowBinary, data, i) { +try { +var sb = JU.SB.newN (8192); +var line; +if (nBytesMax < 0) { +line = br.readLine (); +if (allowBinary || line != null && line.indexOf ('\0') < 0 && (line.length != 4 || line.charCodeAt (0) != 65533 || line.indexOf ("PNG") != 1)) { +sb.append (line).appendC ('\n'); +while ((line = br.readLine ()) != null) sb.append (line).appendC ('\n'); + +}} else { +var n = 0; +var len; +while (n < nBytesMax && (line = br.readLine ()) != null) { +if (nBytesMax - n < (len = line.length) + 1) line = line.substring (0, nBytesMax - n - 1); +sb.append (line).appendC ('\n'); +n += len + 1; +} +}br.close (); +data[i] = sb.toString (); +return true; +} catch (ioe) { +if (Clazz_exceptionOf (ioe, Exception)) { +data[i] = ioe.toString (); +return false; +} else { +throw ioe; +} +} +}, "java.io.BufferedReader,~N,~B,~A,~N"); +c$.getPngZipPointAndCount = Clazz_defineMethod (c$, "getPngZipPointAndCount", +function (bis, pt_count) { +bis.mark (75); +try { +var data = JU.Rdr.getLimitedStreamBytes (bis, 74); +bis.reset (); +var pt = 0; +for (var i = 64, f = 1; --i > 54; f *= 10) pt += (data[i] - 48) * f; + +var n = 0; +for (var i = 74, f = 1; --i > 64; f *= 10) n += (data[i] - 48) * f; + +pt_count[0] = pt; +pt_count[1] = n; +} catch (e) { +pt_count[1] = 0; +} +}, "java.io.BufferedInputStream,~A"); +c$.getPngZipStream = Clazz_defineMethod (c$, "getPngZipStream", +function (bis, asNewStream) { +if (!JU.Rdr.isPngZipStream (bis)) return bis; +var data = Clazz_newByteArray (0, 0); +bis.mark (75); +try { +var pt_count = Clazz_newIntArray (2, 0); +JU.Rdr.getPngZipPointAndCount (bis, pt_count); +if (pt_count[1] != 0) { +var pt = pt_count[0]; +while (pt > 0) pt -= bis.skip (pt); + +if (!asNewStream) return bis; +data = JU.Rdr.getLimitedStreamBytes (bis, pt_count[1]); +}} catch (e) { +} finally { +try { +if (asNewStream) bis.close (); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +} else { +throw e; +} +} +} +return JU.Rdr.getBIS (data); +}, "java.io.BufferedInputStream,~B"); +c$.readFileAsMap = Clazz_defineMethod (c$, "readFileAsMap", +function (jzt, is, bdata, name) { +jzt.readFileAsMap (is, bdata, name); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,java.util.Map,~S"); +c$.getZipDirectoryAsStringAndClose = Clazz_defineMethod (c$, "getZipDirectoryAsStringAndClose", +function (jzt, t) { +return jzt.getZipDirectoryAsStringAndClose (t); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream"); +c$.newGZIPInputStream = Clazz_defineMethod (c$, "newGZIPInputStream", +function (jzt, bis) { +return jzt.newGZIPInputStream (bis); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream"); +c$.newZipInputStream = Clazz_defineMethod (c$, "newZipInputStream", +function (jzt, $in) { +return jzt.newZipInputStream ($in); +}, "javajs.api.GenericZipTools,java.io.InputStream"); +c$.getZipFileDirectory = Clazz_defineMethod (c$, "getZipFileDirectory", +function (jzt, bis, subFileList, listPtr, asBufferedInputStream) { +return jzt.getZipFileDirectory (jzt, bis, subFileList, listPtr, asBufferedInputStream); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~A,~N,~B"); +c$.getZipDirectoryAndClose = Clazz_defineMethod (c$, "getZipDirectoryAndClose", +function (jzt, t, manifestID) { +return jzt.getZipDirectoryAndClose (t, manifestID); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~S"); +c$.getAllZipData = Clazz_defineMethod (c$, "getAllZipData", +function (jzt, bis, subFileList, replace, string, fileData) { +jzt.getAllZipData (bis, subFileList, replace, string, fileData); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~A,~S,~S,java.util.Map"); +c$.getZipFileContentsAsBytes = Clazz_defineMethod (c$, "getZipFileContentsAsBytes", +function (jzt, bis, subFileList, i) { +return jzt.getZipFileContentsAsBytes (bis, subFileList, i); +}, "javajs.api.GenericZipTools,java.io.BufferedInputStream,~A,~N"); +c$.addZipEntry = Clazz_defineMethod (c$, "addZipEntry", +function (jzt, zos, fileName) { +jzt.addZipEntry (zos, fileName); +}, "javajs.api.GenericZipTools,~O,~S"); +c$.closeZipEntry = Clazz_defineMethod (c$, "closeZipEntry", +function (jzt, zos) { +jzt.closeZipEntry (zos); +}, "javajs.api.GenericZipTools,~O"); +c$.getZipOutputStream = Clazz_defineMethod (c$, "getZipOutputStream", +function (jzt, bos) { +return jzt.getZipOutputStream (bos); +}, "javajs.api.GenericZipTools,~O"); +c$.getCrcValue = Clazz_defineMethod (c$, "getCrcValue", +function (jzt, bytes) { +return jzt.getCrcValue (bytes); +}, "javajs.api.GenericZipTools,~A"); +c$.getZipRoot = Clazz_defineMethod (c$, "getZipRoot", +function (fileName) { +var pt = fileName.indexOf ("|"); +return (pt < 0 ? fileName : fileName.substring (0, pt)); +}, "~S"); +}); +Clazz_declarePackage ("javajs.api"); +Clazz_declareInterface (javajs.api, "GenericLineReader"); +Clazz_load (["java.io.FilterInputStream"], "java.io.BufferedInputStream", ["java.io.IOException", "java.lang.IndexOutOfBoundsException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.buf = null; +this.count = 0; +this.pos = 0; +this.markpos = -1; +this.marklimit = 0; +Clazz_instantialize (this, arguments); +}, java.io, "BufferedInputStream", java.io.FilterInputStream); +Clazz_defineMethod (c$, "getInIfOpen", + function () { +var input = this.$in; +if (input == null) throw new java.io.IOException ("Stream closed"); +return input; +}); +Clazz_defineMethod (c$, "getBufIfOpen", + function () { +var buffer = this.buf; +if (buffer == null) throw new java.io.IOException ("Stream closed"); +return buffer; +}); +Clazz_overrideMethod (c$, "resetStream", +function () { +}); +Clazz_makeConstructor (c$, +function ($in) { +Clazz_superConstructor (this, java.io.BufferedInputStream, [$in]); +this.buf = Clazz_newByteArray (8192, 0); +}, "java.io.InputStream"); +Clazz_defineMethod (c$, "fill", + function () { +var buffer = this.getBufIfOpen (); +if (this.markpos < 0) this.pos = 0; + else if (this.pos >= buffer.length) if (this.markpos > 0) { +var sz = this.pos - this.markpos; +System.arraycopy (buffer, this.markpos, buffer, 0, sz); +this.pos = sz; +this.markpos = 0; +} else if (buffer.length >= this.marklimit) { +this.markpos = -1; +this.pos = 0; +} else { +var nsz = this.pos * 2; +if (nsz > this.marklimit) nsz = this.marklimit; +var nbuf = Clazz_newByteArray (nsz, 0); +System.arraycopy (buffer, 0, nbuf, 0, this.pos); +buffer = this.buf = nbuf; +}this.count = this.pos; +var n = this.getInIfOpen ().read (buffer, this.pos, buffer.length - this.pos); +if (n > 0) this.count = n + this.pos; +}); +Clazz_overrideMethod (c$, "readByteAsInt", +function () { +if (this.pos >= this.count) { +this.fill (); +if (this.pos >= this.count) return -1; +}return this.getBufIfOpen ()[this.pos++] & 0xff; +}); +Clazz_defineMethod (c$, "read1", + function (b, off, len) { +var avail = this.count - this.pos; +if (avail <= 0) { +if (len >= this.getBufIfOpen ().length && this.markpos < 0) { +return this.getInIfOpen ().read (b, off, len); +}this.fill (); +avail = this.count - this.pos; +if (avail <= 0) return -1; +}var cnt = (avail < len) ? avail : len; +System.arraycopy (this.getBufIfOpen (), this.pos, b, off, cnt); +this.pos += cnt; +return cnt; +}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "read", +function (b, off, len) { +if (arguments.length == 1) { + off = 0; + len = b.length; +} +this.getBufIfOpen (); +if ((off | len | (off + len) | (b.length - (off + len))) < 0) { +throw new IndexOutOfBoundsException (); +} else if (len == 0) { +return 0; +}var n = 0; +for (; ; ) { +var nread = this.read1 (b, off + n, len - n); +if (nread <= 0) return (n == 0) ? nread : n; +n += nread; +if (n >= len) return n; +var input = this.$in; +if (input != null && input.available () <= 0) return n; +} +}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "skip", +function (n) { +this.getBufIfOpen (); +if (n <= 0) { +return 0; +}var avail = this.count - this.pos; +if (avail <= 0) { +if (this.markpos < 0) return this.getInIfOpen ().skip (n); +this.fill (); +avail = this.count - this.pos; +if (avail <= 0) return 0; +}var skipped = (avail < n) ? avail : n; +this.pos += skipped; +return skipped; +}, "~N"); +Clazz_overrideMethod (c$, "available", +function () { +var n = this.count - this.pos; +var avail = this.getInIfOpen ().available (); +return n > (2147483647 - avail) ? 2147483647 : n + avail; +}); +Clazz_overrideMethod (c$, "mark", +function (readlimit) { +this.marklimit = readlimit; +this.markpos = this.pos; +}, "~N"); +Clazz_overrideMethod (c$, "reset", +function () { +this.getBufIfOpen (); +if (this.markpos < 0) throw new java.io.IOException ("Resetting to invalid mark"); +this.pos = this.markpos; +}); +Clazz_overrideMethod (c$, "markSupported", +function () { +return true; +}); +Clazz_overrideMethod (c$, "close", +function () { +var input = this.$in; +this.$in = null; +if (input != null) input.close (); +return; +}); +Clazz_defineStatics (c$, +"DEFAULT_BUFFER_SIZE", 8192); +}); +Clazz_load (["java.io.InputStream"], "java.io.FilterInputStream", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.$in = null; +Clazz_instantialize (this, arguments); +}, java.io, "FilterInputStream", java.io.InputStream); +Clazz_makeConstructor (c$, +function ($in) { +Clazz_superConstructor (this, java.io.FilterInputStream, []); +this.$in = $in; +}, "java.io.InputStream"); +Clazz_defineMethod (c$, "readByteAsInt", +function () { +return this.$in.readByteAsInt (); +}); +Clazz_defineMethod (c$, "read", +function (b, off, len) { + if (arguments.length == 1) { off = 0; len = b.length; } +return this.$in.read (b, off, len); +}, "~A,~N,~N"); +Clazz_defineMethod (c$, "skip", +function (n) { +return this.$in.skip (n); +}, "~N"); +Clazz_defineMethod (c$, "available", +function () { +return this.$in.available (); +}); +Clazz_defineMethod (c$, "close", +function () { +this.$in.close (); +}); +Clazz_defineMethod (c$, "mark", +function (readlimit) { +this.$in.mark (readlimit); +}, "~N"); +Clazz_defineMethod (c$, "reset", +function () { +this.$in.reset (); +}); +Clazz_defineMethod (c$, "markSupported", +function () { +return this.$in.markSupported (); +}); +}); +Clazz_load (null, "java.io.InputStream", ["java.io.IOException", "java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () { +c$ = Clazz_declareType (java.io, "InputStream"); +Clazz_defineMethod (c$, "read", +function (b, off, len) { +if (b == null) { +throw new NullPointerException (); +} + if (arguments.length == 1) { off = 0; len = b.length; } + +if (off < 0 || len < 0 || len > b.length - off) { +throw new IndexOutOfBoundsException (); +} else if (len == 0) { +return 0; +}var c = this.readByteAsInt (); +if (c == -1) { +return -1; +}b[off] = c; +var i = 1; +try { +for (; i < len; i++) { +c = this.readByteAsInt (); +if (c == -1) { +break; +}b[off + i] = c; +} +} catch (ee) { +if (Clazz_exceptionOf (ee, java.io.IOException)) { +} else { +throw ee; +} +} +return i; +}, "~A,~N,~N"); +Clazz_defineMethod (c$, "skip", +function (n) { +var remaining = n; +var nr; +if (java.io.InputStream.skipBuffer == null) java.io.InputStream.skipBuffer = Clazz_newByteArray (2048, 0); +var localSkipBuffer = java.io.InputStream.skipBuffer; +if (n <= 0) { +return 0; +}while (remaining > 0) { +nr = this.read (localSkipBuffer, 0, Math.min (2048, remaining)); +if (nr < 0) { +break; +}remaining -= nr; +} +return n - remaining; +}, "~N"); +Clazz_defineMethod (c$, "available", +function () { +return 0; +}); +Clazz_defineMethod (c$, "close", +function () { +}); +Clazz_defineMethod (c$, "mark", +function (readlimit) { +}, "~N"); +Clazz_defineMethod (c$, "reset", +function () { +throw new java.io.IOException ("mark/reset not supported"); +}); +Clazz_defineMethod (c$, "markSupported", +function () { +return false; +}); +Clazz_defineMethod (c$, "resetStream", +function () { +}); +Clazz_defineStatics (c$, +"SKIP_BUFFER_SIZE", 2048, +"skipBuffer", null); +}); +Clazz_load (["java.io.Reader"], "java.io.BufferedReader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "JU.SB"], function () { +c$ = Clazz_decorateAsClass (function () { +this.$in = null; +this.cb = null; +this.nChars = 0; +this.nextChar = 0; +this.markedChar = -1; +this.readAheadLimit = 0; +this.skipLF = false; +this.markedSkipLF = false; +Clazz_instantialize (this, arguments); +}, java.io, "BufferedReader", java.io.Reader); +Clazz_defineMethod (c$, "setSize", + function (sz) { +if (sz <= 0) throw new IllegalArgumentException ("Buffer size <= 0"); +this.cb = Clazz_newCharArray (sz, '\0'); +this.nextChar = this.nChars = 0; +}, "~N"); +Clazz_makeConstructor (c$, +function ($in) { +Clazz_superConstructor (this, java.io.BufferedReader, [$in]); +this.$in = $in; +this.setSize (8192); +}, "java.io.Reader"); +Clazz_defineMethod (c$, "ensureOpen", + function () { +if (this.$in == null) throw new java.io.IOException ("Stream closed"); +}); +Clazz_defineMethod (c$, "fill", + function () { +var dst; +if (this.markedChar <= -1) { +dst = 0; +} else { +var delta = this.nextChar - this.markedChar; +if (delta >= this.readAheadLimit) { +this.markedChar = -2; +this.readAheadLimit = 0; +dst = 0; +} else { +if (this.readAheadLimit <= this.cb.length) { +System.arraycopy (this.cb, this.markedChar, this.cb, 0, delta); +this.markedChar = 0; +dst = delta; +} else { +var ncb = Clazz_newCharArray (this.readAheadLimit, '\0'); +System.arraycopy (this.cb, this.markedChar, ncb, 0, delta); +this.cb = ncb; +this.markedChar = 0; +dst = delta; +}this.nextChar = this.nChars = delta; +}}var n; +do { +n = this.$in.read (this.cb, dst, this.cb.length - dst); +} while (n == 0); +if (n > 0) { +this.nChars = dst + n; +this.nextChar = dst; +}}); +Clazz_defineMethod (c$, "read1", + function (cbuf, off, len) { +if (this.nextChar >= this.nChars) { +if (len >= this.cb.length && this.markedChar <= -1 && !this.skipLF) { +return this.$in.read (cbuf, off, len); +}this.fill (); +}if (this.nextChar >= this.nChars) return -1; +if (this.skipLF) { +this.skipLF = false; +if (this.cb[this.nextChar] == '\n') { +this.nextChar++; +if (this.nextChar >= this.nChars) this.fill (); +if (this.nextChar >= this.nChars) return -1; +}}var n = Math.min (len, this.nChars - this.nextChar); +System.arraycopy (this.cb, this.nextChar, cbuf, off, n); +this.nextChar += n; +return n; +}, "~A,~N,~N"); +Clazz_defineMethod (c$, "read", +function (cbuf, off, len) { +{ +this.ensureOpen (); +if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) { +throw new IndexOutOfBoundsException (); +} else if (len == 0) { +return 0; +}var n = this.read1 (cbuf, off, len); +if (n <= 0) return n; +while ((n < len) && this.$in.ready ()) { +var n1 = this.read1 (cbuf, off + n, len - n); +if (n1 <= 0) break; +n += n1; +} +return n; +}}, "~A,~N,~N"); +Clazz_defineMethod (c$, "readLine1", + function (ignoreLF) { +var s = null; +var startChar; +{ +this.ensureOpen (); +var omitLF = ignoreLF || this.skipLF; +for (; ; ) { +if (this.nextChar >= this.nChars) this.fill (); +if (this.nextChar >= this.nChars) { +if (s != null && s.length () > 0) return s.toString (); +return null; +}var eol = false; +var c = String.fromCharCode (0); +var i; +if (omitLF && (this.cb[this.nextChar] == '\n')) this.nextChar++; +this.skipLF = false; +omitLF = false; +charLoop : for (i = this.nextChar; i < this.nChars; i++) { +c = this.cb[i]; +if ((c == '\n') || (c == '\r')) { +eol = true; +break charLoop; +}} +startChar = this.nextChar; +this.nextChar = i; +if (eol) { +var str; +if (s == null) { +str = String.instantialize (this.cb, startChar, i - startChar); +} else { +s.appendCB (this.cb, startChar, i - startChar); +str = s.toString (); +}this.nextChar++; +if (c == '\r') { +this.skipLF = true; +}return str; +}if (s == null) s = JU.SB.newN (80); +s.appendCB (this.cb, startChar, i - startChar); +} +}}, "~B"); +Clazz_defineMethod (c$, "readLine", +function () { +return this.readLine1 (false); +}); +Clazz_overrideMethod (c$, "skip", +function (n) { +if (n < 0) { +throw new IllegalArgumentException ("skip value is negative"); +}{ +this.ensureOpen (); +var r = n; +while (r > 0) { +if (this.nextChar >= this.nChars) this.fill (); +if (this.nextChar >= this.nChars) break; +if (this.skipLF) { +this.skipLF = false; +if (this.cb[this.nextChar] == '\n') { +this.nextChar++; +}}var d = this.nChars - this.nextChar; +if (r <= d) { +this.nextChar += r; +r = 0; +break; +}r -= d; +this.nextChar = this.nChars; +} +return n - r; +}}, "~N"); +Clazz_defineMethod (c$, "ready", +function () { +{ +this.ensureOpen (); +if (this.skipLF) { +if (this.nextChar >= this.nChars && this.$in.ready ()) { +this.fill (); +}if (this.nextChar < this.nChars) { +if (this.cb[this.nextChar] == '\n') this.nextChar++; +this.skipLF = false; +}}return (this.nextChar < this.nChars) || this.$in.ready (); +}}); +Clazz_overrideMethod (c$, "markSupported", +function () { +return true; +}); +Clazz_overrideMethod (c$, "mark", +function (readAheadLimit) { +if (readAheadLimit < 0) { +throw new IllegalArgumentException ("Read-ahead limit < 0"); +}{ +this.ensureOpen (); +this.readAheadLimit = readAheadLimit; +this.markedChar = this.nextChar; +this.markedSkipLF = this.skipLF; +}}, "~N"); +Clazz_overrideMethod (c$, "reset", +function () { +{ +this.ensureOpen (); +if (this.markedChar < 0) throw new java.io.IOException ((this.markedChar == -2) ? "Mark invalid" : "Stream not marked"); +this.nextChar = this.markedChar; +this.skipLF = this.markedSkipLF; +}}); +Clazz_defineMethod (c$, "close", +function () { +{ +if (this.$in == null) return; +this.$in.close (); +this.$in = null; +this.cb = null; +}}); +Clazz_defineStatics (c$, +"INVALIDATED", -2, +"UNMARKED", -1, +"DEFAULT_CHAR_BUFFER_SIZE", 8192, +"DEFAULT_EXPECTED_LINE_LENGTH", 80); +}); +Clazz_load (["java.io.InputStream"], "java.io.ByteArrayInputStream", ["java.lang.IndexOutOfBoundsException", "$.NullPointerException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.buf = null; +this.pos = 0; +this.$mark = 0; +this.count = 0; +Clazz_instantialize (this, arguments); +}, java.io, "ByteArrayInputStream", java.io.InputStream); +Clazz_makeConstructor (c$, +function (buf) { +Clazz_superConstructor (this, java.io.ByteArrayInputStream, []); +this.buf = buf; +this.pos = 0; +this.count = buf.length; +}, "~A"); +Clazz_overrideMethod (c$, "readByteAsInt", +function () { +return (this.pos < this.count) ? (this.buf[this.pos++] & 0xff) : -1; +}); +Clazz_overrideMethod (c$, "read", +function (b, off, len) { +if (b == null) { +throw new NullPointerException (); +} + if (arguments.length == 1) { off = 0; len = b.length; } + +if (off < 0 || len < 0 || len > b.length - off) { +throw new IndexOutOfBoundsException (); +}if (this.pos >= this.count) { +return -1; +}var avail = this.count - this.pos; +if (len > avail) { +len = avail; +}if (len <= 0) { +return 0; +}System.arraycopy (this.buf, this.pos, b, off, len); +this.pos += len; +return len; +}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "skip", +function (n) { +var k = this.count - this.pos; +if (n < k) { +k = n < 0 ? 0 : n; +}this.pos += k; +return k; +}, "~N"); +Clazz_overrideMethod (c$, "available", +function () { +return this.count - this.pos; +}); +Clazz_overrideMethod (c$, "markSupported", +function () { +return true; +}); +Clazz_overrideMethod (c$, "mark", +function (readAheadLimit) { +this.$mark = this.pos; +}, "~N"); +Clazz_overrideMethod (c$, "resetStream", +function () { +}); +Clazz_overrideMethod (c$, "reset", +function () { +this.pos = this.$mark; +}); +Clazz_overrideMethod (c$, "close", +function () { +}); +}); +Clazz_load (["java.io.Closeable"], "java.io.Reader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.NullPointerException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.lock = null; +this.skipBuffer = null; +Clazz_instantialize (this, arguments); +}, java.io, "Reader", null, java.io.Closeable); +Clazz_makeConstructor (c$, +function (lock) { +if (lock == null) { +throw new NullPointerException (); +}this.lock = lock; +}, "~O"); +Clazz_defineMethod (c$, "skip", +function (n) { +if (n < 0) throw new IllegalArgumentException ("skip value is negative"); +var nn = Math.min (n, 8192); +{ +if ((this.skipBuffer == null) || (this.skipBuffer.length < nn)) this.skipBuffer = Clazz_newCharArray (nn, '\0'); +var r = n; +while (r > 0) { +var nc = this.read (this.skipBuffer, 0, Math.min (r, nn)); +if (nc == -1) break; +r -= nc; +} +return n - r; +}}, "~N"); +Clazz_defineMethod (c$, "ready", +function () { +return false; +}); +Clazz_defineMethod (c$, "markSupported", +function () { +return false; +}); +Clazz_defineMethod (c$, "mark", +function (readAheadLimit) { +throw new java.io.IOException ("mark() not supported"); +}, "~N"); +Clazz_defineMethod (c$, "reset", +function () { +throw new java.io.IOException ("reset() not supported"); +}); +Clazz_defineStatics (c$, +"MAX_SKIP_BUFFE_SIZE", 8192); +}); +Clazz_load (["java.io.Reader"], "java.io.StringReader", ["java.io.IOException", "java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.str = null; +this.length = 0; +this.next = 0; +this.$mark = 0; +Clazz_instantialize (this, arguments); +}, java.io, "StringReader", java.io.Reader); +Clazz_makeConstructor (c$, +function (s) { +Clazz_superConstructor (this, java.io.StringReader, [s]); +this.str = s; +this.length = s.length; +}, "~S"); +Clazz_defineMethod (c$, "ensureOpen", + function () { +if (this.str == null) throw new java.io.IOException ("Stream closed"); +}); +Clazz_overrideMethod (c$, "read", +function (cbuf, off, len) { +{ +this.ensureOpen (); +if ((off < 0) || (off > cbuf.length) || (len < 0) || ((off + len) > cbuf.length) || ((off + len) < 0)) { +throw new IndexOutOfBoundsException (); +} else if (len == 0) { +return 0; +}if (this.next >= this.length) return -1; +var n = Math.min (this.length - this.next, len); +this.str.getChars (this.next, this.next + n, cbuf, off); +this.next += n; +return n; +}}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "skip", +function (ns) { +{ +this.ensureOpen (); +if (this.next >= this.length) return 0; +var n = Math.min (this.length - this.next, ns); +n = Math.max (-this.next, n); +this.next += n; +return n; +}}, "~N"); +Clazz_overrideMethod (c$, "ready", +function () { +{ +this.ensureOpen (); +return true; +}}); +Clazz_overrideMethod (c$, "markSupported", +function () { +return true; +}); +Clazz_overrideMethod (c$, "mark", +function (readAheadLimit) { +if (readAheadLimit < 0) { +throw new IllegalArgumentException ("Read-ahead limit < 0"); +}{ +this.ensureOpen (); +this.$mark = this.next; +}}, "~N"); +Clazz_overrideMethod (c$, "reset", +function () { +{ +this.ensureOpen (); +this.next = this.$mark; +}}); +Clazz_overrideMethod (c$, "close", +function () { +this.str = null; +}); +}); +Clazz_declarePackage ("JU"); +Clazz_load (null, "JU.Base64", ["JU.SB"], function () { +c$ = Clazz_declareType (JU, "Base64"); +c$.getBytes64 = Clazz_defineMethod (c$, "getBytes64", +function (bytes) { +return JU.Base64.getBase64 (bytes).toBytes (0, -1); +}, "~A"); +c$.getBase64 = Clazz_defineMethod (c$, "getBase64", +function (bytes) { +var nBytes = bytes.length; +var sout = new JU.SB (); +if (nBytes == 0) return sout; +for (var i = 0, nPad = 0; i < nBytes && nPad == 0; ) { +if (i % 75 == 0 && i != 0) sout.append ("\r\n"); +nPad = (i + 2 == nBytes ? 1 : i + 1 == nBytes ? 2 : 0); +var outbytes = ((bytes[i++] << 16) & 0xFF0000) | ((nPad == 2 ? 0 : bytes[i++] << 8) & 0x00FF00) | ((nPad >= 1 ? 0 : bytes[i++]) & 0x0000FF); +sout.appendC (JU.Base64.base64.charAt ((outbytes >> 18) & 0x3F)); +sout.appendC (JU.Base64.base64.charAt ((outbytes >> 12) & 0x3F)); +sout.appendC (nPad == 2 ? '=' : JU.Base64.base64.charAt ((outbytes >> 6) & 0x3F)); +sout.appendC (nPad >= 1 ? '=' : JU.Base64.base64.charAt (outbytes & 0x3F)); +} +return sout; +}, "~A"); +c$.decodeBase64 = Clazz_defineMethod (c$, "decodeBase64", +function (strBase64) { +var nBytes = 0; +var ch; +var pt0 = strBase64.indexOf (";base64,") + 1; +if (pt0 > 0) pt0 += 7; +var chars64 = strBase64.toCharArray (); +var len64 = chars64.length; +if (len64 == 0) return Clazz_newByteArray (0, 0); +for (var i = len64; --i >= pt0; ) nBytes += ((ch = (chars64[i]).charCodeAt (0) & 0x7F) == 65 || JU.Base64.decode64[ch] > 0 ? 3 : 0); + +nBytes = nBytes >> 2; +var bytes = Clazz_newByteArray (nBytes, 0); +var offset = 18; +for (var i = pt0, pt = 0, b = 0; i < len64; i++) { +if (JU.Base64.decode64[ch = (chars64[i]).charCodeAt (0) & 0x7F] > 0 || ch == 65 || ch == 61) { +b |= JU.Base64.decode64[ch] << offset; +offset -= 6; +if (offset < 0) { +bytes[pt++] = ((b & 0xFF0000) >> 16); +if (pt < nBytes) bytes[pt++] = ((b & 0xFF00) >> 8); +if (pt < nBytes) bytes[pt++] = (b & 0xFF); +offset = 18; +b = 0; +}}} +return bytes; +}, "~S"); +Clazz_defineStatics (c$, +"base64", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", +"decode64", Clazz_newIntArray (-1, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 62, 0, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 63, 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0])); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["java.lang.Enum"], "JU.Encoding", null, function () { +c$ = Clazz_declareType (JU, "Encoding", Enum); +Clazz_defineEnumConstant (c$, "NONE", 0, []); +Clazz_defineEnumConstant (c$, "UTF8", 1, []); +Clazz_defineEnumConstant (c$, "UTF_16BE", 2, []); +Clazz_defineEnumConstant (c$, "UTF_16LE", 3, []); +Clazz_defineEnumConstant (c$, "UTF_32BE", 4, []); +Clazz_defineEnumConstant (c$, "UTF_32LE", 5, []); +}); +Clazz_declarePackage ("java.util"); +Clazz_load (["java.lang.RuntimeException"], "java.util.MissingResourceException", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.className = null; +this.key = null; +Clazz_instantialize (this, arguments); +}, java.util, "MissingResourceException", RuntimeException); +Clazz_makeConstructor (c$, +function (s, className, key) { +Clazz_superConstructor (this, java.util.MissingResourceException, [s]); +this.className = className; +this.key = key; +}, "~S,~S,~S"); +Clazz_makeConstructor (c$, +function (message, className, key, cause) { +Clazz_superConstructor (this, java.util.MissingResourceException, [message, cause]); +this.className = className; +this.key = key; +}, "~S,~S,~S,Throwable"); +Clazz_defineMethod (c$, "getClassName", +function () { +return this.className; +}); +Clazz_defineMethod (c$, "getKey", +function () { +return this.key; +}); +}); +Clazz_declarePackage ("jssun.misc"); +Clazz_load (null, "jssun.misc.MessageUtils", ["java.lang.Character", "$.StringBuffer"], function () { +c$ = Clazz_declareType (jssun.misc, "MessageUtils"); +Clazz_makeConstructor (c$, +function () { +}); +c$.subst = Clazz_defineMethod (c$, "subst", +function (patt, arg) { +var args = Clazz_newArray (-1, [arg]); +return jssun.misc.MessageUtils.subst (patt, args); +}, "~S,~S"); +c$.subst = Clazz_defineMethod (c$, "subst", +function (patt, arg1, arg2) { +var args = Clazz_newArray (-1, [arg1, arg2]); +return jssun.misc.MessageUtils.subst (patt, args); +}, "~S,~S,~S"); +c$.subst = Clazz_defineMethod (c$, "subst", +function (patt, arg1, arg2, arg3) { +var args = Clazz_newArray (-1, [arg1, arg2, arg3]); +return jssun.misc.MessageUtils.subst (patt, args); +}, "~S,~S,~S,~S"); +c$.subst = Clazz_defineMethod (c$, "subst", +function (patt, args) { +var result = new StringBuffer (); +var len = patt.length; +for (var i = 0; i >= 0 && i < len; i++) { +var ch = patt.charAt (i); +if (ch == '%') { +if (i != len) { +var index = Character.digit (patt.charAt (i + 1), 10); +if (index == -1) { +result.append (patt.charAt (i + 1)); +i++; +} else if (index < args.length) { +result.append (args[index]); +i++; +}}} else { +result.append (ch); +}} +return result.toString (); +}, "~S,~A"); +c$.substProp = Clazz_defineMethod (c$, "substProp", +function (propName, arg) { +return jssun.misc.MessageUtils.subst (System.getProperty (propName), arg); +}, "~S,~S"); +c$.substProp = Clazz_defineMethod (c$, "substProp", +function (propName, arg1, arg2) { +return jssun.misc.MessageUtils.subst (System.getProperty (propName), arg1, arg2); +}, "~S,~S,~S"); +c$.substProp = Clazz_defineMethod (c$, "substProp", +function (propName, arg1, arg2, arg3) { +return jssun.misc.MessageUtils.subst (System.getProperty (propName), arg1, arg2, arg3); +}, "~S,~S,~S,~S"); +c$.toStderr = Clazz_defineMethod (c$, "toStderr", +function (msg) { +{ +System.out.println(msg); +}}, "~S"); +c$.toStdout = Clazz_defineMethod (c$, "toStdout", +function (msg) { +{ +System.out.println(msg); +}}, "~S"); +c$.err = Clazz_defineMethod (c$, "err", +function (s) { +jssun.misc.MessageUtils.toStderr (s + "\n"); +}, "~S"); +c$.out = Clazz_defineMethod (c$, "out", +function (s) { +jssun.misc.MessageUtils.toStdout (s + "\n"); +}, "~S"); +c$.where = Clazz_defineMethod (c$, "where", +function () { +{ +System.out.println(Clazz_getStackTrace()); +}}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.geom.Dimension2D"], "java.awt.Dimension", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.width = 0; +this.height = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "Dimension", java.awt.geom.Dimension2D); +Clazz_makeConstructor (c$, +function () { +this.construct (0, 0); +}); +Clazz_makeConstructor (c$, +function (d) { +this.construct (d.width, d.height); +}, "java.awt.Dimension"); +Clazz_makeConstructor (c$, +function (width, height) { +Clazz_superConstructor (this, java.awt.Dimension, []); +this.width = width; +this.height = height; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getWidth", +function () { +return this.width; +}); +Clazz_overrideMethod (c$, "getHeight", +function () { +return this.height; +}); +Clazz_defineMethod (c$, "setSize", +function (width, height) { +this.width = Clazz_doubleToInt (Math.ceil (width)); +this.height = Clazz_doubleToInt (Math.ceil (height)); +}, "~N,~N"); +Clazz_defineMethod (c$, "getSize", +function () { +return new java.awt.Dimension (this.width, this.height); +}); +Clazz_defineMethod (c$, "setSize", +function (d) { +this.setSize (d.width, d.height); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "setSize", +function (width, height) { +this.width = width; +this.height = height; +}, "~N,~N"); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (Clazz_instanceOf (obj, java.awt.Dimension)) { +var d = obj; +return (this.width == d.width) && (this.height == d.height); +}return false; +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +var sum = this.width + this.height; +return Clazz_doubleToInt (sum * (sum + 1) / 2) + this.width; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[width=" + this.width + ",height=" + this.height + "]"; +}); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (null, "java.awt.geom.Dimension2D", ["java.lang.InternalError"], function () { +c$ = Clazz_declareType (java.awt.geom, "Dimension2D", null, Cloneable); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setSize", +function (d) { +this.setSize (d.getWidth (), d.getHeight ()); +}, "java.awt.geom.Dimension2D"); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.Dimension2D, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.Container"], "java.awt.Panel", ["java.awt.FlowLayout"], function () { +c$ = Clazz_declareType (java.awt, "Panel", java.awt.Container); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.Panel, []); +this.setPanel (); +}); +Clazz_defineMethod (c$, "setPanel", +function () { +this.setAppContext (); +this.setLayout ( new java.awt.FlowLayout ()); +}); +Clazz_makeConstructor (c$, +function (layout) { +Clazz_superConstructor (this, java.awt.Panel, []); +if (layout == null) layout = new java.awt.FlowLayout (); +this.setAppContext (); +this.setLayout (layout); +}, "java.awt.LayoutManager"); +Clazz_overrideMethod (c$, "constructComponentName", +function () { +{ +return "panel" + java.awt.Panel.nameCounter++; +}}); +Clazz_defineMethod (c$, "addNotify", +function () { +if (this.peer == null) this.peer = this.getToolkit ().createPanel (this); +Clazz_superCall (this, java.awt.Panel, "addNotify", []); +}); +Clazz_defineStatics (c$, +"base", "panel", +"nameCounter", 0); +}); +Clazz_load(["java.util.AbstractList","$.List","$.RandomAccess"],"java.util.ArrayList",["java.lang.IllegalArgumentException","$.IndexOutOfBoundsException","java.lang.reflect.Array","java.util.Arrays"],function(){ +c$=Clazz_decorateAsClass(function(){ +this.firstIndex=0; +this.lastIndex=0; +this.array=null; +Clazz_instantialize(this,arguments); +},java.util,"ArrayList",java.util.AbstractList,[java.util.List,Cloneable,java.io.Serializable,java.util.RandomAccess]); + +Clazz_overrideConstructor(c$, +function(){ +this.setup(0); +}); + +Clazz_defineMethod(c$, "setup", +function(capacity){ +//Clazz_superConstructor(this,java.util.ArrayList,[]); +this.firstIndex=this.lastIndex=0; +try{ +this.array=this.newElementArray(capacity); +}catch(e){ +if(Clazz_instanceOf(e,NegativeArraySizeException)){ +throw new IllegalArgumentException(); +}else{ +throw e; +} +} +},"~N"); +/* +Clazz_makeConstructor(c$, +function(collection){ +Clazz_superConstructor(this,java.util.ArrayList,[]); +var size=collection.size(); +this.firstIndex=this.lastIndex=0; +this.array=this.newElementArray(size+(Math.floor(size/10))); +this.addAll(collection); +},"java.util.Collection"); + +*/ + +Clazz_defineMethod(c$,"newElementArray", +($fz=function(size){ +return new Array(size); +},$fz.isPrivate=true,$fz),"~N"); + +Clazz_overrideMethod(c$,"add", +function(location,object){ + +if (arguments.length == 1) { + // coming from Java methods, e.g. Collections.list() + // location is actually the object + return this.add1(location); +} +var size=this.size(); +if(00)||this.lastIndex==this.array.length){ +System.arraycopy(this.array,this.firstIndex,this.array,--this.firstIndex,location); +}else{ +var index=location+this.firstIndex; +System.arraycopy(this.array,index,this.array,index+1,size-location); +this.lastIndex++; +}this.array[location+this.firstIndex]=object; +}else if(location==0){ +if(this.firstIndex==0){ +this.growAtFront(1); +}this.array[--this.firstIndex]=object; +}else if(location==size){ +if(this.lastIndex==this.array.length){ +this.growAtEnd(1); +}this.array[this.lastIndex++]=object; +}else{ +throw new IndexOutOfBoundsException(); +}this.modCount++; +},"~N,~O"); + +Clazz_overrideMethod(c$,"add1", +function(object){ +if(this.lastIndex==this.array.length){ +this.growAtEnd(1); +}this.array[this.lastIndex++]=object; +this.modCount++; +return true; +},"~O"); + +/* BH disallow addAll(int,List) + * +Clazz_defineMethod(c$,"addAll", +function(location,collection){ +var size=this.size(); +if(location<0||location>size){ +throw new IndexOutOfBoundsException(); +}var growSize=collection.size(); +if(00)||this.lastIndex>this.array.length-growSize){ +var newFirst=this.firstIndex-growSize; +if(newFirst<0){ +var index=location+this.firstIndex; +System.arraycopy(this.array,index,this.array,index-newFirst,size-location); +this.lastIndex-=newFirst; +newFirst=0; +}System.arraycopy(this.array,this.firstIndex,this.array,newFirst,location); +this.firstIndex=newFirst; +}else{ +var index=location+this.firstIndex; +System.arraycopy(this.array,index,this.array,index+growSize,size-location); +this.lastIndex+=growSize; +}}else if(location==0){ +this.growAtFront(growSize); +this.firstIndex-=growSize; +}else if(location==size){ +if(this.lastIndex>this.array.length-growSize){ +this.growAtEnd(growSize); +}this.lastIndex+=growSize; +}if(growSize>0){ +var it=collection.iterator(); +var index=location+this.firstIndex; +var end=index+growSize; +while(index0){ + if(this.lastIndex>this.array.length-growSize){ + this.growAtEnd(growSize); +} +var it=collection.iterator(); +var end=this.lastIndex+growSize; +while(this.lastIndex= i1;) +this.array[i] = null; +},"~N,~N"); + +Clazz_defineMethod(c$,"clone", +function(){ +try{ +var newList=Clazz_superCall(this,java.util.ArrayList,"clone",[]); +newList.array=this.array.clone(); +return newList; +}catch(e){ +if(Clazz_instanceOf(e,CloneNotSupportedException)){ +return null; +}else{ +throw e; +} +} +}); +Clazz_overrideMethod(c$,"contains", +function(object){ +if(object!=null){ +for(var i=this.firstIndex;i0){ +this.growAtFront(minimumCapacity-this.array.length); +}else{ +this.growAtEnd(minimumCapacity-this.array.length); +}}},"~N"); +Clazz_overrideMethod(c$,"get", +function(location){ +if(0<=location&&location=required-(this.array.length-this.lastIndex)){ + var newLast=this.lastIndex-this.firstIndex; + if(size>0){ + System.arraycopy(this.array,this.firstIndex,this.array,0,size); + var start=newLastincrement){ + increment=required; + } + if(increment<12){ + increment=12; + } + var newArray=this.newElementArray(size+increment); + if(size>0){ + System.arraycopy(this.array,this.firstIndex,newArray,this.firstIndex,size); + } + this.array=newArray; +} + +},$fz.isPrivate=true,$fz),"~N"); +Clazz_defineMethod(c$,"growAtFront", +($fz=function(required){ +var size=this.size(); +if(this.array.length-this.lastIndex>=required){ +var newFirst=this.array.length-size; +if(size>0){ +System.arraycopy(this.array,this.firstIndex,this.array,newFirst,size); +var length=this.firstIndex+size>newFirst?newFirst:this.firstIndex+size; +this.fill(this.firstIndex,length); +}this.firstIndex=newFirst; +this.lastIndex=this.array.length; +}else{ +var increment=Math.floor(size/2); +if(required>increment){ +increment=required; +}if(increment<12){ +increment=12; +}var newArray=this.newElementArray(size+increment); +if(size>0){ +System.arraycopy(this.array,this.firstIndex,newArray,newArray.length-size,size); +}this.firstIndex=newArray.length-size; +this.lastIndex=newArray.length; +this.array=newArray; +}},$fz.isPrivate=true,$fz),"~N"); +Clazz_defineMethod(c$,"growForInsert", +($fz=function(location,required){ +var size=this.size(); +var increment=Math.floor(size/2); +if(required>increment){ +increment=required; +}if(increment<12){ +increment=12; +}var newArray=this.newElementArray(size+increment); +if(location=this.firstIndex;i--){ +if(object.equals(this.array[i])){ +return i-this.firstIndex; +}} +}else{ +for(var i=this.lastIndex-1;i>=this.firstIndex;i--){ +if(this.array[i]==null){ +return i-this.firstIndex; +}} +}return-1; +},"~O"); +Clazz_overrideMethod(c$,"remove", +function(location){ +var result; +var size=this.size(); +if(0<=location&&location=0&&start<=end&&end<=this.size()){ +if(start==end){ +return; +}var size=this.size(); +if(end==size){ + this.fill(this.firstIndex+start,this.lastIndex); +this.lastIndex=this.firstIndex+start; +}else if(start==0){ + this.fill(this.firstIndex,this.firstIndex+end); +this.firstIndex+=end; +}else{ +System.arraycopy(this.array,this.firstIndex+end,this.array,this.firstIndex+start,size-end); +var newLast=this.lastIndex+start-end; +this.fill(newLast,this.lastIndex); +this.lastIndex=newLast; +}this.modCount++; +}else{ +throw new IndexOutOfBoundsException(); +}},"~N,~N"); +Clazz_overrideMethod(c$,"set", +function(location,object){ +if(0<=location&&locationcontents.length) + contents= new Array(size); +System.arraycopy(this.array,this.firstIndex,contents,0,size); +if(size=0; +}); +Clazz_overrideMethod(c$,"nextIndex", +function(){ +return this.pos+1; +}); +Clazz_overrideMethod(c$,"previous", +function(){ +if(this.expectedModCount==this._list.modCount){ +try{ +var a=this._list.get(this.pos); +this.lastPosition=this.pos; +this.pos--; +return a; +}catch(e){ +if(Clazz_instanceOf(e,IndexOutOfBoundsException)){ +throw new java.util.NoSuchElementException(); +}else{ +throw e; +} +} +}throw new java.util.ConcurrentModificationException(); +}); +Clazz_overrideMethod(c$,"previousIndex", +function(){ +return this.pos; +}); +Clazz_overrideMethod(c$,"set", +function(a){ +if(this.expectedModCount==this._list.modCount){ +try{ +this._list.set(this.lastPosition,a); +}catch(e){ +if(Clazz_instanceOf(e,IndexOutOfBoundsException)){ +throw new IllegalStateException(); +}else{ +throw e; +} +} +}else{ +throw new java.util.ConcurrentModificationException(); +}},"~O"); +c$=Clazz_p0p(); +//}; + + + + +Clazz_pu$h(self.c$); +c$=Clazz_declareType(java.util.AbstractList,"SubAbstractListRandomAccess",java.util.AbstractList.SubAbstractList,java.util.RandomAccess); +c$=Clazz_p0p(); + + + + +Clazz_pu$h(self.c$); +c$=Clazz_decorateAsClass(function(){ +this.fullList=null; +this.offset=0; +this.$size=0; +Clazz_instantialize(this,arguments); +},java.util.AbstractList,"SubAbstractList",java.util.AbstractList); +Clazz_makeConstructor(c$, +function(a,b,c){ +Clazz_superConstructor(this,java.util.AbstractList.SubAbstractList); +this.fullList=a; +this.modCount=this.fullList.modCount; +this.offset=b; +this.$size=c-b; +},"java.util.AbstractList,~N,~N"); +Clazz_defineMethod(c$,"add", +function(a,b){ +if(this.modCount==this.fullList.modCount){ +if(0<=a&&a<=this.$size){ +this.fullList.add(a+this.offset,b); +this.$size++; +this.modCount=this.fullList.modCount; +}else{ +throw new IndexOutOfBoundsException(); +}}else{ +throw new java.util.ConcurrentModificationException(); +}},"~N,~O"); +Clazz_defineMethod(c$,"addAll", +function(a,b){ +if(this.modCount==this.fullList.modCount){ +if(0<=a&&a<=this.$size){ +var c=this.fullList.addAll(a+this.offset,b); +if(c){ +this.$size+=b.size(); +this.modCount=this.fullList.modCount; +}return c; +}throw new IndexOutOfBoundsException(); +}throw new java.util.ConcurrentModificationException(); +},"~N,java.util.Collection"); +Clazz_defineMethod(c$,"addAll", +function(a){ +if(this.modCount==this.fullList.modCount){ +var b=this.fullList.addAll(this.offset+this.$size,a); +if(b){ +this.$size+=a.size(); +this.modCount=this.fullList.modCount; +}return b; +}throw new java.util.ConcurrentModificationException(); +},"java.util.Collection"); +Clazz_defineMethod(c$,"get", +function(a){ +if(this.modCount==this.fullList.modCount){ +if(0<=a&&a=this.start; +}); +Clazz_defineMethod(c$,"next", +function(){ +if(this.iterator.nextIndex()=this.start){ +return this.iterator.previous(); +}throw new java.util.NoSuchElementException(); +}); +Clazz_defineMethod(c$,"previousIndex", +function(){ +var a=this.iterator.previousIndex(); +if(a>=this.start){ +return a-this.start; +}return-1; +}); +Clazz_defineMethod(c$,"remove", +function(){ +this.iterator.remove(); +this.subList.sizeChanged(false); +this.end--; +}); +Clazz_defineMethod(c$,"set", +function(a){ +this.iterator.set(a); +},"~O"); +c$=Clazz_p0p(); +c$=Clazz_p0p(); +}); +// 4/23/2015 1:20:24 PM BH removing need for array.getClass().getComponentType() + +Clazz_load(["java.util.Collection"],"java.util.AbstractCollection",["java.lang.StringBuilder","$.UnsupportedOperationException","java.lang.reflect.Array"],function(){ +c$=Clazz_declareType(java.util,"AbstractCollection",null,java.util.Collection); +Clazz_makeConstructor(c$, +function(){ +}); +Clazz_overrideMethod(c$,"add", +function(object){ +throw new UnsupportedOperationException(); +},"~O"); +Clazz_overrideMethod(c$,"addAll", +function(collection){ +var result=false; +var it=collection.iterator(); +while(it.hasNext()){ +if(this.add(it.next())){ +result=true; +}} +return result; +},"java.util.Collection"); +Clazz_overrideMethod(c$,"clear", +function(){ +var it=this.iterator(); +while(it.hasNext()){ +it.next(); +it.remove(); +} +}); +Clazz_overrideMethod(c$,"contains", +function(object){ +var it=this.iterator(); +if(object!=null){ +while(it.hasNext()){ +if(object.equals(it.next())){ +return true; +}} +}else{ +while(it.hasNext()){ +if(it.next()==null){ +return true; +}} +}return false; +},"~O"); +Clazz_overrideMethod(c$,"containsAll", +function(collection){ +var it=collection.iterator(); +while(it.hasNext()){ +if(!this.contains(it.next())){ +return false; +}} +return true; +},"java.util.Collection"); +Clazz_overrideMethod(c$,"isEmpty", +function(){ +return this.size()==0; +}); +Clazz_overrideMethod(c$,"remove", +function(object){ +var it=this.iterator(); +if(object!=null){ +while(it.hasNext()){ +if(object.equals(it.next())){ +it.remove(); +return true; +}} +}else{ +while(it.hasNext()){ +if(it.next()==null){ +it.remove(); +return true; +}} +}return false; +},"~O"); +Clazz_overrideMethod(c$,"removeAll", +function(collection){ +var result=false; +var it=this.iterator(); +while(it.hasNext()){ +if(collection.contains(it.next())){ +it.remove(); +result=true; +}} +return result; +},"java.util.Collection"); +Clazz_overrideMethod(c$,"retainAll", +function(collection){ +var result=false; +var it=this.iterator(); +while(it.hasNext()){ +if(!collection.contains(it.next())){ +it.remove(); +result=true; +}} +return result; +},"java.util.Collection"); +Clazz_defineMethod(c$,"toArray", +function(){ +var size=this.size(); +var index=0; +var it=this.iterator(); +var array=new Array(size); +while(indexcontents.length){ // BH unnec +//var ct=contents.getClass().getComponentType(); +//contents=java.lang.reflect.Array.newInstance(ct,size); +//} +for(var entry,$entry=this.iterator();$entry.hasNext()&&((entry=$entry.next())||true);){ +contents[index++]=entry; +} +if(index=0){ +//this.elementCount=0; +//this.elementData=this.newElementArray(capacity==0?1:capacity); +//this.loadFactor=0.75; +//this.computeMaxSize(); +//}else{ +//throw new IllegalArgumentException(); +//}},"~N"); +Clazz_makeConstructor(c$, +function(){ +this.construct(16); +}); +Clazz_makeConstructor(c$, +function(capacity){ +Clazz_superConstructor(this,java.util.HashMap,[]); +if(capacity>=0){ +this.elementCount=0; +this.elementData=this.newElementArray(capacity==0?1:capacity); +this.loadFactor=0.75; +this.computeMaxSize(); +}else{ +throw new IllegalArgumentException(); +}},"~N"); +Clazz_makeConstructor(c$, +function(capacity,loadFactor){ +Clazz_superConstructor(this,java.util.HashMap,[]); +if(capacity>=0&&loadFactor>0){ +this.elementCount=0; +this.elementData=this.newElementArray(capacity==0?1:capacity); +this.loadFactor=loadFactor; +this.computeMaxSize(); +}else{ +throw new IllegalArgumentException(); +}},"~N,~N"); +Clazz_makeConstructor(c$, +function(map){ +this.construct(map.size()<6?11:map.size()*2); +Clazz_superCall(this,java.util.HashMap,"putAll",[map]); +},"java.util.Map"); + + +/* +Clazz_makeConstructor(c$, +function(capacity,loadFactor){ +this.doConstruct(capacity,loadFactor); +},"~N,~N"); + +Clazz_defineMethod(c$, "doConstruct", +function(capacity,loadFactor) { +capacity || (capacity = 16); +loadFactor || (loadFactor = 0.75); +if (typeof capacity != "number") { + var map = capacity; + this.loadFactor=loadFactor; + this.elementData=this.newElementArray(map.size()<6?11:map.size()*2); + this.computeMaxSize(); + this.putAllHM(map); + return; +} + +//Clazz_superConstructor(this,java.util.HashMap,[]); +if(capacity>=0&&loadFactor>0){ +this.elementData=this.newElementArray(capacity==0?1:capacity); +this.loadFactor=loadFactor; +this.computeMaxSize(); +}else{ +throw new IllegalArgumentException(); +} +},"~N,~N"); + +//Clazz_makeConstructor(c$, +//function(map){ +//this.construct(map.size()<6?11:map.size()*2); +//Clazz_superCall(this,java.util.HashMap,"putAll",[map]); +//},"java.util.Map"); + +*/ +Clazz_overrideMethod(c$,"clear", +function(){ +if(this.elementCount>0){ +this.elementCount=0; +java.util.Arrays.fill(this.elementData,null); +this.modCount++; +}}); +Clazz_defineMethod(c$,"clone", +function(){ + return this.cloneHM(); +}); + +Clazz_defineMethod(c$,"cloneHM", +function(){ +try{ +var map=this.cloneAM();//Clazz_superCall(this,java.util.HashMap,"clone",[]); +map.elementData=this.newElementArray(this.elementData.length); +var entry; +for(var i=0;i=0;){ +var entry=this.elementData[i]; +while(entry!=null){ +if(value.equals(entry.value)){ +return true; +}entry=entry.next; +} +} +}else{ +for(var i=this.elementData.length;--i>=0;){ +var entry=this.elementData[i]; +while(entry!=null){ +if(entry.value==null){ +return true; +}entry=entry.next; +} +} +}return false; +},"~O"); +Clazz_overrideMethod(c$,"entrySet", +function(){ +return new java.util.HashMap.HashMapEntrySet(this); +}); +Clazz_overrideMethod(c$,"get", +function(key){ +var m=this.getEntry(key); +if(m!=null){ +return m.value; +}return null; +},"~O"); +Clazz_defineMethod(c$,"getEntry", +function(key){ +var index=this.getModuloHash(key); +return this.findEntry(key,index); +},"~O"); +Clazz_defineMethod(c$,"getModuloHash", +function(key){ +if(key==null){ +return 0; +}return(key.hashCode()&0x7FFFFFFF)%this.elementData.length; +},"~O"); +Clazz_defineMethod(c$,"findEntry", +function(key,index){ +var m; +m=this.elementData[index]; +if(key!=null){ +while(m!=null&&!this.keysEqual(key,m)){ +m=m.next; +} +}else{ +while(m!=null&&m.key!=null){ +m=m.next; +} +}return m; +},"~O,~N"); +Clazz_overrideMethod(c$,"isEmpty", +function(){ +return this.elementCount==0; +}); +Clazz_overrideMethod(c$,"keySet", +function(){ +if(this.$keySet==null){ +this.$keySet=((Clazz_isClassDefined("java.util.HashMap$1")?0:java.util.HashMap.$HashMap$1$()),Clazz_innerTypeInstance(java.util.HashMap$1,this,null)); +}return this.$keySet; +}); +Clazz_overrideMethod(c$,"put", +function(key,value){ +var index=this.getModuloHash(key); +var entry=this.findEntry(key,index); +if(entry==null){ +this.modCount++; +if(++this.elementCount>this.threshold){ +this.rehash(); +index=key==null?0:(key.hashCode()&0x7FFFFFFF)%this.elementData.length; +}entry=this.createEntry(key,index,value); +return null; +}var result=entry.value; +entry.value=value; +return result; +},"~O,~O"); +Clazz_defineMethod(c$,"createEntry", +function(key,index,value){ +var entry=new java.util.HashMap.Entry(key,value); +entry.next=this.elementData[index]; +this.elementData[index]=entry; +return entry; +},"~O,~N,~O"); +Clazz_defineMethod(c$,"putAll", +function(map){ +if(!map.isEmpty()){ +var capacity=this.elementCount+map.size(); +if(capacity>this.threshold){ +this.rehash(capacity); +} +this.putAllHM(map); + +}},"java.util.Map"); +Clazz_defineMethod(c$,"rehash", +function(capacity){ +var length=(capacity==0?1:capacity<<1); +var newData=this.newElementArray(length); +for(var i=0;itwice?min:twice,'\0'); +System.arraycopy(this.value,0,newData,0,this.count); +this.value=newData; +this.shared=false; +},$fz.isPrivate=true,$fz),"~N"); +Clazz_defineMethod(c$,"appendNull", +function(){ +var newSize=this.count+4; +if(newSize>this.value.length){ +this.enlargeBuffer(newSize); +}else if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}this.value[this.count++]='n'; +this.value[this.count++]='u'; +this.value[this.count++]='l'; +this.value[this.count++]='l'; +}); +Clazz_defineMethod(c$,"append0", +function(chars){ +var newSize=this.count+chars.length; +if(newSize>this.value.length){ +this.enlargeBuffer(newSize); +}else if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}System.arraycopy(chars,0,this.value,this.count,chars.length); +this.count=newSize; +},"~A"); +Clazz_defineMethod(c$,"append0", +function(chars,start,length){ +if(chars==null){ +throw new NullPointerException(); +}if(start>=0&&0<=length&&length<=chars.length-start){ +var newSize=this.count+length; +if(newSize>this.value.length){ +this.enlargeBuffer(newSize); +}else if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}System.arraycopy(chars,start,this.value,this.count,length); +this.count=newSize; +}else{ +throw new ArrayIndexOutOfBoundsException(); +}},"~A,~N,~N"); +Clazz_defineMethod(c$,"append0", +function(ch){ +if(this.count==this.value.length){ +this.enlargeBuffer(this.count+1); +}if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}this.value[this.count++]=ch; +},"~N"); +Clazz_defineMethod(c$,"append0", +function(string){ +if(string==null){ +this.appendNull(); +return; +}var adding=string.length; +var newSize=this.count+adding; +if(newSize>this.value.length){ +this.enlargeBuffer(newSize); +}else if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}string.getChars(0,adding,this.value,this.count); +this.count=newSize; +},"~S"); +Clazz_defineMethod(c$,"append0", +function(s,start,end){ +if(s==null)s="null"; +if(start<0||end<0||start>end||end>s.length())throw new IndexOutOfBoundsException(); +this.append0(s.subSequence(start,end).toString()); +},"CharSequence,~N,~N"); +Clazz_defineMethod(c$,"capacity", +function(){ +return this.value.length; +}); +Clazz_defineMethod(c$,"charAt", +function(index){ +if(index<0||index>=this.count)throw new StringIndexOutOfBoundsException(index); +return this.value[index]; +},"~N"); +Clazz_defineMethod(c$,"delete0", +function(start,end){ +if(start>=0){ +if(end>this.count){ +end=this.count; +}if(end==start){ +return; +}if(end>start){ +var length=this.count-end; +if(length>0){ +if(!this.shared){ +System.arraycopy(this.value,end,this.value,start,length); +}else{ +var newData=Clazz_newArray(this.value.length,'\0'); +System.arraycopy(this.value,0,newData,0,start); +System.arraycopy(this.value,end,newData,start,length); +this.value=newData; +this.shared=false; +}}this.count-=end-start; +return; +}}throw new StringIndexOutOfBoundsException(); +},"~N,~N"); +Clazz_defineMethod(c$,"deleteCharAt0", +function(location){ +if(0>location||location>=this.count)throw new StringIndexOutOfBoundsException(location); +var length=this.count-location-1; +if(length>0){ +if(!this.shared){ +System.arraycopy(this.value,location+1,this.value,location,length); +}else{ +var newData=Clazz_newArray(this.value.length,'\0'); +System.arraycopy(this.value,0,newData,0,location); +System.arraycopy(this.value,location+1,newData,location,length); +this.value=newData; +this.shared=false; +}}this.count--; +},"~N"); +Clazz_defineMethod(c$,"ensureCapacity", +function(min){ +if(min>this.value.length){ +this.enlargeBuffer(min); +}},"~N"); +Clazz_defineMethod(c$,"getChars", +function(start,end,dest,destStart){ +if(start>this.count||end>this.count||start>end){ +throw new StringIndexOutOfBoundsException(); +}System.arraycopy(this.value,start,dest,destStart,end-start); +},"~N,~N,~A,~N"); +Clazz_defineMethod(c$,"insert0", +function(index,chars){ +if(0>index||index>this.count){ +throw new StringIndexOutOfBoundsException(index); +}if(chars.length!=0){ +this.move(chars.length,index); +System.arraycopy(chars,0,this.value,index,chars.length); +this.count+=chars.length; +}},"~N,~A"); +Clazz_defineMethod(c$,"insert0", +function(index,chars,start,length){ +if(0<=index&&index<=this.count){ +if(start>=0&&0<=length&&length<=chars.length-start){ +if(length!=0){ +this.move(length,index); +System.arraycopy(chars,start,this.value,index,length); +this.count+=length; +}return; +}throw new StringIndexOutOfBoundsException("offset "+start+", len "+length+", array.length "+chars.length); +}throw new StringIndexOutOfBoundsException(index); +},"~N,~A,~N,~N"); +Clazz_defineMethod(c$,"insert0", +function(index,ch){ +if(0>index||index>this.count){ +throw new ArrayIndexOutOfBoundsException(index); +}this.move(1,index); +this.value[index]=ch; +this.count++; +},"~N,~N"); +Clazz_defineMethod(c$,"insert0", +function(index,string){ +if(0<=index&&index<=this.count){ +if(string==null)string="null"; +var min=string.length; +if(min!=0){ +this.move(min,index); +string.getChars(0,min,this.value,index); +this.count+=min; +}}else{ +throw new StringIndexOutOfBoundsException(index); +}},"~N,~S"); +Clazz_defineMethod(c$,"insert0", +function(index,s,start,end){ +if(s==null)s="null"; +if(index<0||index>this.count||start<0||end<0||start>end||end>s.length())throw new IndexOutOfBoundsException(); +this.insert0(index,s.subSequence(start,end).toString()); +},"~N,CharSequence,~N,~N"); +Clazz_defineMethod(c$,"length", +function(){ +return this.count; +}); +Clazz_defineMethod(c$,"move", +($fz=function(size,index){ +var newSize; +if(this.value.length-this.count>=size){ +if(!this.shared){ +System.arraycopy(this.value,index,this.value,index+size,this.count-index); +return; +}newSize=this.value.length; +}else{ +var a=this.count+size; +var b=(this.value.length<<1)+2; +newSize=a>b?a:b; +}var newData=Clazz_newArray(newSize,'\0'); +System.arraycopy(this.value,0,newData,0,index); +System.arraycopy(this.value,index,newData,index+size,this.count-index); +this.value=newData; +this.shared=false; +},$fz.isPrivate=true,$fz),"~N,~N"); +Clazz_defineMethod(c$,"replace0", +function(start,end,string){ +if(start>=0){ +if(end>this.count)end=this.count; +if(end>start){ +var stringLength=string.length; +var diff=end-start-stringLength; +if(diff>0){ +if(!this.shared){ +System.arraycopy(this.value,end,this.value,start+stringLength,this.count-end); +}else{ +var newData=Clazz_newArray(this.value.length,'\0'); +System.arraycopy(this.value,0,newData,0,start); +System.arraycopy(this.value,end,newData,start+stringLength,this.count-end); +this.value=newData; +this.shared=false; +}}else if(diff<0){ +this.move(-diff,end); +}else if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}string.getChars(0,stringLength,this.value,start); +this.count-=diff; +return; +}if(start==end){ +if(string==null)throw new NullPointerException(); +this.insert0(start,string); +return; +}}throw new StringIndexOutOfBoundsException(); +},"~N,~N,~S"); +Clazz_defineMethod(c$,"reverse0", +function(){ +if(this.count<2){ +return; +}if(!this.shared){ +for(var i=0,end=this.count,mid=Math.floor(this.count/2);iindex||index>=this.count){ +throw new StringIndexOutOfBoundsException(index); +}if(this.shared){ +this.value=this.value.clone(); +this.shared=false; +}this.value[index]=ch; +},"~N,~N"); +Clazz_defineMethod(c$,"setLength", +function(length){ +if(length<0)throw new StringIndexOutOfBoundsException(length); +if(this.countthis.value.length){ +this.enlargeBuffer(length); +}else{ +if(this.shared){ +var newData=Clazz_newArray(this.value.length,'\0'); +System.arraycopy(this.value,0,newData,0,this.count); +this.value=newData; +this.shared=false; +}else{ +for(var i=this.count;i=256&&this.count<=(this.value.length>>1))return String.instantialize(this.value,0,this.count); +this.shared=true; +return String.instantialize(0,this.count,this.value); +}); +Clazz_defineMethod(c$,"subSequence", +function(start,end){ +return this.substring(start,end); +},"~N,~N"); +Clazz_defineMethod(c$,"indexOf", +function(string){ +return this.indexOf(string,0); +},"~S"); +Clazz_defineMethod(c$,"indexOf", +function(subString,start){ +if(start<0)start=0; +var subCount=subString.length; +if(subCount>0){ +if(subCount+start>this.count)return-1; +var firstChar=subString.charAt(0); +while(true){ +var i=start; +var found=false; +for(;ithis.count)return-1; +var o1=i; +var o2=0; +while(++o2=0){ +if(subCount>0){ +if(start>this.count-subCount)start=this.count-subCount; +var firstChar=subString.charAt(0); +while(true){ +var i=start; +var found=false; +for(;i>=0;--i)if((this.value[i]).charCodeAt(0)==(firstChar).charCodeAt(0)){ +found=true; +break; +} +if(!found)return-1; +var o1=i; +var o2=0; +while(++o2 " + to); +if (original.slice) + return original.slice(from, to); + // MSIE and Chrome do not have Int32Array.slice() +var c = Clazz_newIntArray(newLength, 0); +for (var i = 0; i < newLength; i++) + c[i] = original[from++]; +return c; +}, "~A,~N,~N"); + +c$.sort=Clazz_overrideMethod(c$,"sort", +function(a,c,d,e){ + switch (arguments.length) { + case 1: + var aux=a.sort(function(o1,o2){ + if(typeof o1=="string"||o1 instanceof Comparable){ + return o1.compareTo(o2); + } + return o1-o2; + }); + for(var i=0;itoIndex)throw new IllegalArgumentException("fromIndex("+fromIndex+") > toIndex("+toIndex+")"); +if(fromIndex<0)throw new ArrayIndexOutOfBoundsException(fromIndex); +if(toIndex>arrayLen)throw new ArrayIndexOutOfBoundsException(toIndex); +},$fz.isPrivate=true,$fz),"~N,~N,~N"); +c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", +function(a,key){ +var low=0; +var high=a.length-1; +while(low<=high){ +var mid=(low+high)>>1; +var midVal=a[mid]; +if(midValkey)high=mid-1; +else return mid; +} +return-(low+1); +},"~A,~N"); +c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", +function(a,key){ +var low=0; +var high=a.length-1; +while(low<=high){ +var mid=(low+high)>>1; +var midVal=a[mid]; +var cmp=(midVal).compareTo(key); +if(cmp<0)low=mid+1; +else if(cmp>0)high=mid-1; +else return mid; +} +return-(low+1); +},"~A,~O"); +c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", +function(a,key,c){ +if(c==null)return java.util.Arrays.binarySearch(a,key); +var low=0; +var high=a.length-1; +while(low<=high){ +var mid=(low+high)>>1; +var midVal=a[mid]; +var cmp=c.compare(midVal,key); +if(cmp<0)low=mid+1; +else if(cmp>0)high=mid-1; +else return mid; +} +return-(low+1); +},"~A,~O,java.util.Comparator"); +c$.equals=Clazz_defineMethod(c$,"equals", +function(a,a2){ +if(a===a2)return true; +if(a==null||a2==null)return false; +var length=a.length; +if(a2.length!=length)return false; +for(var i=0;i 13) { +throw new IllegalArgumentException ("illegal cursor type"); +}var c = java.awt.Cursor.predefinedPrivate[type]; +if (c == null) { +java.awt.Cursor.predefinedPrivate[type] = c = new java.awt.Cursor (type); +}if (java.awt.Cursor.predefined[type] == null) { +java.awt.Cursor.predefined[type] = c; +}return c; +}, "~N"); +c$.getSystemCustomCursor = Clazz_defineMethod (c$, "getSystemCustomCursor", +function (name) { +return null; +}, "~S"); +c$.getDefaultCursor = Clazz_defineMethod (c$, "getDefaultCursor", +function () { +return java.awt.Cursor.getPredefinedCursor (0); +}); +Clazz_makeConstructor (c$, +function (type) { +if (type < 0 || type > 13) { +throw new IllegalArgumentException ("illegal cursor type"); +}this.type = type; +this.name = "TODO_CURSOR"; +}, "~N"); +Clazz_makeConstructor (c$, +function (name) { +this.type = -1; +this.name = name; +}, "~S"); +Clazz_defineMethod (c$, "getType", +function () { +return this.type; +}); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[" + this.getName () + "]"; +}); +Clazz_defineStatics (c$, +"DEFAULT_CURSOR", 0, +"CROSSHAIR_CURSOR", 1, +"TEXT_CURSOR", 2, +"WAIT_CURSOR", 3, +"SW_RESIZE_CURSOR", 4, +"SE_RESIZE_CURSOR", 5, +"NW_RESIZE_CURSOR", 6, +"NE_RESIZE_CURSOR", 7, +"N_RESIZE_CURSOR", 8, +"S_RESIZE_CURSOR", 9, +"W_RESIZE_CURSOR", 10, +"E_RESIZE_CURSOR", 11, +"HAND_CURSOR", 12, +"MOVE_CURSOR", 13); +c$.predefined = c$.prototype.predefined = new Array (14); +c$.predefinedPrivate = c$.prototype.predefinedPrivate = new Array (14); +Clazz_defineStatics (c$, +"cursorProperties", Clazz_newArray (-1, [ Clazz_newArray (-1, ["AWT.DefaultCursor", "Default Cursor"]), Clazz_newArray (-1, ["AWT.CrosshairCursor", "Crosshair Cursor"]), Clazz_newArray (-1, ["AWT.TextCursor", "Text Cursor"]), Clazz_newArray (-1, ["AWT.WaitCursor", "Wait Cursor"]), Clazz_newArray (-1, ["AWT.SWResizeCursor", "Southwest Resize Cursor"]), Clazz_newArray (-1, ["AWT.SEResizeCursor", "Southeast Resize Cursor"]), Clazz_newArray (-1, ["AWT.NWResizeCursor", "Northwest Resize Cursor"]), Clazz_newArray (-1, ["AWT.NEResizeCursor", "Northeast Resize Cursor"]), Clazz_newArray (-1, ["AWT.NResizeCursor", "North Resize Cursor"]), Clazz_newArray (-1, ["AWT.SResizeCursor", "South Resize Cursor"]), Clazz_newArray (-1, ["AWT.WResizeCursor", "West Resize Cursor"]), Clazz_newArray (-1, ["AWT.EResizeCursor", "East Resize Cursor"]), Clazz_newArray (-1, ["AWT.HandCursor", "Hand Cursor"]), Clazz_newArray (-1, ["AWT.MoveCursor", "Move Cursor"])]), +"CUSTOM_CURSOR", -1); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.lang.Error"], "java.awt.AWTError", null, function () { +c$ = Clazz_declareType (java.awt, "AWTError", Error); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (null, "java.awt.Insets", ["java.lang.InternalError"], function () { +c$ = Clazz_decorateAsClass (function () { +this.top = 0; +this.left = 0; +this.bottom = 0; +this.right = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "Insets", null, [Cloneable, java.io.Serializable]); +Clazz_makeConstructor (c$, +function (top, left, bottom, right) { +this.top = top; +this.left = left; +this.bottom = bottom; +this.right = right; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "set", +function (top, left, bottom, right) { +this.top = top; +this.left = left; +this.bottom = bottom; +this.right = right; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (Clazz_instanceOf (obj, java.awt.Insets)) { +var insets = obj; +return ((this.top == insets.top) && (this.left == insets.left) && (this.bottom == insets.bottom) && (this.right == insets.right)); +}return false; +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +var sum1 = this.left + this.bottom; +var sum2 = this.right + this.top; +var val1 = Clazz_doubleToInt (sum1 * (sum1 + 1) / 2) + this.left; +var val2 = Clazz_doubleToInt (sum2 * (sum2 + 1) / 2) + this.top; +var sum3 = val1 + val2; +return Clazz_doubleToInt (sum3 * (sum3 + 1) / 2) + val2; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[top=" + this.top + ",left=" + this.left + ",bottom=" + this.bottom + ",right=" + this.right + "]"; +}); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.Insets, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.util.Map", "$.HashMap"], "java.awt.RenderingHints", ["java.lang.IllegalArgumentException", "$.InternalError", "java.util.Collections"], function () { +c$ = Clazz_decorateAsClass (function () { +this.hintmap = null; +Clazz_instantialize (this, arguments); +}, java.awt, "RenderingHints", null, [java.util.Map, Cloneable]); +Clazz_prepareFields (c$, function () { +this.hintmap = new java.util.HashMap (7); +}); +Clazz_overrideMethod (c$, "size", +function () { +return this.hintmap.size (); +}); +Clazz_overrideMethod (c$, "isEmpty", +function () { +return this.hintmap.isEmpty (); +}); +Clazz_overrideMethod (c$, "containsKey", +function (key) { +return this.hintmap.containsKey (key); +}, "~O"); +Clazz_overrideMethod (c$, "containsValue", +function (value) { +return this.hintmap.containsValue (value); +}, "~O"); +Clazz_overrideMethod (c$, "get", +function (key) { +return this.hintmap.get (key); +}, "~O"); +Clazz_overrideMethod (c$, "put", +function (key, value) { +if (!(key).isCompatibleValue (value)) { +throw new IllegalArgumentException (value + " incompatible with " + key); +}return this.hintmap.put (key, value); +}, "~O,~O"); +Clazz_defineMethod (c$, "add", +function (hints) { +this.hintmap.putAll (hints.hintmap); +}, "java.awt.RenderingHints"); +Clazz_overrideMethod (c$, "clear", +function () { +this.hintmap.clear (); +}); +Clazz_overrideMethod (c$, "remove", +function (key) { +return this.hintmap.remove (key); +}, "~O"); +Clazz_overrideMethod (c$, "putAll", +function (m) { +if (java.awt.RenderingHints.isInstance (m)) { +for (var entry, $entry = m.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) this.hintmap.put (entry.getKey (), entry.getValue ()); + +} else { +for (var entry, $entry = m.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) this.put (entry.getKey (), entry.getValue ()); + +}}, "java.util.Map"); +Clazz_overrideMethod (c$, "keySet", +function () { +return this.hintmap.keySet (); +}); +Clazz_overrideMethod (c$, "values", +function () { +return this.hintmap.values (); +}); +Clazz_overrideMethod (c$, "entrySet", +function () { +return java.util.Collections.unmodifiableMap (this.hintmap).entrySet (); +}); +Clazz_overrideMethod (c$, "equals", +function (o) { +if (Clazz_instanceOf (o, java.awt.RenderingHints)) { +return this.hintmap.equals ((o).hintmap); +} else if (Clazz_instanceOf (o, java.util.Map)) { +return this.hintmap.equals (o); +}return false; +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +return this.hintmap.hashCode (); +}); +Clazz_overrideMethod (c$, "clone", +function () { +var rh; +try { +{ +rh = Clazz_clone(this); +if (this.hintmap != null) { rh.hintmap = +this.hintmap.cloneHM(); } +}} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +return rh; +}); +Clazz_overrideMethod (c$, "toString", +function () { +if (this.hintmap == null) { +return this.getClass ().getName () + "@" + Integer.toHexString (this.hashCode ()) + " (0 hints)"; +}return this.hintmap.toString (); +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.privatekey = 0; +Clazz_instantialize (this, arguments); +}, java.awt.RenderingHints, "Key"); +Clazz_defineMethod (c$, "getIdentity", + function () { +return this.getClass ().getName () + "@" + Integer.toHexString (System.identityHashCode (this.getClass ())) + ":" + Integer.toHexString (this.privatekey); +}); +Clazz_defineMethod (c$, "recordIdentity", + function (a) { +var b = a.getIdentity (); +var c = java.awt.RenderingHints.Key.identitymap.get (b); +if (c != null) { +var d = c; +if (d != null && d.getClass () === a.getClass ()) { +throw new IllegalArgumentException (b + " already registered"); +}}java.awt.RenderingHints.Key.identitymap.put (b, a); +}, "java.awt.RenderingHints.Key"); +Clazz_makeConstructor (c$, +function (a) { +this.privatekey = a; +this.recordIdentity (this); +}, "~N"); +Clazz_defineMethod (c$, "intKey", +function () { +return this.privatekey; +}); +Clazz_overrideMethod (c$, "equals", +function (a) { +return this === a; +}, "~O"); +c$.identitymap = c$.prototype.identitymap = new java.util.HashMap (17); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.description = null; +Clazz_instantialize (this, arguments); +}, java.awt.RenderingHints, "SunKey", java.awt.RenderingHints.Key); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.RenderingHints.SunKey, [a]); +this.description = b; +}, "~N,~S"); +Clazz_defineMethod (c$, "getIndex", +function () { +return this.privatekey; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.description; +}); +Clazz_overrideMethod (c$, "isCompatibleValue", +function (a) { +if (Clazz_instanceOf (a, java.awt.RenderingHints.Value)) { +return (a).isCompatibleKey (this); +}return false; +}, "~O"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.myKey = null; +this.index = 0; +this.description = null; +Clazz_instantialize (this, arguments); +}, java.awt.RenderingHints, "Value"); +c$.register = Clazz_defineMethod (c$, "register", + function (a, b) { +var c = a.getIndex (); +var d = b.getIndex (); +if (java.awt.RenderingHints.Value.ValueObjects[c][d] != null) { +throw new InternalError ("duplicate index: " + d); +}java.awt.RenderingHints.Value.ValueObjects[c][d] = b; +}, "java.awt.RenderingHints.SunKey,java.awt.RenderingHints.Value"); +c$.get = Clazz_defineMethod (c$, "get", +function (a, b) { +return java.awt.RenderingHints.Value.ValueObjects[a][b]; +}, "~N,~N"); +Clazz_makeConstructor (c$, +function (a, b, c) { +this.myKey = a; +this.index = b; +this.description = c; +java.awt.RenderingHints.Value.register (a, this); +}, "java.awt.RenderingHints.SunKey,~N,~S"); +Clazz_defineMethod (c$, "getIndex", +function () { +return this.index; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.description; +}); +Clazz_defineMethod (c$, "isCompatibleKey", +function (a) { +return this.myKey === a; +}, "java.awt.RenderingHints.SunKey"); +Clazz_overrideMethod (c$, "hashCode", +function () { +return this.description.hashCode (); +}); +Clazz_overrideMethod (c$, "equals", +function (a) { +return this === a; +}, "~O"); +c$.ValueObjects = c$.prototype.ValueObjects = Clazz_newArray (9, 8, null); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.RenderingHints, "LCDContrastKey", java.awt.RenderingHints.SunKey); +Clazz_overrideMethod (c$, "isCompatibleValue", +function (a) { +if (Clazz_instanceOf (a, Integer)) { +var b = (a).intValue (); +return b >= 100 && b <= 250; +}return false; +}, "~O"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"NUM_KEYS", 9, +"VALS_PER_KEY", 8, +"INTKEY_RENDERING", 0, +"INTVAL_RENDER_DEFAULT", 0, +"INTVAL_RENDER_SPEED", 1, +"INTVAL_RENDER_QUALITY", 2, +"INTKEY_ANTIALIASING", 1, +"INTVAL_ANTIALIAS_DEFAULT", 0, +"INTVAL_ANTIALIAS_OFF", 1, +"INTVAL_ANTIALIAS_ON", 2, +"INTKEY_TEXT_ANTIALIASING", 2, +"INTVAL_TEXT_ANTIALIAS_DEFAULT", 0, +"INTVAL_TEXT_ANTIALIAS_OFF", 1, +"INTVAL_TEXT_ANTIALIAS_ON", 2, +"INTVAL_TEXT_ANTIALIAS_GASP", 3, +"INTVAL_TEXT_ANTIALIAS_LCD_HRGB", 4, +"INTVAL_TEXT_ANTIALIAS_LCD_HBGR", 5, +"INTVAL_TEXT_ANTIALIAS_LCD_VRGB", 6, +"INTVAL_TEXT_ANTIALIAS_LCD_VBGR", 7, +"INTKEY_FRACTIONALMETRICS", 3, +"INTVAL_FRACTIONALMETRICS_DEFAULT", 0, +"INTVAL_FRACTIONALMETRICS_OFF", 1, +"INTVAL_FRACTIONALMETRICS_ON", 2, +"INTKEY_DITHERING", 4, +"INTVAL_DITHER_DEFAULT", 0, +"INTVAL_DITHER_DISABLE", 1, +"INTVAL_DITHER_ENABLE", 2, +"INTKEY_INTERPOLATION", 5, +"INTVAL_INTERPOLATION_NEAREST_NEIGHBOR", 0, +"INTVAL_INTERPOLATION_BILINEAR", 1, +"INTVAL_INTERPOLATION_BICUBIC", 2, +"INTKEY_ALPHA_INTERPOLATION", 6, +"INTVAL_ALPHA_INTERPOLATION_DEFAULT", 0, +"INTVAL_ALPHA_INTERPOLATION_SPEED", 1, +"INTVAL_ALPHA_INTERPOLATION_QUALITY", 2, +"INTKEY_COLOR_RENDERING", 7, +"INTVAL_COLOR_RENDER_DEFAULT", 0, +"INTVAL_COLOR_RENDER_SPEED", 1, +"INTVAL_COLOR_RENDER_QUALITY", 2, +"INTKEY_STROKE_CONTROL", 8, +"INTVAL_STROKE_DEFAULT", 0, +"INTVAL_STROKE_NORMALIZE", 1, +"INTVAL_STROKE_PURE", 2, +"INTKEY_AATEXT_LCD_CONTRAST", 100); +c$.KEY_RENDERING = c$.prototype.KEY_RENDERING = new java.awt.RenderingHints.SunKey (0, "Global rendering quality key"); +c$.VALUE_RENDER_SPEED = c$.prototype.VALUE_RENDER_SPEED = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_RENDERING, 1, "Fastest rendering methods"); +c$.VALUE_RENDER_QUALITY = c$.prototype.VALUE_RENDER_QUALITY = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_RENDERING, 2, "Highest quality rendering methods"); +c$.VALUE_RENDER_DEFAULT = c$.prototype.VALUE_RENDER_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_RENDERING, 0, "Default rendering methods"); +c$.KEY_ANTIALIASING = c$.prototype.KEY_ANTIALIASING = new java.awt.RenderingHints.SunKey (1, "Global antialiasing enable key"); +c$.VALUE_ANTIALIAS_ON = c$.prototype.VALUE_ANTIALIAS_ON = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ANTIALIASING, 2, "Antialiased rendering mode"); +c$.VALUE_ANTIALIAS_OFF = c$.prototype.VALUE_ANTIALIAS_OFF = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ANTIALIASING, 1, "Nonantialiased rendering mode"); +c$.VALUE_ANTIALIAS_DEFAULT = c$.prototype.VALUE_ANTIALIAS_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ANTIALIASING, 0, "Default antialiasing rendering mode"); +c$.KEY_FRACTIONALMETRICS = c$.prototype.KEY_FRACTIONALMETRICS = new java.awt.RenderingHints.SunKey (3, "Fractional metrics enable key"); +c$.VALUE_FRACTIONALMETRICS_ON = c$.prototype.VALUE_FRACTIONALMETRICS_ON = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_FRACTIONALMETRICS, 2, "Fractional text metrics mode"); +c$.VALUE_FRACTIONALMETRICS_OFF = c$.prototype.VALUE_FRACTIONALMETRICS_OFF = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_FRACTIONALMETRICS, 1, "Integer text metrics mode"); +c$.VALUE_FRACTIONALMETRICS_DEFAULT = c$.prototype.VALUE_FRACTIONALMETRICS_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_FRACTIONALMETRICS, 0, "Default fractional text metrics mode"); +c$.KEY_DITHERING = c$.prototype.KEY_DITHERING = new java.awt.RenderingHints.SunKey (4, "Dithering quality key"); +c$.VALUE_DITHER_ENABLE = c$.prototype.VALUE_DITHER_ENABLE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_DITHERING, 2, "Dithered rendering mode"); +c$.VALUE_DITHER_DISABLE = c$.prototype.VALUE_DITHER_DISABLE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_DITHERING, 1, "Nondithered rendering mode"); +c$.VALUE_DITHER_DEFAULT = c$.prototype.VALUE_DITHER_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_DITHERING, 0, "Default dithering mode"); +c$.KEY_INTERPOLATION = c$.prototype.KEY_INTERPOLATION = new java.awt.RenderingHints.SunKey (5, "Image interpolation method key"); +c$.VALUE_INTERPOLATION_NEAREST_NEIGHBOR = c$.prototype.VALUE_INTERPOLATION_NEAREST_NEIGHBOR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_INTERPOLATION, 0, "Nearest Neighbor image interpolation mode"); +c$.VALUE_INTERPOLATION_BILINEAR = c$.prototype.VALUE_INTERPOLATION_BILINEAR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_INTERPOLATION, 1, "Bilinear image interpolation mode"); +c$.VALUE_INTERPOLATION_BICUBIC = c$.prototype.VALUE_INTERPOLATION_BICUBIC = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_INTERPOLATION, 2, "Bicubic image interpolation mode"); +c$.KEY_ALPHA_INTERPOLATION = c$.prototype.KEY_ALPHA_INTERPOLATION = new java.awt.RenderingHints.SunKey (6, "Alpha blending interpolation method key"); +c$.VALUE_ALPHA_INTERPOLATION_SPEED = c$.prototype.VALUE_ALPHA_INTERPOLATION_SPEED = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, 1, "Fastest alpha blending methods"); +c$.VALUE_ALPHA_INTERPOLATION_QUALITY = c$.prototype.VALUE_ALPHA_INTERPOLATION_QUALITY = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, 2, "Highest quality alpha blending methods"); +c$.VALUE_ALPHA_INTERPOLATION_DEFAULT = c$.prototype.VALUE_ALPHA_INTERPOLATION_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_ALPHA_INTERPOLATION, 0, "Default alpha blending methods"); +c$.KEY_COLOR_RENDERING = c$.prototype.KEY_COLOR_RENDERING = new java.awt.RenderingHints.SunKey (7, "Color rendering quality key"); +c$.VALUE_COLOR_RENDER_SPEED = c$.prototype.VALUE_COLOR_RENDER_SPEED = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_COLOR_RENDERING, 1, "Fastest color rendering mode"); +c$.VALUE_COLOR_RENDER_QUALITY = c$.prototype.VALUE_COLOR_RENDER_QUALITY = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_COLOR_RENDERING, 2, "Highest quality color rendering mode"); +c$.VALUE_COLOR_RENDER_DEFAULT = c$.prototype.VALUE_COLOR_RENDER_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_COLOR_RENDERING, 0, "Default color rendering mode"); +c$.KEY_STROKE_CONTROL = c$.prototype.KEY_STROKE_CONTROL = new java.awt.RenderingHints.SunKey (8, "Stroke normalization control key"); +c$.VALUE_STROKE_DEFAULT = c$.prototype.VALUE_STROKE_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_STROKE_CONTROL, 0, "Default stroke normalization"); +c$.VALUE_STROKE_NORMALIZE = c$.prototype.VALUE_STROKE_NORMALIZE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_STROKE_CONTROL, 1, "Normalize strokes for consistent rendering"); +c$.VALUE_STROKE_PURE = c$.prototype.VALUE_STROKE_PURE = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_STROKE_CONTROL, 2, "Pure stroke conversion for accurate paths"); +c$.KEY_TEXT_ANTIALIASING = c$.prototype.KEY_TEXT_ANTIALIASING = new java.awt.RenderingHints.SunKey (2, "Text-specific antialiasing enable key"); +c$.VALUE_TEXT_ANTIALIAS_ON = c$.prototype.VALUE_TEXT_ANTIALIAS_ON = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 2, "Antialiased text mode"); +c$.VALUE_TEXT_ANTIALIAS_OFF = c$.prototype.VALUE_TEXT_ANTIALIAS_OFF = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 1, "Nonantialiased text mode"); +c$.VALUE_TEXT_ANTIALIAS_DEFAULT = c$.prototype.VALUE_TEXT_ANTIALIAS_DEFAULT = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 0, "Default antialiasing text mode"); +c$.VALUE_TEXT_ANTIALIAS_GASP = c$.prototype.VALUE_TEXT_ANTIALIAS_GASP = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 3, "gasp antialiasing text mode"); +c$.VALUE_TEXT_ANTIALIAS_LCD_HRGB = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_HRGB = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 4, "LCD HRGB antialiasing text mode"); +c$.VALUE_TEXT_ANTIALIAS_LCD_HBGR = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_HBGR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 5, "LCD HBGR antialiasing text mode"); +c$.VALUE_TEXT_ANTIALIAS_LCD_VRGB = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_VRGB = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 6, "LCD VRGB antialiasing text mode"); +c$.VALUE_TEXT_ANTIALIAS_LCD_VBGR = c$.prototype.VALUE_TEXT_ANTIALIAS_LCD_VBGR = new java.awt.RenderingHints.Value (java.awt.RenderingHints.KEY_TEXT_ANTIALIASING, 7, "LCD VBGR antialiasing text mode"); +c$.KEY_TEXT_ANTIALIAS_LCD_CONTRAST = c$.prototype.KEY_TEXT_ANTIALIAS_LCD_CONTRAST = new java.awt.RenderingHints.LCDContrastKey (100, "Text-specific LCD contrast key"); +c$.KEY_TEXT_LCD_CONTRAST = c$.prototype.KEY_TEXT_LCD_CONTRAST = java.awt.RenderingHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST; +}); +//BH note: a declared static superclass must come before a static class referencing it + +Clazz_load(["java.util.AbstractList","$.AbstractMap","$.AbstractSet","$.Collection","$.Iterator","$.List","$.ListIterator","$.Map","$.RandomAccess","$.Set","$.SortedMap","$.SortedSet","java.lang.NullPointerException","$.UnsupportedOperationException","java.lang.reflect.Array"],"java.util.Collections",["java.lang.ArrayIndexOutOfBoundsException","$.ClassCastException","$.IllegalArgumentException","$.IndexOutOfBoundsException","java.util.ArrayList","$.Arrays","$.Enumeration","java.util.Map.Entry","java.util.NoSuchElementException","$.Random"],function(){ +c$=Clazz_declareType(java.util,"Collections"); +c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", +function(list,object){ +if(list==null){ +throw new NullPointerException(); +}if(list.isEmpty()){ +return-1; +}var key=object; +if(!(Clazz_instanceOf(list,java.util.RandomAccess))){ +var it=list.listIterator(); +while(it.hasNext()){ +var result; +if((result=key.compareTo(it.next()))<=0){ +if(result==0){ +return it.previousIndex(); +}return-it.previousIndex()-1; +}} +return-list.size()-1; +}var low=0; +var mid=list.size(); +var high=mid-1; +var result=-1; +while(low<=high){ +mid=(low+high)>>1; +if((result=key.compareTo(list.get(mid)))>0){ +low=mid+1; +}else if(result==0){ +return mid; +}else{ +high=mid-1; +}} +return-mid-(result<0?1:2); +},"java.util.List,~O"); +c$.binarySearch=Clazz_defineMethod(c$,"binarySearch", +function(list,object,comparator){ +if(comparator==null){ +return java.util.Collections.binarySearch(list,object); +}if(!(Clazz_instanceOf(list,java.util.RandomAccess))){ +var it=list.listIterator(); +while(it.hasNext()){ +var result; +if((result=comparator.compare(object,it.next()))<=0){ +if(result==0){ +return it.previousIndex(); +}return-it.previousIndex()-1; +}} +return-list.size()-1; +}var low=0; +var mid=list.size(); +var high=mid-1; +var result=-1; +while(low<=high){ +mid=(low+high)>>1; +if((result=comparator.compare(object,list.get(mid)))>0){ +low=mid+1; +}else if(result==0){ +return mid; +}else{ +high=mid-1; +}} +return-mid-(result<0?1:2); +},"java.util.List,~O,java.util.Comparator"); +c$.copy=Clazz_defineMethod(c$,"copy", +function(destination,source){ +if(destination.size()0){ +min=next; +}} +return min; +},"java.util.Collection"); +c$.min=Clazz_defineMethod(c$,"min", +function(collection,comparator){ +var it=collection.iterator(); +var min=it.next(); +while(it.hasNext()){ +var next=it.next(); +if(comparator.compare(min,next)>0){ +min=next; +}} +return min; +},"java.util.Collection,java.util.Comparator"); +c$.nCopies=Clazz_defineMethod(c$,"nCopies", +function(length,object){ +return new java.util.Collections.CopiesList(length,object); +},"~N,~O"); +c$.reverse=Clazz_defineMethod(c$,"reverse", +function(list){ +var size=list.size(); +var front=list.listIterator(); +var back=list.listIterator(size); +for(var i=0;i0;i--){ +var index=random.nextInt()%(i+1); +if(index<0){ +index=-index; +}var temp=array[i]; +array[i]=array[index]; +array[index]=temp; +} +var i=0; +var it=list.listIterator(); +while(it.hasNext()){ +it.next(); +it.set(array[i++]); +} +}else{ +var rawList=list; +for(var i=rawList.size()-1;i>0;i--){ +var index=random.nextInt()%(i+1); +if(index<0){ +index=-index; +}rawList.set(index,rawList.set(i,rawList.get(index))); +} +}},"java.util.List,java.util.Random"); +c$.singleton=Clazz_defineMethod(c$,"singleton", +function(object){ +return new java.util.Collections.SingletonSet(object); +},"~O"); +c$.singletonList=Clazz_defineMethod(c$,"singletonList", +function(object){ +return new java.util.Collections.SingletonList(object); +},"~O"); +c$.singletonMap=Clazz_defineMethod(c$,"singletonMap", +function(key,value){ +return new java.util.Collections.SingletonMap(key,value); +},"~O,~O"); +c$.sort=Clazz_defineMethod(c$,"sort", +function(list){ +var array=list.toArray(); +java.util.Arrays.sort(array); +var i=0; +var it=list.listIterator(); +while(it.hasNext()){ +it.next(); +it.set(array[i++]); +} +},"java.util.List"); +c$.sort=Clazz_defineMethod(c$,"sort", +function(list,comparator){ +var array=list.toArray(new Array(list.size())); +java.util.Arrays.sort(array,comparator); +var i=0; +var it=list.listIterator(); +while(it.hasNext()){ +it.next(); +it.set(array[i++]); +} +},"java.util.List,java.util.Comparator"); +c$.swap=Clazz_defineMethod(c$,"swap", +function(list,index1,index2){ +if(list==null){ +throw new NullPointerException(); +}if(index1==index2){ +return; +}var rawList=list; +rawList.set(index2,rawList.set(index1,rawList.get(index2))); +},"java.util.List,~N,~N"); +c$.replaceAll=Clazz_defineMethod(c$,"replaceAll", +function(list,obj,obj2){ +var index; +var found=false; +while((index=list.indexOf(obj))>-1){ +found=true; +list.set(index,obj2); +} +return found; +},"java.util.List,~O,~O"); +c$.rotate=Clazz_defineMethod(c$,"rotate", +function(lst,dist){ +var list=lst; +var size=list.size(); +if(size==0){ +return; +}var normdist; +if(dist>0){ +normdist=dist%size; +}else{ +normdist=size-((dist%size)*(-1)); +}if(normdist==0||normdist==size){ +return; +}if(Clazz_instanceOf(list,java.util.RandomAccess)){ +var temp=list.get(0); +var index=0; +var beginIndex=0; +for(var i=0;isize){ +return-1; +}if(sublistSize==0){ +return 0; +}var firstObj=sublist.get(0); +var index=list.indexOf(firstObj); +if(index==-1){ +return-1; +}while(index=sublistSize)){ +var listIt=list.listIterator(index); +if((firstObj==null)?listIt.next()==null:firstObj.equals(listIt.next())){ +var sublistIt=sublist.listIterator(1); +var difFound=false; +while(sublistIt.hasNext()){ +var element=sublistIt.next(); +if(!listIt.hasNext()){ +return-1; +}if((element==null)?listIt.next()!=null:!element.equals(listIt.next())){ +difFound=true; +break; +}} +if(!difFound){ +return index; +}}index++; +} +return-1; +},"java.util.List,java.util.List"); +c$.lastIndexOfSubList=Clazz_defineMethod(c$,"lastIndexOfSubList", +function(list,sublist){ +var sublistSize=sublist.size(); +var size=list.size(); +if(sublistSize>size){ +return-1; +}if(sublistSize==0){ +return size; +}var lastObj=sublist.get(sublistSize-1); +var index=list.lastIndexOf(lastObj); +while((index>-1)&&(index+1>=sublistSize)){ +var listIt=list.listIterator(index+1); +if((lastObj==null)?listIt.previous()==null:lastObj.equals(listIt.previous())){ +var sublistIt=sublist.listIterator(sublistSize-1); +var difFound=false; +while(sublistIt.hasPrevious()){ +var element=sublistIt.previous(); +if(!listIt.hasPrevious()){ +return-1; +}if((element==null)?listIt.previous()!=null:!element.equals(listIt.previous())){ +difFound=true; +break; +}} +if(!difFound){ +return listIt.nextIndex(); +}}index--; +} +return-1; +},"java.util.List,java.util.List"); +c$.list=Clazz_defineMethod(c$,"list", +function(enumeration){ +var list=new java.util.ArrayList(); +while(enumeration.hasMoreElements()){ +list.add(enumeration.nextElement()); +} +return list; +},"java.util.Enumeration"); +c$.synchronizedCollection=Clazz_defineMethod(c$,"synchronizedCollection", +function(collection){ +if(collection==null){ +throw new NullPointerException(); +}return new java.util.Collections.SynchronizedCollection(collection); +},"java.util.Collection"); +c$.synchronizedList=Clazz_defineMethod(c$,"synchronizedList", +function(list){ +if(list==null){ +throw new NullPointerException(); +}if(Clazz_instanceOf(list,java.util.RandomAccess)){ +return new java.util.Collections.SynchronizedRandomAccessList(list); +}return new java.util.Collections.SynchronizedList(list); +},"java.util.List"); +c$.synchronizedMap=Clazz_defineMethod(c$,"synchronizedMap", +function(map){ +if(map==null){ +throw new NullPointerException(); +}return new java.util.Collections.SynchronizedMap(map); +},"java.util.Map"); +c$.synchronizedSet=Clazz_defineMethod(c$,"synchronizedSet", +function(set){ +if(set==null){ +throw new NullPointerException(); +}return new java.util.Collections.SynchronizedSet(set); +},"java.util.Set"); +c$.synchronizedSortedMap=Clazz_defineMethod(c$,"synchronizedSortedMap", +function(map){ +if(map==null){ +throw new NullPointerException(); +}return new java.util.Collections.SynchronizedSortedMap(map); +},"java.util.SortedMap"); +c$.synchronizedSortedSet=Clazz_defineMethod(c$,"synchronizedSortedSet", +function(set){ +if(set==null){ +throw new NullPointerException(); +}return new java.util.Collections.SynchronizedSortedSet(set); +},"java.util.SortedSet"); +c$.unmodifiableCollection=Clazz_defineMethod(c$,"unmodifiableCollection", +function(collection){ +if(collection==null){ +throw new NullPointerException(); +}return new java.util.Collections.UnmodifiableCollection(collection); +},"java.util.Collection"); +c$.unmodifiableList=Clazz_defineMethod(c$,"unmodifiableList", +function(list){ +if(list==null){ +throw new NullPointerException(); +}if(Clazz_instanceOf(list,java.util.RandomAccess)){ +return new java.util.Collections.UnmodifiableRandomAccessList(list); +}return new java.util.Collections.UnmodifiableList(list); +},"java.util.List"); +c$.unmodifiableMap=Clazz_defineMethod(c$,"unmodifiableMap", +function(map){ +if(map==null){ +throw new NullPointerException(); +}return new java.util.Collections.UnmodifiableMap(map); +},"java.util.Map"); +c$.unmodifiableSet=Clazz_defineMethod(c$,"unmodifiableSet", +function(set){ +if(set==null){ +throw new NullPointerException(); +}return new java.util.Collections.UnmodifiableSet(set); +},"java.util.Set"); +c$.unmodifiableSortedMap=Clazz_defineMethod(c$,"unmodifiableSortedMap", +function(map){ +if(map==null){ +throw new NullPointerException(); +}return new java.util.Collections.UnmodifiableSortedMap(map); +},"java.util.SortedMap"); +c$.unmodifiableSortedSet=Clazz_defineMethod(c$,"unmodifiableSortedSet", +function(set){ +if(set==null){ +throw new NullPointerException(); +}return new java.util.Collections.UnmodifiableSortedSet(set); +},"java.util.SortedSet"); +c$.frequency=Clazz_defineMethod(c$,"frequency", +function(c,o){ +if(c==null){ +throw new NullPointerException(); +}if(c.isEmpty()){ +return 0; +} +var result=0; +var itr=c.iterator(); +while(itr.hasNext()){ +var e=itr.next(); +if(o==null?e==null:o.equals(e)){ +result++; +}} +return result; +},"java.util.Collection,~O"); + +c$.emptyList=Clazz_defineMethod(c$,"emptyList", +function(){ +return java.util.Collections.EMPTY_LIST; +}); +c$.emptySet=Clazz_defineMethod(c$,"emptySet", +function(){ +return java.util.Collections.EMPTY_SET; +}); +c$.emptyMap=Clazz_defineMethod(c$,"emptyMap", +function(){ +return java.util.Collections.EMPTY_MAP; +}); +c$.checkedCollection=Clazz_defineMethod(c$,"checkedCollection", +function(c,type){ +return new java.util.Collections.CheckedCollection(c,type); +},"java.util.Collection,Class"); +c$.checkedMap=Clazz_defineMethod(c$,"checkedMap", +function(m,keyType,valueType){ +return new java.util.Collections.CheckedMap(m,keyType,valueType); +},"java.util.Map,Class,Class"); +c$.checkedList=Clazz_defineMethod(c$,"checkedList", +function(list,type){ +if(Clazz_instanceOf(list,java.util.RandomAccess)){ +return new java.util.Collections.CheckedRandomAccessList(list,type); +}return new java.util.Collections.CheckedList(list,type); +},"java.util.List,Class"); +c$.checkedSet=Clazz_defineMethod(c$,"checkedSet", +function(s,type){ +return new java.util.Collections.CheckedSet(s,type); +},"java.util.Set,Class"); +c$.checkedSortedMap=Clazz_defineMethod(c$,"checkedSortedMap", +function(m,keyType,valueType){ +return new java.util.Collections.CheckedSortedMap(m,keyType,valueType); +},"java.util.SortedMap,Class,Class"); +c$.checkedSortedSet=Clazz_defineMethod(c$,"checkedSortedSet", +function(s,type){ +return new java.util.Collections.CheckedSortedSet(s,type); +},"java.util.SortedSet,Class"); +c$.addAll=Clazz_defineMethod(c$,"addAll", +function(c,a){ +var modified=false; +for(var i=0;ic1.size()){ +var tmp=c1; +c1=c2; +c2=tmp; +}var it=c1.iterator(); +while(it.hasNext()){ +if(c2.contains(it.next())){ +return false; +}} +return true; +},"java.util.Collection,java.util.Collection"); +c$.checkType=Clazz_defineMethod(c$,"checkType", +function(obj,type){ +if(!type.isInstance(obj)){ +throw new ClassCastException("Attempt to insert "+obj.getClass()+" element into collection with element type "+type); +}return obj; +},"~O,Class"); + +c$.$Collections$1$=function(c){ +Clazz_pu$h(self.c$); +c$=Clazz_decorateAsClass(function(){ +Clazz_prepareCallback(this,arguments); +this.it=null; +Clazz_instantialize(this,arguments); +},java.util,"Collections$1",null,java.util.Enumeration); + +Clazz_prepareFields(c$,function(){ +this.it=c.iterator(); +}); + +Clazz_defineMethod(c$,"hasMoreElements", +function(){ +return this.it.hasNext(); +}); +Clazz_defineMethod(c$,"nextElement", +function(){ +return this.it.next(); +}); +c$=Clazz_p0p(); +}; + +Clazz_pu$h(self.c$); +c$=Clazz_decorateAsClass(function(){ +this.n=0; +this.element=null; +Clazz_instantialize(this,arguments); +},java.util.Collections,"CopiesList",java.util.AbstractList,java.io.Serializable); +Clazz_makeConstructor(c$, +function(a,b){ +Clazz_superConstructor(this,java.util.Collections.CopiesList,[]); +if(a<0){ +throw new IllegalArgumentException(); +}this.n=a; +this.element=b; +},"~N,~O"); +Clazz_overrideMethod(c$,"contains", +function(a){ +return this.element==null?a==null:this.element.equals(a); +},"~O"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.n; +}); +Clazz_overrideMethod(c$,"get", +function(a){ +if(0<=a&&a=0;){ +b[d]=c.next(); +} +return b; +}); +Clazz_defineMethod(c$,"toArray", +function(a){ +var b=this.c.size(); +var c=0; +var d=this.iterator(); +if(b>a.length){ +var e=a.getClass().getComponentType(); +a=java.lang.reflect.Array.newInstance(e,b); +}while(c>>(48-bits)); +},"~N"); +Clazz_defineMethod(c$,"nextBoolean", +function(){ +return Math.random()>0.5; +}); +Clazz_defineMethod(c$,"nextBytes", +function(buf){ +for(var i=0;i=1); +var norm=Math.sqrt(-2*Math.log(s)/s); +this.nextNextGaussian=v2*norm; +this.haveNextNextGaussian=true; +return v1*norm; +}); +Clazz_defineMethod(c$,"nextInt", +function(){ +return Math.ceil(0xffff*Math.random())-0x8000; +}); +Clazz_defineMethod(c$,"nextInt", +function(n){ +if(n>0){ +n = Math.min(n, 31); +return Math.floor((2 << (n - 1)) * Math.random()) + +/* +if((n&-n)==n){ +return((n*this.next(31))>>31); +}var bits; +var val; +do{ +bits=this.next(31); +val=bits%n; +}while(bits-val+(n-1)<0); + + +return val; + +*/ +} +throw new IllegalArgumentException(); +},"~N"); +Clazz_defineMethod(c$,"nextLong", +function(){ +return Math.ceil(0xffffffff*Math.random())-0x80000000; +}); +Clazz_defineMethod(c$,"setSeed", +function(seed){ +Math.seedrandom(seed); +//this.seed=(seed^25214903917)&(281474976710655); +//this.haveNextNextGaussian=false; +},"~N"); +Clazz_defineStatics(c$, +"multiplier",0x5deece66d); +}); + +// seedrandom.js +// Author: David Bau 3/11/2010 +// +// Defines a method Math.seedrandom() that, when called, substitutes +// an explicitly seeded RC4-based algorithm for Math.random(). Also +// supports automatic seeding from local or network sources of entropy. +// +// Usage: +// +// +// +// Math.seedrandom('yipee'); Sets Math.random to a function that is +// initialized using the given explicit seed. +// +// Math.seedrandom(); Sets Math.random to a function that is +// seeded using the current time, dom state, +// and other accumulated local entropy. +// The generated seed string is returned. +// +// Math.seedrandom('yowza', true); +// Seeds using the given explicit seed mixed +// together with accumulated entropy. +// +// +// Seeds using physical random bits downloaded +// from random.org. +// +// Examples: +// +// Math.seedrandom("hello"); // Use "hello" as the seed. +// document.write(Math.random()); // Always 0.5463663768140734 +// document.write(Math.random()); // Always 0.43973793770592234 +// var rng1 = Math.random; // Remember the current prng. +// +// var autoseed = Math.seedrandom(); // New prng with an automatic seed. +// document.write(Math.random()); // Pretty much unpredictable. +// +// Math.random = rng1; // Continue "hello" prng sequence. +// document.write(Math.random()); // Always 0.554769432473455 +// +// Math.seedrandom(autoseed); // Restart at the previous seed. +// document.write(Math.random()); // Repeat the 'unpredictable' value. +// +// Notes: +// +// Each time seedrandom('arg') is called, entropy from the passed seed +// is accumulated in a pool to help generate future seeds for the +// zero-argument form of Math.seedrandom, so entropy can be injected over +// time by calling seedrandom with explicit data repeatedly. +// +// On speed - This javascript implementation of Math.random() is about +// 3-10x slower than the built-in Math.random() because it is not native +// code, but this is typically fast enough anyway. Seeding is more expensive, +// especially if you use auto-seeding. Some details (timings on Chrome 4): +// +// Our Math.random() - avg less than 0.002 milliseconds per call +// seedrandom('explicit') - avg less than 0.5 milliseconds per call +// seedrandom('explicit', true) - avg less than 2 milliseconds per call +// seedrandom() - avg about 38 milliseconds per call +// +// LICENSE (BSD): +// +// Copyright 2010 David Bau, all rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of this module nor the names of its contributors may +// be used to endorse or promote products derived from this software +// without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +/** + * All code is in an anonymous closure to keep the global namespace clean. + * + * @param {number=} overflow + * @param {number=} startdenom + */ +(function (pool, math, width, chunks, significance, overflow, startdenom) { + +var copyright = "Copyright 2010 David Bau, all rights reserved. (BSD)" +// +// seedrandom() +// This is the seedrandom function described above. +// +math['seedrandom'] = function seedrandom(seed, use_entropy) { + var key = []; + var arc4; + + // Flatten the seed string or build one from local entropy if needed. + seed = mixkey(flatten( + use_entropy ? [seed, pool] : + arguments.length ? seed : + [new Date().getTime(), pool, window], 3), key); + + // Use the seed to initialize an ARC4 generator. + arc4 = new ARC4(key); + + // Mix the randomness into accumulated entropy. + mixkey(arc4.S, pool); + + // Override Math.random + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + + math['random'] = function random() { // Closure to return a random double: + var n = arc4.g(chunks); // Start with a numerator n < 2 ^ 48 + var d = startdenom; // and denominator d = 2 ^ 48. + var x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + // Return the seed that was used + return seed; +}; + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +/** @constructor */ +function ARC4(key) { + var t, u, me = this, keylen = key.length; + var i = 0, j = me.i = me.j = me.m = 0; + me.S = []; + me.c = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { me.S[i] = i++; } + for (i = 0; i < width; i++) { + t = me.S[i]; + j = lowbits(j + t + key[i % keylen]); + u = me.S[j]; + me.S[i] = u; + me.S[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + me.g = function getnext(count) { + var s = me.S; + var i = lowbits(me.i + 1); var t = s[i]; + var j = lowbits(me.j + t); var u = s[j]; + s[i] = u; + s[j] = t; + var r = s[lowbits(t + u)]; + while (--count) { + i = lowbits(i + 1); t = s[i]; + j = lowbits(j + t); u = s[j]; + s[i] = u; + s[j] = t; + r = r * width + s[lowbits(t + u)]; + } + me.i = i; + me.j = j; + return r; + }; + // For robust unpredictability discard an initial batch of values. + // See http://www.rsa.com/rsalabs/node.asp?id=2009 + me.g(width); +} + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +/** @param {Object=} result + * @param {string=} prop */ +function flatten(obj, depth, result, prop) { + result = []; + if (depth && typeof(obj) == 'object') { + for (prop in obj) { + if (prop.indexOf('S') < 5) { // Avoid FF3 bug (local/sessionStorage) + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + } + return result.length ? result : '' + obj; +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +/** @param {number=} smear + * @param {number=} j */ +function mixkey(seed, key, smear, j) { + seed += ''; // Ensure the seed is a string + smear = 0; + for (j = 0; j < seed.length; j++) { + key[lowbits(j)] = + lowbits((smear ^= key[lowbits(j)] * 19) + seed.charCodeAt(j)); + } + seed = ''; + for (j in key) { seed += String.fromCharCode(key[j]); } + return seed; +} + +// +// lowbits() +// A quick "n mod width" for width a power of 2. +// +function lowbits(n) { return n & (width - 1); } + +// +// The following constants are related to IEEE 754 limits. +// +startdenom = math.pow(width, chunks); +significance = math.pow(2, significance); +overflow = significance * 2; + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to intefere with determinstic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// End anonymous scope, and pass initial values. +})( + [], // pool: entropy pool starts empty + Math, // math: package containing random, pow, and seedrandom + 256, // width: each RC4 output is 0 <= x < 256 + 6, // chunks: at least six RC4 outputs for each double + 52 // significance: there are 52 significant digits in a double +); + +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.util.EventListenerProxy", "java.awt.event.AWTEventListener"], "java.awt.event.AWTEventListenerProxy", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.eventMask = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "AWTEventListenerProxy", java.util.EventListenerProxy, java.awt.event.AWTEventListener); +Clazz_makeConstructor (c$, +function (eventMask, listener) { +Clazz_superConstructor (this, java.awt.event.AWTEventListenerProxy, [listener]); +this.eventMask = eventMask; +}, "~N,java.awt.event.AWTEventListener"); +Clazz_defineMethod (c$, "eventDispatched", +function (evt) { +(this.getListener ()).eventDispatched (evt); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "getEventMask", +function () { +return this.eventMask; +}); +}); +Clazz_declarePackage ("java.beans"); +Clazz_load (["java.beans.ChangeListenerMap"], "java.beans.PropertyChangeSupport", ["java.lang.Boolean", "$.NullPointerException", "java.beans.IndexedPropertyChangeEvent", "$.PropertyChangeEvent", "$.PropertyChangeListenerProxy"], function () { +c$ = Clazz_decorateAsClass (function () { +this.map = null; +this.source = null; +Clazz_instantialize (this, arguments); +}, java.beans, "PropertyChangeSupport"); +Clazz_prepareFields (c$, function () { +this.map = new java.beans.PropertyChangeSupport.PropertyChangeListenerMap (); +}); +Clazz_makeConstructor (c$, +function (sourceBean) { +if (sourceBean == null) { +throw new NullPointerException (); +}this.source = sourceBean; +}, "~O"); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (listener) { +this.addPropertyChangeListener1 (listener); +}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "addPropertyChangeListener1", +function (listener) { +if (listener == null) { +return; +}if (Clazz_instanceOf (listener, java.beans.PropertyChangeListenerProxy)) { +var proxy = listener; +this.addPropertyChangeListener (proxy.getPropertyName (), proxy.getListener ()); +} else { +this.map.add (null, listener); +}}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (listener) { +if (listener == null) { +return; +}if (Clazz_instanceOf (listener, java.beans.PropertyChangeListenerProxy)) { +var proxy = listener; +this.removePropertyChangeListener (proxy.getPropertyName (), proxy.getListener ()); +} else { +this.map.remove (null, listener); +}}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +return this.map.getListeners (); +}); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (propertyName, listener) { +{ +if (arguments.length == 1) { +this.addPropertyChangeListener1(propertyName); +return; +} +}this.addPropertyChangeListener2 (propertyName, listener); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "addPropertyChangeListener2", +function (propertyName, listener) { +if (listener == null || propertyName == null) { +return; +}listener = this.map.extract (listener); +if (listener != null) { +this.map.add (propertyName, listener); +}}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (propertyName, listener) { +if (listener == null || propertyName == null) { +return; +}listener = this.map.extract (listener); +if (listener != null) { +this.map.remove (propertyName, listener); +}}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function (propertyName) { +return this.map.getListeners (propertyName); +}, "~S"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +if (oldValue != null && newValue != null && oldValue.equals (newValue)) { +return; +}this.firePropertyChangeEvt ( new java.beans.PropertyChangeEvent (this.source, propertyName, oldValue, newValue)); +}, "~S,~O,~O"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +if (oldValue == newValue) { +return; +}this.firePropertyChange (propertyName, Integer.$valueOf (oldValue), Integer.$valueOf (newValue)); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +if (oldValue == newValue) { +return; +}this.firePropertyChange (propertyName, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); +}, "~S,~B,~B"); +Clazz_defineMethod (c$, "firePropertyChangeEvt", +function (evt) { +var oldValue = evt.getOldValue (); +var newValue = evt.getNewValue (); +var propertyName = evt.getPropertyName (); +if (oldValue != null && newValue != null && oldValue.equals (newValue)) { +return; +}var common = this.map.get (null); +var named = (propertyName != null) ? this.map.get (propertyName) : null; +this.fire (common, evt); +this.fire (named, evt); +}, "java.beans.PropertyChangeEvent"); +Clazz_defineMethod (c$, "fire", + function (listeners, event) { +if (listeners != null) { +for (var listener, $listener = 0, $$listener = listeners; $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) { +listener.propertyChange (event); +} +}}, "~A,java.beans.PropertyChangeEvent"); +Clazz_defineMethod (c$, "fireIndexedPropertyChange", +function (propertyName, index, oldValue, newValue) { +this.firePropertyChangeEvt ( new java.beans.IndexedPropertyChangeEvent (this.source, propertyName, oldValue, newValue, index)); +}, "~S,~N,~O,~O"); +Clazz_defineMethod (c$, "fireIndexedPropertyChange", +function (propertyName, index, oldValue, newValue) { +if (oldValue == newValue) { +return; +}this.fireIndexedPropertyChange (propertyName, index, Integer.$valueOf (oldValue), Integer.$valueOf (newValue)); +}, "~S,~N,~N,~N"); +Clazz_defineMethod (c$, "fireIndexedPropertyChange", +function (propertyName, index, oldValue, newValue) { +if (oldValue == newValue) { +return; +}this.fireIndexedPropertyChange (propertyName, index, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); +}, "~S,~N,~B,~B"); +Clazz_defineMethod (c$, "hasListeners", +function (propertyName) { +return this.map.hasListeners (propertyName); +}, "~S"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.beans.PropertyChangeSupport, "PropertyChangeListenerMap", java.beans.ChangeListenerMap); +Clazz_overrideMethod (c$, "newArray", +function (a) { +return (0 < a) ? new Array (a) : java.beans.PropertyChangeSupport.PropertyChangeListenerMap.EMPTY; +}, "~N"); +Clazz_overrideMethod (c$, "newProxy", +function (a, b) { +return new java.beans.PropertyChangeListenerProxy (a, b); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineStatics (c$, +"EMPTY", Clazz_newArray (-1, [])); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.beans"); +Clazz_load (null, "java.beans.ChangeListenerMap", ["java.util.ArrayList", "$.Collections", "$.EventListenerProxy", "$.HashMap"], function () { +c$ = Clazz_decorateAsClass (function () { +this.map = null; +Clazz_instantialize (this, arguments); +}, java.beans, "ChangeListenerMap"); +Clazz_defineMethod (c$, "add", +function (name, listener) { +if (this.map == null) { +this.map = new java.util.HashMap (); +}var array = this.map.get (name); +var size = (array != null) ? array.length : 0; +var clone = this.newArray (size + 1); +clone[size] = listener; +if (array != null) { +System.arraycopy (array, 0, clone, 0, size); +}this.map.put (name, clone); +}, "~S,~O"); +Clazz_defineMethod (c$, "remove", +function (name, listener) { +if (this.map != null) { +var array = this.map.get (name); +if (array != null) { +for (var i = 0; i < array.length; i++) { +if (listener.equals (array[i])) { +var size = array.length - 1; +if (size > 0) { +var clone = this.newArray (size); +System.arraycopy (array, 0, clone, 0, i); +System.arraycopy (array, i + 1, clone, i, size - i); +this.map.put (name, clone); +} else { +this.map.remove (name); +if (this.map.isEmpty ()) { +this.map = null; +}}break; +}} +}}}, "~S,~O"); +Clazz_defineMethod (c$, "get", +function (name) { +return (this.map != null) ? this.map.get (name) : null; +}, "~S"); +Clazz_defineMethod (c$, "set", +function (name, listeners) { +if (listeners != null) { +if (this.map == null) { +this.map = new java.util.HashMap (); +}this.map.put (name, listeners); +} else if (this.map != null) { +this.map.remove (name); +if (this.map.isEmpty ()) { +this.map = null; +}}}, "~S,~A"); +Clazz_defineMethod (c$, "getListeners", +function () { +if (this.map == null) { +return this.newArray (0); +}var list = new java.util.ArrayList (); +var listeners = this.map.get (null); +if (listeners != null) { +for (var listener, $listener = 0, $$listener = listeners; $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) { +list.add (listener); +} +}for (var entry, $entry = this.map.entrySet ().iterator (); $entry.hasNext () && ((entry = $entry.next ()) || true);) { +var name = entry.getKey (); +if (name != null) { +for (var listener, $listener = 0, $$listener = entry.getValue (); $listener < $$listener.length && ((listener = $$listener[$listener]) || true); $listener++) { +list.add (this.newProxy (name, listener)); +} +}} +return list.toArray (this.newArray (list.size ())); +}); +Clazz_defineMethod (c$, "getListeners", +function (name) { +if (name != null) { +var listeners = this.get (name); +if (listeners != null) { +return listeners.clone (); +}}return this.newArray (0); +}, "~S"); +Clazz_defineMethod (c$, "hasListeners", +function (name) { +if (this.map == null) { +return false; +}var array = this.map.get (null); +return (array != null) || ((name != null) && (null != this.map.get (name))); +}, "~S"); +Clazz_defineMethod (c$, "getEntries", +function () { +return (this.map != null) ? this.map.entrySet () : java.util.Collections.emptySet (); +}); +Clazz_defineMethod (c$, "extract", +function (listener) { +while (Clazz_instanceOf (listener, java.util.EventListenerProxy)) { +var proxy = listener; +listener = proxy.getListener (); +} +return listener; +}, "~O"); +}); +Clazz_declarePackage ("java.beans"); +Clazz_load (["java.beans.PropertyChangeEvent"], "java.beans.IndexedPropertyChangeEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.index = 0; +Clazz_instantialize (this, arguments); +}, java.beans, "IndexedPropertyChangeEvent", java.beans.PropertyChangeEvent); +Clazz_makeConstructor (c$, +function (source, propertyName, oldValue, newValue, index) { +Clazz_superConstructor (this, java.beans.IndexedPropertyChangeEvent, [source, propertyName, oldValue, newValue]); +this.index = index; +}, "~O,~S,~O,~O,~N"); +Clazz_defineMethod (c$, "getIndex", +function () { +return this.index; +}); +}); +Clazz_declarePackage ("java.beans"); +Clazz_load (["java.util.EventObject"], "java.beans.PropertyChangeEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.propertyName = null; +this.newValue = null; +this.oldValue = null; +this.propagationId = null; +Clazz_instantialize (this, arguments); +}, java.beans, "PropertyChangeEvent", java.util.EventObject); +Clazz_makeConstructor (c$, +function (source, propertyName, oldValue, newValue) { +Clazz_superConstructor (this, java.beans.PropertyChangeEvent, [source]); +this.propertyName = propertyName; +this.newValue = newValue; +this.oldValue = oldValue; +}, "~O,~S,~O,~O"); +Clazz_defineMethod (c$, "getPropertyName", +function () { +return this.propertyName; +}); +Clazz_defineMethod (c$, "getNewValue", +function () { +return this.newValue; +}); +Clazz_defineMethod (c$, "getOldValue", +function () { +return this.oldValue; +}); +Clazz_defineMethod (c$, "setPropagationId", +function (propagationId) { +this.propagationId = propagationId; +}, "~O"); +Clazz_defineMethod (c$, "getPropagationId", +function () { +return this.propagationId; +}); +}); +Clazz_declarePackage ("java.beans"); +Clazz_load (["java.util.EventListenerProxy", "java.beans.PropertyChangeListener"], "java.beans.PropertyChangeListenerProxy", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.propertyName = null; +Clazz_instantialize (this, arguments); +}, java.beans, "PropertyChangeListenerProxy", java.util.EventListenerProxy, java.beans.PropertyChangeListener); +Clazz_makeConstructor (c$, +function (propertyName, listener) { +Clazz_superConstructor (this, java.beans.PropertyChangeListenerProxy, [listener]); +this.propertyName = propertyName; +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "propertyChange", +function (evt) { +(this.getListener ()).propertyChange (evt); +}, "java.beans.PropertyChangeEvent"); +Clazz_defineMethod (c$, "getPropertyName", +function () { +return this.propertyName; +}); +}); +Clazz_declarePackage ("java.beans"); +Clazz_load (["java.util.EventListener"], "java.beans.PropertyChangeListener", null, function () { +Clazz_declareInterface (java.beans, "PropertyChangeListener", java.util.EventListener); +}); +Clazz_declarePackage ("java.security"); +Clazz_declareInterface (java.security, "PrivilegedAction"); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.geom.Point2D"], "java.awt.Point", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "Point", java.awt.geom.Point2D); +Clazz_makeConstructor (c$, +function () { +this.construct (0, 0); +}); +Clazz_makeConstructor (c$, +function (p) { +this.construct (p.x, p.y); +}, "java.awt.Point"); +Clazz_makeConstructor (c$, +function (x, y) { +Clazz_superConstructor (this, java.awt.Point, []); +this.x = x; +this.y = y; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "getLocation", +function () { +return new java.awt.Point (this.x, this.y); +}); +Clazz_defineMethod (c$, "setLocation", +function (p) { +this.setLocation (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "setLocation", +function (x, y) { +this.x = Clazz_doubleToInt (Math.floor (x + 0.5)); +this.y = Clazz_doubleToInt (Math.floor (y + 0.5)); +}, "~N,~N"); +Clazz_defineMethod (c$, "move", +function (x, y) { +this.x = x; +this.y = y; +}, "~N,~N"); +Clazz_defineMethod (c$, "translate", +function (dx, dy) { +this.x += dx; +this.y += dy; +}, "~N,~N"); +Clazz_defineMethod (c$, "equals", +function (obj) { +if (Clazz_instanceOf (obj, java.awt.Point)) { +var pt = obj; +return (this.x == pt.x) && (this.y == pt.y); +}return Clazz_superCall (this, java.awt.Point, "equals", [obj]); +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + "]"; +}); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (["java.lang.StringBuffer", "java.util.Collections", "$.HashMap", "$.IdentityHashMap"], ["jssun.awt.AppContext", "$.MostRecentThreadAppContext", "$.MostRecentKeyValue"], ["java.lang.Thread", "java.util.HashSet", "java.beans.PropertyChangeSupport"], function () { +c$ = Clazz_decorateAsClass (function () { +this.table = null; +this.threadGroup = null; +this.changeSupport = null; +this.$isDisposed = false; +this.mostRecentKeyValue = null; +this.shadowMostRecentKeyValue = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "AppContext"); +Clazz_prepareFields (c$, function () { +this.table = new java.util.HashMap (); +}); +c$.getAppContexts = Clazz_defineMethod (c$, "getAppContexts", +function () { +return new java.util.HashSet (jssun.awt.AppContext.threadGroup2appContext.values ()); +}); +Clazz_defineMethod (c$, "isDisposed", +function () { +return this.$isDisposed; +}); +Clazz_makeConstructor (c$, +function (threadGroup) { +jssun.awt.AppContext.numAppContexts++; +this.threadGroup = threadGroup; +jssun.awt.AppContext.threadGroup2appContext.put (threadGroup, this); +}, "ThreadGroup"); +c$.getAppContext = Clazz_defineMethod (c$, "getAppContext", +function () { +var currentThread = Thread.currentThread (); +var appContext = null; +var recent = jssun.awt.AppContext.mostRecentThreadAppContext; +if ((recent != null) && (recent.thread === currentThread)) { +appContext = recent.appContext; +} else { +var currentThreadGroup = currentThread.getThreadGroup (); +var threadGroup = currentThreadGroup; +appContext = jssun.awt.AppContext.threadGroup2appContext.get (threadGroup); +while (appContext == null) { +threadGroup = threadGroup.getParent (); +if (threadGroup == null) { +return null; +}appContext = jssun.awt.AppContext.threadGroup2appContext.get (threadGroup); +} +for (var tg = currentThreadGroup; tg !== threadGroup; tg = tg.getParent ()) { +jssun.awt.AppContext.threadGroup2appContext.put (tg, appContext); +} +jssun.awt.AppContext.mostRecentThreadAppContext = new jssun.awt.MostRecentThreadAppContext (currentThread, appContext); +}return appContext; +}); +c$.isMainContext = Clazz_defineMethod (c$, "isMainContext", +function (ctx) { +return false; +}, "jssun.awt.AppContext"); +Clazz_defineMethod (c$, "dispose", +function () { +}); +Clazz_defineMethod (c$, "get", +function (key) { +{ +var recent = this.mostRecentKeyValue; +if ((recent != null) && (recent.key === key)) { +return recent.value; +}var value = this.table.get (key); +if (this.mostRecentKeyValue == null) { +this.mostRecentKeyValue = new jssun.awt.MostRecentKeyValue (key, value); +this.shadowMostRecentKeyValue = new jssun.awt.MostRecentKeyValue (key, value); +} else { +var auxKeyValue = this.mostRecentKeyValue; +this.shadowMostRecentKeyValue.setPair (key, value); +this.mostRecentKeyValue = this.shadowMostRecentKeyValue; +this.shadowMostRecentKeyValue = auxKeyValue; +}return value; +}}, "~O"); +Clazz_defineMethod (c$, "put", +function (key, value) { +{ +var recent = this.mostRecentKeyValue; +if ((recent != null) && (recent.key === key)) recent.value = value; +return this.table.put (key, value); +}}, "~O,~O"); +Clazz_defineMethod (c$, "remove", +function (key) { +{ +var recent = this.mostRecentKeyValue; +if ((recent != null) && (recent.key === key)) recent.value = null; +return this.table.remove (key); +}}, "~O"); +Clazz_defineMethod (c$, "getThreadGroup", +function () { +return this.threadGroup; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[threadGroup=" + this.threadGroup.getName () + "]"; +}); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +if (this.changeSupport == null) { +return new Array (0); +}return this.changeSupport.getPropertyChangeListeners (); +}); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (propertyName, listener) { +if (listener == null) { +return; +}if (this.changeSupport == null) { +this.changeSupport = new java.beans.PropertyChangeSupport (this); +}this.changeSupport.addPropertyChangeListener (propertyName, listener); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (propertyName, listener) { +if (listener == null || this.changeSupport == null) { +return; +}this.changeSupport.removePropertyChangeListener (propertyName, listener); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function (propertyName) { +if (this.changeSupport == null) { +return new Array (0); +}return this.changeSupport.getPropertyChangeListeners (propertyName); +}, "~S"); +c$.EVENT_QUEUE_KEY = c$.prototype.EVENT_QUEUE_KEY = new StringBuffer ("EventQueue"); +c$.threadGroup2appContext = c$.prototype.threadGroup2appContext = java.util.Collections.synchronizedMap ( new java.util.IdentityHashMap ()); +Clazz_defineStatics (c$, +"DISPOSED_PROPERTY_NAME", "disposed", +"GUI_DISPOSED", "guidisposed", +"numAppContexts", 0, +"mostRecentThreadAppContext", null); +c$ = Clazz_decorateAsClass (function () { +this.thread = null; +this.appContext = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "MostRecentThreadAppContext"); +Clazz_makeConstructor (c$, +function (key, value) { +this.thread = key; +this.appContext = value; +}, "Thread,jssun.awt.AppContext"); +c$ = Clazz_decorateAsClass (function () { +this.key = null; +this.value = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "MostRecentKeyValue"); +Clazz_makeConstructor (c$, +function (k, v) { +this.key = k; +this.value = v; +}, "~O,~O"); +Clazz_defineMethod (c$, "setPair", +function (k, v) { +this.key = k; +this.value = v; +}, "~O,~O"); +}); +Clazz_load(["java.lang.AbstractStringBuilder","$.Appendable"],"java.lang.StringBuffer",["java.lang.Character","$.Double","$.Float","$.Long"],function(){ +c$=Clazz_declareType(java.lang,"StringBuffer",AbstractStringBuilder,[Appendable,java.io.Serializable,CharSequence]); +Clazz_makeConstructor(c$, +function(cs){ +if(cs==null){ +throw new NullPointerException(); +} +Clazz_superConstructor(this,StringBuffer,[cs.toString()]); +},"CharSequence"); +Clazz_defineMethod(c$,"append", +function(b){ +return this.append(b?"true":"false"); +},"~B"); +Clazz_defineMethod(c$,"append", +function(ch){ +this.append0(ch); +return this; +},"~N"); +Clazz_defineMethod(c$,"append", +function(d){ +return this.append(Double.toString(d)); +},"~N"); +Clazz_defineMethod(c$,"append", +function(obj){ +if(obj==null){ +this.appendNull(); +}else{ +this.append0(obj.toString()); +}return this; +},"~O"); +Clazz_defineMethod(c$,"append", +function(string){ +this.append0(string); +return this; +},"~S"); +Clazz_defineMethod(c$,"append", +function(sb){ +if(sb==null){ +this.appendNull(); +}else{ +{ +this.append0(sb.getValue(),0,sb.length()); +}}return this; +},"StringBuffer"); +Clazz_defineMethod(c$,"append", +function(chars){ +this.append0(chars); +return this; +},"~A"); +Clazz_defineMethod(c$,"append", +function(chars,start,length){ +this.append0(chars,start,length); +return this; +},"~A,~N,~N"); +Clazz_defineMethod(c$,"append", +function(s){ +if(s==null){ +this.appendNull(); +}else{ +this.append0(s.toString()); +}return this; +},"CharSequence"); +Clazz_defineMethod(c$,"append", +function(s,start,end){ +this.append0(s,start,end); +return this; +},"CharSequence,~N,~N"); +Clazz_defineMethod(c$,"appendCodePoint", +function(codePoint){ +return this.append(Character.toChars(codePoint)); +},"~N"); +Clazz_defineMethod(c$,"$delete", +function(start,end){ +this.delete0(start,end); +return this; +},"~N,~N"); +Clazz_defineMethod(c$,"deleteCharAt", +function(location){ +this.deleteCharAt0(location); +return this; +},"~N"); +Clazz_defineMethod(c$,"insert", +function(index,ch){ +this.insert0(index,ch); +return this; +},"~N,~N"); +Clazz_defineMethod(c$,"insert", +function(index,b){ +return this.insert(index,b?"true":"false"); +},"~N,~B"); +Clazz_defineMethod(c$,"insert", +function(index,i){ +return this.insert(index,Integer.toString(i)); +},"~N,~N"); +Clazz_defineMethod(c$,"insert", +function(index,l){ +return this.insert(index,Long.toString(l)); +},"~N,~N"); +Clazz_defineMethod(c$,"insert", +function(index,d){ +return this.insert(index,Double.toString(d)); +},"~N,~N"); +Clazz_defineMethod(c$,"insert", +function(index,f){ +return this.insert(index,Float.toString(f)); +},"~N,~N"); +Clazz_defineMethod(c$,"insert", +function(index,obj){ +return this.insert(index,obj==null?"null":obj.toString()); +},"~N,~O"); +Clazz_defineMethod(c$,"insert", +function(index,string){ +this.insert0(index,string); +return this; +},"~N,~S"); +Clazz_defineMethod(c$,"insert", +function(index,chars){ +this.insert0(index,chars); +return this; +},"~N,~A"); +Clazz_defineMethod(c$,"insert", +function(index,chars,start,length){ +this.insert0(index,chars,start,length); +return this; +},"~N,~A,~N,~N"); +Clazz_defineMethod(c$,"insert", +function(index,s){ +this.insert0(index,s==null?"null":s.toString()); +return this; +},"~N,CharSequence"); +Clazz_defineMethod(c$,"insert", +function(index,s,start,end){ +this.insert0(index,s,start,end); +return this; +},"~N,CharSequence,~N,~N"); +Clazz_defineMethod(c$,"replace", +function(start,end,string){ +this.replace0(start,end,string); +return this; +},"~N,~N,~S"); +Clazz_defineMethod(c$,"reverse", +function(){ +this.reverse0(); +return this; +}); +Clazz_overrideMethod(c$,"subSequence", +function(start,end){ +return Clazz_superCall(this,StringBuffer,"substring",[start,end]); +},"~N,~N"); +}); +Clazz_load(["java.util.AbstractMap","$.AbstractSet","$.Iterator","$.Map","$.MapEntry"],"java.util.IdentityHashMap",["java.lang.IllegalArgumentException","$.IllegalStateException","java.util.AbstractCollection","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.NoSuchElementException"],function(){ +c$=Clazz_decorateAsClass(function(){ +this.elementData=null; +this.$size=0; +this.threshold=0; +this.modCount=0; +Clazz_instantialize(this,arguments); +},java.util,"IdentityHashMap",java.util.AbstractMap,[java.util.Map,java.io.Serializable,Cloneable]); +Clazz_makeConstructor(c$, +function(){ +this.construct(21); +}); +Clazz_makeConstructor(c$, +function(maxSize){ +Clazz_superConstructor(this,java.util.IdentityHashMap,[]); +if(maxSize>=0){ +this.$size=0; +this.threshold=this.getThreshold(maxSize); +this.elementData=this.newElementArray(this.computeElementArraySize()); +}else{ +throw new IllegalArgumentException(); +}},"~N"); +Clazz_defineMethod(c$,"getThreshold", +($fz=function(maxSize){ +return maxSize>3?maxSize:3; +},$fz.isPrivate=true,$fz),"~N"); +Clazz_defineMethod(c$,"computeElementArraySize", +($fz=function(){ +return(Math.floor((this.threshold*10000)/7500))*2; +},$fz.isPrivate=true,$fz)); +Clazz_defineMethod(c$,"newElementArray", +($fz=function(s){ +return new Array(s); +},$fz.isPrivate=true,$fz),"~N"); +Clazz_makeConstructor(c$, +function(map){ +this.construct(map.size()<6?11:map.size()*2); +this.putAllImpl(map); +},"java.util.Map"); +Clazz_defineMethod(c$,"massageValue", +($fz=function(value){ +return((value===java.util.IdentityHashMap.NULL_OBJECT)?null:value); +},$fz.isPrivate=true,$fz),"~O"); +Clazz_overrideMethod(c$,"clear", +function(){ +this.$size=0; +for(var i=0;ithis.threshold){ +this.rehash(); +index=this.findIndex(_key,this.elementData); +}this.elementData[index]=_key; +this.elementData[index+1]=null; +}var result=this.elementData[index+1]; +this.elementData[index+1]=_value; +return this.massageValue(result); +},"~O,~O"); +Clazz_overrideMethod(c$,"putAll", +function(map){ +this.putAllImpl(map); +},"java.util.Map"); +Clazz_defineMethod(c$,"rehash", +($fz=function(){ +var newlength=this.elementData.length<<1; +if(newlength==0){ +newlength=1; +}var newData=this.newElementArray(newlength); +for(var i=0;iindex; +if(next= 0) { +return true; +}var owner = this.getOwner_NoClientCode (); +return (owner != null) && owner.isModalExcluded (exclusionType); +}, "java.awt.Dialog.ModalExclusionType"); +Clazz_defineMethod (c$, "updateChildrenBlocking", +function () { +}); +Clazz_defineMethod (c$, "addWindowListener", +function (l) { +if (l == null) { +return; +}this.newEventsOnly = true; +this.windowListener = java.awt.AWTEventMulticaster.add (this.windowListener, l); +}, "java.awt.event.WindowListener"); +Clazz_defineMethod (c$, "addWindowStateListener", +function (l) { +if (l == null) { +return; +}this.windowStateListener = java.awt.AWTEventMulticaster.add (this.windowStateListener, l); +this.newEventsOnly = true; +}, "java.awt.event.WindowStateListener"); +Clazz_defineMethod (c$, "addWindowFocusListener", +function (l) { +if (l == null) { +return; +}this.windowFocusListener = java.awt.AWTEventMulticaster.add (this.windowFocusListener, l); +this.newEventsOnly = true; +}, "java.awt.event.WindowFocusListener"); +Clazz_defineMethod (c$, "removeWindowListener", +function (l) { +if (l == null) { +return; +}this.windowListener = java.awt.AWTEventMulticaster.remove (this.windowListener, l); +}, "java.awt.event.WindowListener"); +Clazz_defineMethod (c$, "removeWindowStateListener", +function (l) { +if (l == null) { +return; +}this.windowStateListener = java.awt.AWTEventMulticaster.remove (this.windowStateListener, l); +}, "java.awt.event.WindowStateListener"); +Clazz_defineMethod (c$, "removeWindowFocusListener", +function (l) { +if (l == null) { +return; +}this.windowFocusListener = java.awt.AWTEventMulticaster.remove (this.windowFocusListener, l); +}, "java.awt.event.WindowFocusListener"); +Clazz_defineMethod (c$, "getWindowListeners", +function () { +return (this.getListeners (java.awt.event.WindowListener)); +}); +Clazz_defineMethod (c$, "getWindowFocusListeners", +function () { +return (this.getListeners (java.awt.event.WindowFocusListener)); +}); +Clazz_defineMethod (c$, "getWindowStateListeners", +function () { +return (this.getListeners (java.awt.event.WindowStateListener)); +}); +Clazz_defineMethod (c$, "getListeners", +function (listenerType) { +var l = null; +if (listenerType === java.awt.event.WindowFocusListener) { +l = this.windowFocusListener; +} else if (listenerType === java.awt.event.WindowStateListener) { +l = this.windowStateListener; +} else if (listenerType === java.awt.event.WindowListener) { +l = this.windowListener; +} else { +return Clazz_superCall (this, java.awt.Window, "getListeners", [listenerType]); +}return java.awt.AWTEventMulticaster.getListeners (l, listenerType); +}, "Class"); +Clazz_defineMethod (c$, "eventEnabled", +function (e) { +switch (e.id) { +case 200: +case 201: +case 202: +case 203: +case 204: +case 205: +case 206: +if ((this.eventMask & 64) != 0 || this.windowListener != null) { +return true; +}return false; +case 207: +case 208: +if ((this.eventMask & 524288) != 0 || this.windowFocusListener != null) { +return true; +}return false; +case 209: +if ((this.eventMask & 262144) != 0 || this.windowStateListener != null) { +return true; +}return false; +default: +break; +} +return Clazz_superCall (this, java.awt.Window, "eventEnabled", [e]); +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "processEvent", +function (e) { +if (Clazz_instanceOf (e, java.awt.event.WindowEvent)) { +switch (e.getID ()) { +case 200: +case 201: +case 202: +case 203: +case 204: +case 205: +case 206: +this.processWindowEvent (e); +break; +case 207: +case 208: +this.processWindowFocusEvent (e); +break; +case 209: +this.processWindowStateEvent (e); +default: +break; +} +return; +}this.processEventCont (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "processWindowEvent", +function (e) { +var listener = this.windowListener; +if (listener != null) { +switch (e.getID ()) { +case 200: +listener.windowOpened (e); +break; +case 201: +listener.windowClosing (e); +break; +case 202: +listener.windowClosed (e); +break; +case 203: +listener.windowIconified (e); +break; +case 204: +listener.windowDeiconified (e); +break; +case 205: +listener.windowActivated (e); +break; +case 206: +listener.windowDeactivated (e); +break; +default: +break; +} +}}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "processWindowFocusEvent", +function (e) { +var listener = this.windowFocusListener; +if (listener != null) { +switch (e.getID ()) { +case 207: +listener.windowGainedFocus (e); +break; +case 208: +listener.windowLostFocus (e); +break; +default: +break; +} +}}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "processWindowStateEvent", +function (e) { +var listener = this.windowStateListener; +if (listener != null) { +switch (e.getID ()) { +case 209: +listener.windowStateChanged (e); +break; +default: +break; +} +}}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "preProcessKeyEvent", +function (e) { +}, "java.awt.event.KeyEvent"); +Clazz_overrideMethod (c$, "postProcessKeyEvent", +function (e) { +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "setAlwaysOnTop", +function (alwaysOnTop) { +var oldAlwaysOnTop; +{ +oldAlwaysOnTop = this.alwaysOnTop; +this.alwaysOnTop = alwaysOnTop; +}if (oldAlwaysOnTop != alwaysOnTop) { +if (this.isAlwaysOnTopSupported ()) { +}this.firePropertyChangeBool ("alwaysOnTop", oldAlwaysOnTop, alwaysOnTop); +}}, "~B"); +Clazz_defineMethod (c$, "isAlwaysOnTopSupported", +function () { +return java.awt.Toolkit.getDefaultToolkit ().isAlwaysOnTopSupported (); +}); +Clazz_defineMethod (c$, "isAlwaysOnTop", +function () { +return this.alwaysOnTop; +}); +Clazz_defineMethod (c$, "isActive", +function () { +return false; +}); +Clazz_defineMethod (c$, "isFocused", +function () { +return swingjs.JSToolkit.isFocused (this); +}); +Clazz_overrideMethod (c$, "getFocusTraversalKeys", +function (id) { +return null; +}, "~N"); +Clazz_defineMethod (c$, "setFocusCycleRoot", +function (focusCycleRoot) { +}, "~B"); +Clazz_defineMethod (c$, "isFocusCycleRoot", +function () { +return true; +}); +Clazz_overrideMethod (c$, "getFocusCycleRootAncestor", +function () { +return null; +}); +Clazz_defineMethod (c$, "isFocusableWindow", +function () { +if (!this.getFocusableWindowState ()) { +return false; +}if (Clazz_instanceOf (this, java.awt.Frame) || Clazz_instanceOf (this, java.awt.Dialog)) { +return true; +}for (var owner = this.getOwner (); owner != null; owner = owner.getOwner ()) { +if (Clazz_instanceOf (owner, java.awt.Frame) || Clazz_instanceOf (owner, java.awt.Dialog)) { +return owner.isShowing (); +}} +return false; +}); +Clazz_defineMethod (c$, "getFocusableWindowState", +function () { +return this.focusableWindowState; +}); +Clazz_defineMethod (c$, "setFocusableWindowState", +function (focusableWindowState) { +var oldFocusableWindowState; +{ +oldFocusableWindowState = this.focusableWindowState; +this.focusableWindowState = focusableWindowState; +}this.firePropertyChangeBool ("focusableWindowState", oldFocusableWindowState, focusableWindowState); +if (oldFocusableWindowState && !focusableWindowState && this.isFocused ()) { +for (var owner = this.getOwner (); owner != null; owner = owner.getOwner ()) { +} +}}, "~B"); +Clazz_defineMethod (c$, "dispatchEventImpl", +function (e) { +if (e.getID () == 101) { +this.invalidate (); +this.validate (); +}Clazz_superCall (this, java.awt.Window, "dispatchEventImpl", [e]); +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "postEvent", +function (e) { +if (this.handleEvent (e)) { +e.consume (); +return true; +}return false; +}, "java.awt.Event"); +Clazz_defineMethod (c$, "isShowing", +function () { +return this.visible; +}); +Clazz_defineMethod (c$, "applyResourceBundle", +function (rb) { +this.applyComponentOrientation (java.awt.ComponentOrientation.getOrientation (rb)); +}, "java.util.ResourceBundle"); +Clazz_defineMethod (c$, "applyResourceBundle", +function (rbName) { +this.applyResourceBundle (java.util.ResourceBundle.getBundle (rbName)); +}, "~S"); +Clazz_defineMethod (c$, "addOwnedWindow", +function (weakWindow) { +if (weakWindow != null) { +{ +if (!this.ownedWindowList.contains (weakWindow)) { +this.ownedWindowList.addElement (weakWindow); +}}}}, "java.awt.Window"); +Clazz_defineMethod (c$, "removeOwnedWindow", +function (weakWindow) { +if (weakWindow != null) { +this.ownedWindowList.removeElement (weakWindow); +}}, "java.awt.Window"); +Clazz_defineMethod (c$, "connectOwnedWindow", +function (child) { +child.parent = this; +this.addOwnedWindow (child); +}, "java.awt.Window"); +Clazz_defineMethod (c$, "addToWindowList", + function () { +var windowList = this.appContext.get (java.awt.Window); +if (windowList == null) { +windowList = new java.util.Vector (); +this.appContext.put (java.awt.Window, windowList); +}windowList.add (this); +}); +c$.removeFromWindowList = Clazz_defineMethod (c$, "removeFromWindowList", + function (context, w) { +{ +var windowList = context.get (java.awt.Window); +if (windowList != null) { +windowList.remove (w); +}}}, "jssun.awt.AppContext,java.awt.Window"); +Clazz_defineMethod (c$, "getGraphicsConfiguration", +function () { +if (this.graphicsConfig == null) this.graphicsConfig = swingjs.JSToolkit.getGraphicsConfiguration (); +return this.graphicsConfig; +}); +Clazz_overrideMethod (c$, "resetGC", +function () { +}); +Clazz_defineMethod (c$, "setLocationRelativeTo", +function (c) { +var root = null; +if (c != null) { +if (Clazz_instanceOf (c, java.awt.Window) || Clazz_instanceOf (c, java.applet.Applet)) { +root = c; +} else { +var parent; +for (parent = c.getParent (); parent != null; parent = parent.getParent ()) { +if (Clazz_instanceOf (parent, java.awt.Window) || Clazz_instanceOf (parent, java.applet.Applet)) { +root = parent; +break; +}} +}}if ((c != null && !c.isShowing ()) || root == null || !root.isShowing ()) { +var paneSize = this.getSize (); +var centerPoint = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ().getCenterPoint (); +this.setLocation (centerPoint.x - Clazz_doubleToInt (paneSize.width / 2), centerPoint.y - Clazz_doubleToInt (paneSize.height / 2)); +} else { +var invokerSize = c.getSize (); +var invokerScreenLocation = c.getLocationOnScreen (); +var windowBounds = this.getBounds (); +var dx = invokerScreenLocation.x + ((invokerSize.width - windowBounds.width) >> 1); +var dy = invokerScreenLocation.y + ((invokerSize.height - windowBounds.height) >> 1); +var ss = root.getGraphicsConfiguration ().getBounds (); +if (dy + windowBounds.height > ss.y + ss.height) { +dy = ss.y + ss.height - windowBounds.height; +if (invokerScreenLocation.x - ss.x + Clazz_doubleToInt (invokerSize.width / 2) < Clazz_doubleToInt (ss.width / 2)) { +dx = invokerScreenLocation.x + invokerSize.width; +} else { +dx = invokerScreenLocation.x - windowBounds.width; +}}if (dx + windowBounds.width > ss.x + ss.width) { +dx = ss.x + ss.width - windowBounds.width; +}if (dx < ss.x) dx = ss.x; +if (dy < ss.y) dy = ss.y; +this.setLocation (dx, dy); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "deliverMouseWheelToAncestor", +function (e) { +}, "java.awt.event.MouseWheelEvent"); +Clazz_overrideMethod (c$, "dispatchMouseWheelToAncestor", +function (e) { +return false; +}, "java.awt.event.MouseWheelEvent"); +Clazz_defineMethod (c$, "getTemporaryLostComponent", +function () { +return this.temporaryLostComponent; +}); +Clazz_defineMethod (c$, "setTemporaryLostComponent", +function (component) { +var previousComp = this.temporaryLostComponent; +if (component == null || component.canBeFocusOwner ()) { +this.temporaryLostComponent = component; +} else { +this.temporaryLostComponent = null; +}return previousComp; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "canContainFocusOwner", +function (focusOwnerCandidate) { +return Clazz_superCall (this, java.awt.Window, "canContainFocusOwner", [focusOwnerCandidate]) && this.isFocusableWindow (); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "setBounds", +function (r) { +this.setBounds (r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_overrideMethod (c$, "isRecursivelyVisible", +function () { +return this.visible; +}); +Clazz_defineMethod (c$, "getOpacity", +function () { +{ +return this.opacity; +}}); +Clazz_defineMethod (c$, "setOpacity", +function (opacity) { +{ +if (opacity < 0.0 || opacity > 1.0) { +throw new IllegalArgumentException ("The value of opacity should be in the range [0.0f .. 1.0f]."); +}this.opacity = opacity; +}}, "~N"); +Clazz_defineMethod (c$, "getShape", +function () { +{ +return this.shape; +}}); +Clazz_defineMethod (c$, "setShape", +function (shape) { +{ +this.shape = shape; +}}, "java.awt.Shape"); +Clazz_defineMethod (c$, "setOpaque", +function (opaque) { +{ +java.awt.Window.setLayersOpaque (this, opaque); +this.opaque = opaque; +var peer = this.getPeer (); +if (peer != null) { +peer.setOpaque (opaque); +}}}, "~B"); +c$.setLayersOpaque = Clazz_defineMethod (c$, "setLayersOpaque", + function (component, isOpaque) { +if (Clazz_instanceOf (component, javax.swing.RootPaneContainer)) { +var rpc = component; +var root = rpc.getRootPane (); +var lp = root.getLayeredPane (); +var c = root.getContentPane (); +var content = (Clazz_instanceOf (c, javax.swing.JComponent)) ? c : null; +lp.setOpaque (isOpaque); +root.setOpaque (isOpaque); +root.setDoubleBuffered (isOpaque); +if (content != null) { +content.setOpaque (isOpaque); +content.setDoubleBuffered (isOpaque); +var numChildren = content.getComponentCount (); +if (numChildren > 0) { +var child = content.getComponent (0); +if (Clazz_instanceOf (child, javax.swing.RootPaneContainer)) { +java.awt.Window.setLayersOpaque (child, isOpaque); +}}}}var bg = component.getBackground (); +var hasTransparentBg = java.awt.Window.TRANSPARENT_BACKGROUND_COLOR.equals (bg); +var container = null; +if (Clazz_instanceOf (component, java.awt.Container)) { +container = component; +}if (isOpaque) { +if (hasTransparentBg) { +var newColor = null; +if (container != null && container.preserveBackgroundColor != null) { +newColor = container.preserveBackgroundColor; +} else { +newColor = new java.awt.Color (255, 255, 255); +}component.setBackground (newColor); +}} else { +if (!hasTransparentBg && container != null) { +container.preserveBackgroundColor = bg; +}component.setBackground (java.awt.Window.TRANSPARENT_BACKGROUND_COLOR); +}}, "java.awt.Component,~B"); +Clazz_overrideMethod (c$, "getContainer", +function () { +return null; +}); +Clazz_overrideMethod (c$, "mixOnReshaping", +function () { +}); +Clazz_overrideMethod (c$, "getLocationOnWindow", +function () { +return new java.awt.Point (0, 0); +}); +c$.$Window$1DisposeAction$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, java.awt, "Window$1DisposeAction", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +var a; +{ +a = new Array (this.b$["java.awt.Window"].ownedWindowList.size ()); +this.b$["java.awt.Window"].ownedWindowList.copyInto (a); +}for (var b = 0; b < a.length; b++) { +var c = (((a[b]))); +if (c != null) { +c.disposeImpl (); +}} +this.b$["java.awt.Window"].hide (); +this.b$["java.awt.Window"].beforeFirstShow = true; +this.b$["java.awt.Window"].removeNotify (); +this.b$["java.awt.Window"].clearCurrentFocusCycleRootOnHide (); +}); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"systemSyncLWRequests", false, +"OPENED", 0x01, +"base", "win", +"nameCounter", 0); +c$.allWindows = c$.prototype.allWindows = new java.util.ArrayList (); +c$.TRANSPARENT_BACKGROUND_COLOR = c$.prototype.TRANSPARENT_BACKGROUND_COLOR = new java.awt.Color (0, 0, 0, 0); +c$ = Clazz_decorateAsClass (function () { +this.focusRoot = null; +this.focusOwner = null; +Clazz_instantialize (this, arguments); +}, java.awt, "FocusManager"); +}); +Clazz_load(["java.util.AbstractList","$.List","$.RandomAccess"],"java.util.Vector",["java.lang.ArrayIndexOutOfBoundsException","$.IllegalArgumentException","$.IndexOutOfBoundsException","$.StringBuffer","java.lang.reflect.Array","java.util.Arrays","$.Collections","$.Enumeration","$.NoSuchElementException"],function(){ +c$=Clazz_decorateAsClass(function(){ +this.elementCount=0; +this.elementData=null; +this.capacityIncrement=0; +Clazz_instantialize(this,arguments); +},java.util,"Vector",java.util.AbstractList,[java.util.List,java.util.RandomAccess,Cloneable,java.io.Serializable]); +Clazz_makeConstructor(c$, +function(){ +this.construct(10,0); +}); +Clazz_makeConstructor(c$, +function(capacity){ +this.construct(capacity,0); +},"~N"); +Clazz_makeConstructor(c$, +function(capacity,capacityIncrement){ +Clazz_superConstructor(this,java.util.Vector,[]); +this.elementCount=0; +try{ +this.elementData=this.newElementArray(capacity); +}catch(e){ +if(Clazz_instanceOf(e,NegativeArraySizeException)){ +throw new IllegalArgumentException(); +}else{ +throw e; +} +} +this.capacityIncrement=capacityIncrement; +},"~N,~N"); +Clazz_makeConstructor(c$, +function(collection){ +this.construct(collection.size(),0); +var it=collection.iterator(); +while(it.hasNext()){ +this.elementData[this.elementCount++]=it.next(); +} +},"java.util.Collection"); +Clazz_defineMethod(c$,"newElementArray", +($fz=function(size){ +return new Array(size); +},$fz.isPrivate=true,$fz),"~N"); +Clazz_defineMethod(c$,"add", +function(location,object){ +this.insertElementAt(object,location); +},"~N,~O"); +Clazz_defineMethod(c$,"add", +function(object){ +this.addElement(object); +return true; +},"~O"); +Clazz_defineMethod(c$,"addAll", +function(location,collection){ +if(0<=location&&location<=this.elementCount){ +var size=collection.size(); +if(size==0){ +return false; +}var required=size-(this.elementData.length-this.elementCount); +if(required>0){ +this.growBy(required); +}var count=this.elementCount-location; +if(count>0){ +System.arraycopy(this.elementData,location,this.elementData,location+size,count); +}var it=collection.iterator(); +while(it.hasNext()){ +this.elementData[location++]=it.next(); +} +this.elementCount+=size; +this.modCount++; +return true; +}throw new ArrayIndexOutOfBoundsException(location); +},"~N,java.util.Collection"); +Clazz_defineMethod(c$,"addAll", +function(collection){ +return this.addAll(this.elementCount,collection); +},"java.util.Collection"); +Clazz_defineMethod(c$,"addElement", +function(object){ +if(this.elementCount==this.elementData.length){ +this.growByOne(); +}this.elementData[this.elementCount++]=object; +this.modCount++; +},"~O"); +Clazz_defineMethod(c$,"capacity", +function(){ +return this.elementData.length; +}); +Clazz_overrideMethod(c$,"clear", +function(){ +this.removeAllElements(); +}); +Clazz_defineMethod(c$,"clone", +function(){ +try{ +var vector=Clazz_superCall(this,java.util.Vector,"clone",[]); +vector.elementData=this.elementData.clone(); +return vector; +}catch(e){ +if(Clazz_instanceOf(e,CloneNotSupportedException)){ +return null; +}else{ +throw e; +} +} +}); +Clazz_overrideMethod(c$,"contains", +function(object){ +return this.indexOf(object,0)!=-1; +},"~O"); +Clazz_defineMethod(c$,"copyInto", +function(elements){ +System.arraycopy(this.elementData,0,elements,0,this.elementCount); +},"~A"); +Clazz_defineMethod(c$,"elementAt", +function(location){ +if(locationnext?minimumCapacity:next); +}},"~N"); +Clazz_overrideMethod(c$,"equals", +function(object){ +if(this===object){ +return true; +}if(Clazz_instanceOf(object,java.util.List)){ +var list=object; +if(list.size()!=this.size()){ +return false; +}var index=0; +var it=list.iterator(); +while(it.hasNext()){ +var e1=this.elementData[index++]; +var e2=it.next(); +if(!(e1==null?e2==null:e1.equals(e2))){ +return false; +}} +return true; +}return false; +},"~O"); +Clazz_defineMethod(c$,"firstElement", +function(){ +if(this.elementCount>0){ +return this.elementData[0]; +}throw new java.util.NoSuchElementException(); +}); +Clazz_overrideMethod(c$,"get", +function(location){ +return this.elementAt(location); +},"~N"); +Clazz_defineMethod(c$,"grow", +($fz=function(newCapacity){ +var newData=this.newElementArray(newCapacity); +System.arraycopy(this.elementData,0,newData,0,this.elementCount); +this.elementData=newData; +},$fz.isPrivate=true,$fz),"~N"); +Clazz_defineMethod(c$,"growByOne", +($fz=function(){ +var adding=0; +if(this.capacityIncrement<=0){ +if((adding=this.elementData.length)==0){ +adding=1; +}}else{ +adding=this.capacityIncrement; +}var newData=this.newElementArray(this.elementData.length+adding); +System.arraycopy(this.elementData,0,newData,0,this.elementCount); +this.elementData=newData; +},$fz.isPrivate=true,$fz)); +Clazz_defineMethod(c$,"growBy", +($fz=function(required){ +var adding=0; +if(this.capacityIncrement<=0){ +if((adding=this.elementData.length)==0){ +adding=required; +}while(adding0){ +System.arraycopy(this.elementData,location,this.elementData,location+1,count); +}this.elementData[location]=object; +this.elementCount++; +this.modCount++; +}else{ +throw new ArrayIndexOutOfBoundsException(location); +}},"~O,~N"); +Clazz_overrideMethod(c$,"isEmpty", +function(){ +return this.elementCount==0; +}); +Clazz_defineMethod(c$,"lastElement", +function(){ +try{ +return this.elementData[this.elementCount-1]; +}catch(e){ +if(Clazz_instanceOf(e,IndexOutOfBoundsException)){ +throw new java.util.NoSuchElementException(); +}else{ +throw e; +} +} +}); +Clazz_defineMethod(c$,"lastIndexOf", +function(object){ +return this.lastIndexOf(object,this.elementCount-1); +},"~O"); +Clazz_defineMethod(c$,"lastIndexOf", +function(object,location){ +if(location=0;i--){ +if(object.equals(this.elementData[i])){ +return i; +}} +}else{ +for(var i=location;i>=0;i--){ +if(this.elementData[i]==null){ +return i; +}} +}return-1; +}throw new ArrayIndexOutOfBoundsException(location); +},"~O,~N"); +Clazz_defineMethod(c$,"remove", +function(location){ +if(location0){ +System.arraycopy(this.elementData,location+1,this.elementData,location,size); +}this.elementData[this.elementCount]=null; +this.modCount++; +return result; +}throw new ArrayIndexOutOfBoundsException(location); +},"~N"); +Clazz_defineMethod(c$,"remove", +function(object){ +return this.removeElement(object); +},"~O"); +Clazz_defineMethod(c$,"removeAllElements", +function(){ +java.util.Arrays.fill(this.elementData,0,this.elementCount,null); +this.modCount++; +this.elementCount=0; +}); +Clazz_defineMethod(c$,"removeElement", +function(object){ +var index; +if((index=this.indexOf(object,0))==-1){ +return false; +}this.removeElementAt(index); +return true; +},"~O"); +Clazz_defineMethod(c$,"removeElementAt", +function(location){ +if(0<=location&&location0){ +System.arraycopy(this.elementData,location+1,this.elementData,location,size); +}this.elementData[this.elementCount]=null; +this.modCount++; +}else{ +throw new ArrayIndexOutOfBoundsException(location); +}},"~N"); +Clazz_overrideMethod(c$,"removeRange", +function(start,end){ +if(start>=0&&start<=end&&end<=this.size()){ +if(start==end){ +return; +}if(end!=this.elementCount){ +System.arraycopy(this.elementData,end,this.elementData,start,this.elementCount-end); +var newCount=this.elementCount-(end-start); +java.util.Arrays.fill(this.elementData,newCount,this.elementCount,null); +this.elementCount=newCount; +}else{ +java.util.Arrays.fill(this.elementData,start,this.elementCount,null); +this.elementCount=start; +}this.modCount++; +}else{ +throw new IndexOutOfBoundsException(); +}},"~N,~N"); +Clazz_overrideMethod(c$,"set", +function(location,object){ +if(locationlength){ +java.util.Arrays.fill(this.elementData,length,this.elementCount,null); +}this.elementCount=length; +this.modCount++; +},"~N"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.elementCount; +}); +Clazz_overrideMethod(c$,"subList", +function(start,end){ +return new java.util.Collections.SynchronizedRandomAccessList(Clazz_superCall(this,java.util.Vector,"subList",[start,end]),this); +},"~N,~N"); +Clazz_defineMethod(c$,"toArray", +function(){ +var result=new Array(this.elementCount); +System.arraycopy(this.elementData,0,result,0,this.elementCount); +return result; +}); +Clazz_defineMethod(c$,"toArray", +function(contents){ +if(this.elementCount>contents.length){ +var ct=contents.getClass().getComponentType(); +contents=java.lang.reflect.Array.newInstance(ct,this.elementCount); +}System.arraycopy(this.elementData,0,contents,0,this.elementCount); +if(this.elementCount 255) { +rangeError = true; +badComponentString = badComponentString + " Alpha"; +}if (r < 0 || r > 255) { +rangeError = true; +badComponentString = badComponentString + " Red"; +}if (g < 0 || g > 255) { +rangeError = true; +badComponentString = badComponentString + " Green"; +}if (b < 0 || b > 255) { +rangeError = true; +badComponentString = badComponentString + " Blue"; +}if (rangeError == true) { +throw new IllegalArgumentException ("Color parameter outside of expected range:" + badComponentString); +}}, "~N,~N,~N,~N"); +Clazz_makeConstructor (c$, +function () { +{ +var a = arguments; +switch(a.length) { +case 0: +break; +case 1: +this.value = (a[0].value ? a[0].value : 0xff000000 | a[0]); +break; +case 2: +this.value = (a[1] ? a[0] : 0xff000000 | a[0]); +break; +case 3: +this.setColor4(a[0], a[1], a[2], 255); +break; +case 4: +this.setColor4(a[0], a[1], a[2], a[3]); +break; +} +return this; +}}); +Clazz_defineMethod (c$, "setColor4", + function (r, g, b, a) { +this.value = ((a & 0xFF) << 24) | ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | ((b & 0xFF) << 0); +java.awt.Color.testColorValueRange (r, g, b, a); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setFloat", + function (r, g, b, f) { +this.setColor4 (Clazz_doubleToInt (r * 255 + 0.5), Clazz_doubleToInt (g * 255 + 0.5), Clazz_doubleToInt (b * 255 + 0.5), Clazz_doubleToInt (f * 255 + 0.5)); +this.frgbvalue = Clazz_newFloatArray (3, 0); +this.frgbvalue[0] = r; +this.frgbvalue[1] = g; +this.frgbvalue[2] = b; +this.falpha = f; +}, "~N,~N,~N,~N"); +c$.getColorF4 = Clazz_defineMethod (c$, "getColorF4", +function (r, g, b, a) { +var c = new java.awt.Color (); +c.setFloat (r, g, b, a); +return c; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getRed", +function () { +return (this.getRGB () >> 16) & 0xFF; +}); +Clazz_defineMethod (c$, "getGreen", +function () { +return (this.getRGB () >> 8) & 0xFF; +}); +Clazz_defineMethod (c$, "getBlue", +function () { +return (this.getRGB () >> 0) & 0xFF; +}); +Clazz_defineMethod (c$, "getAlpha", +function () { +return (this.getRGB () >> 24) & 0xff; +}); +Clazz_defineMethod (c$, "getRGB", +function () { +return this.value; +}); +Clazz_defineMethod (c$, "brighter", +function () { +var r = this.getRed (); +var g = this.getGreen (); +var b = this.getBlue (); +var i = Clazz_doubleToInt (3.333333333333333); +if (r == 0 && g == 0 && b == 0) { +return new java.awt.Color (i, i, i); +}if (r > 0 && r < i) r = i; +if (g > 0 && g < i) g = i; +if (b > 0 && b < i) b = i; +return new java.awt.Color (Math.min (Clazz_doubleToInt (r / 0.7), 255), Math.min (Clazz_doubleToInt (g / 0.7), 255), Math.min (Clazz_doubleToInt (b / 0.7), 255)); +}); +Clazz_defineMethod (c$, "darker", +function () { +return new java.awt.Color (Math.max (Clazz_doubleToInt (this.getRed () * 0.7), 0), Math.max (Clazz_doubleToInt (this.getGreen () * 0.7), 0), Math.max (Clazz_doubleToInt (this.getBlue () * 0.7), 0)); +}); +Clazz_overrideMethod (c$, "hashCode", +function () { +return this.value; +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +return Clazz_instanceOf (obj, java.awt.Color) && (obj).getRGB () == this.getRGB (); +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[r=" + this.getRed () + ",g=" + this.getGreen () + ",b=" + this.getBlue () + "]"; +}); +c$.decode = Clazz_defineMethod (c$, "decode", +function (nm) { +var intval = Integer.decode (nm); +var i = intval.intValue (); +return new java.awt.Color ((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); +}, "~S"); +c$.getColor = Clazz_defineMethod (c$, "getColor", +function (nm) { +return java.awt.Color.getColor (nm, null); +}, "~S"); +c$.getColor = Clazz_defineMethod (c$, "getColor", +function (nm, v) { +var intval = Integer.getInteger (nm); +if (intval == null) { +return v; +}var i = intval.intValue (); +return new java.awt.Color ((i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF); +}, "~S,java.awt.Color"); +c$.getColor = Clazz_defineMethod (c$, "getColor", +function (nm, v) { +var intval = Integer.getInteger (nm); +var i = (intval != null) ? intval.intValue () : v; +return new java.awt.Color ((i >> 16) & 0xFF, (i >> 8) & 0xFF, (i >> 0) & 0xFF); +}, "~S,~N"); +c$.HSBtoRGB = Clazz_defineMethod (c$, "HSBtoRGB", +function (hue, saturation, brightness) { +var r = 0; +var g = 0; +var b = 0; +if (saturation == 0) { +r = g = b = Clazz_floatToInt (brightness * 255.0 + 0.5); +} else { +var h = (hue - Math.floor (hue)) * 6.0; +var f = h - java.lang.Math.floor (h); +var p = brightness * (1.0 - saturation); +var q = brightness * (1.0 - saturation * f); +var t = brightness * (1.0 - (saturation * (1.0 - f))); +switch (Clazz_floatToInt (h)) { +case 0: +r = Clazz_floatToInt (brightness * 255.0 + 0.5); +g = Clazz_floatToInt (t * 255.0 + 0.5); +b = Clazz_floatToInt (p * 255.0 + 0.5); +break; +case 1: +r = Clazz_floatToInt (q * 255.0 + 0.5); +g = Clazz_floatToInt (brightness * 255.0 + 0.5); +b = Clazz_floatToInt (p * 255.0 + 0.5); +break; +case 2: +r = Clazz_floatToInt (p * 255.0 + 0.5); +g = Clazz_floatToInt (brightness * 255.0 + 0.5); +b = Clazz_floatToInt (t * 255.0 + 0.5); +break; +case 3: +r = Clazz_floatToInt (p * 255.0 + 0.5); +g = Clazz_floatToInt (q * 255.0 + 0.5); +b = Clazz_floatToInt (brightness * 255.0 + 0.5); +break; +case 4: +r = Clazz_floatToInt (t * 255.0 + 0.5); +g = Clazz_floatToInt (p * 255.0 + 0.5); +b = Clazz_floatToInt (brightness * 255.0 + 0.5); +break; +case 5: +r = Clazz_floatToInt (brightness * 255.0 + 0.5); +g = Clazz_floatToInt (p * 255.0 + 0.5); +b = Clazz_floatToInt (q * 255.0 + 0.5); +break; +} +}return 0xff000000 | (r << 16) | (g << 8) | (b << 0); +}, "~N,~N,~N"); +c$.RGBtoHSB = Clazz_defineMethod (c$, "RGBtoHSB", +function (r, g, b, hsbvals) { +var hue; +var saturation; +var brightness; +if (hsbvals == null) { +hsbvals = Clazz_newFloatArray (3, 0); +}var cmax = (r > g) ? r : g; +if (b > cmax) cmax = b; +var cmin = (r < g) ? r : g; +if (b < cmin) cmin = b; +brightness = (cmax) / 255.0; +if (cmax != 0) saturation = ((cmax - cmin)) / (cmax); + else saturation = 0; +if (saturation == 0) hue = 0; + else { +var redc = ((cmax - r)) / ((cmax - cmin)); +var greenc = ((cmax - g)) / ((cmax - cmin)); +var bluec = ((cmax - b)) / ((cmax - cmin)); +if (r == cmax) hue = bluec - greenc; + else if (g == cmax) hue = 2.0 + redc - bluec; + else hue = 4.0 + greenc - redc; +hue = hue / 6.0; +if (hue < 0) hue = hue + 1.0; +}hsbvals[0] = hue; +hsbvals[1] = saturation; +hsbvals[2] = brightness; +return hsbvals; +}, "~N,~N,~N,~A"); +c$.getHSBColor = Clazz_defineMethod (c$, "getHSBColor", +function (h, s, b) { +return new java.awt.Color (java.awt.Color.HSBtoRGB (h, s, b)); +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "getRGBComponents", +function (compArray) { +var f; +if (compArray == null) { +f = Clazz_newFloatArray (4, 0); +} else { +f = compArray; +}if (this.frgbvalue == null) { +f[0] = (this.getRed ()) / 255; +f[1] = (this.getGreen ()) / 255; +f[2] = (this.getBlue ()) / 255; +f[3] = (this.getAlpha ()) / 255; +} else { +f[0] = this.frgbvalue[0]; +f[1] = this.frgbvalue[1]; +f[2] = this.frgbvalue[2]; +f[3] = this.falpha; +}return f; +}, "~A"); +Clazz_defineMethod (c$, "getRGBColorComponents", +function (compArray) { +var f; +if (compArray == null) { +f = Clazz_newFloatArray (3, 0); +} else { +f = compArray; +}if (this.frgbvalue == null) { +f[0] = (this.getRed ()) / 255; +f[1] = (this.getGreen ()) / 255; +f[2] = (this.getBlue ()) / 255; +} else { +f[0] = this.frgbvalue[0]; +f[1] = this.frgbvalue[1]; +f[2] = this.frgbvalue[2]; +}return f; +}, "~A"); +Clazz_overrideMethod (c$, "createContext", +function (cm, r, r2d, xform, hints) { +if (this.context == null || this.context.getRGB () != this.getRGB ()) { +this.context = new java.awt.ColorPaintContext (this.getRGB (), cm); +}return this.context; +}, "java.awt.image.ColorModel,java.awt.Rectangle,java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform,java.awt.RenderingHints"); +Clazz_overrideMethod (c$, "getTransparency", +function () { +var alpha = this.getAlpha (); +if (alpha == 0xff) { +return 1; +} else if (alpha == 0) { +return 2; +} else { +return 3; +}}); +c$.white = c$.prototype.white = new java.awt.Color (255, 255, 255); +c$.WHITE = c$.prototype.WHITE = java.awt.Color.white; +c$.lightGray = c$.prototype.lightGray = new java.awt.Color (192, 192, 192); +c$.LIGHT_GRAY = c$.prototype.LIGHT_GRAY = java.awt.Color.lightGray; +c$.gray = c$.prototype.gray = new java.awt.Color (128, 128, 128); +c$.GRAY = c$.prototype.GRAY = java.awt.Color.gray; +c$.darkGray = c$.prototype.darkGray = new java.awt.Color (64, 64, 64); +c$.DARK_GRAY = c$.prototype.DARK_GRAY = java.awt.Color.darkGray; +c$.black = c$.prototype.black = new java.awt.Color (0, 0, 0); +c$.BLACK = c$.prototype.BLACK = java.awt.Color.black; +c$.red = c$.prototype.red = new java.awt.Color (255, 0, 0); +c$.RED = c$.prototype.RED = java.awt.Color.red; +c$.pink = c$.prototype.pink = new java.awt.Color (255, 175, 175); +c$.PINK = c$.prototype.PINK = java.awt.Color.pink; +c$.orange = c$.prototype.orange = new java.awt.Color (255, 200, 0); +c$.ORANGE = c$.prototype.ORANGE = java.awt.Color.orange; +c$.yellow = c$.prototype.yellow = new java.awt.Color (255, 255, 0); +c$.YELLOW = c$.prototype.YELLOW = java.awt.Color.yellow; +c$.green = c$.prototype.green = new java.awt.Color (0, 255, 0); +c$.GREEN = c$.prototype.GREEN = java.awt.Color.green; +c$.magenta = c$.prototype.magenta = new java.awt.Color (255, 0, 255); +c$.MAGENTA = c$.prototype.MAGENTA = java.awt.Color.magenta; +c$.cyan = c$.prototype.cyan = new java.awt.Color (0, 255, 255); +c$.CYAN = c$.prototype.CYAN = java.awt.Color.cyan; +c$.blue = c$.prototype.blue = new java.awt.Color (0, 0, 255); +c$.BLUE = c$.prototype.BLUE = java.awt.Color.blue; +Clazz_defineStatics (c$, +"FACTOR", 0.7); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.Transparency"], "java.awt.Paint", null, function () { +Clazz_declareInterface (java.awt, "Paint", java.awt.Transparency); +}); +Clazz_declarePackage ("java.awt"); +c$ = Clazz_declareInterface (java.awt, "Transparency"); +Clazz_defineStatics (c$, +"OPAQUE", 1, +"BITMASK", 2, +"TRANSLUCENT", 3); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.PaintContext"], "java.awt.ColorPaintContext", ["java.awt.image.ColorModel"], function () { +c$ = Clazz_decorateAsClass (function () { +this.color = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "ColorPaintContext", null, java.awt.PaintContext); +Clazz_makeConstructor (c$, +function (color, cm) { +this.color = color; +}, "~N,java.awt.image.ColorModel"); +Clazz_overrideMethod (c$, "dispose", +function () { +}); +Clazz_defineMethod (c$, "getRGB", +function () { +return this.color; +}); +Clazz_overrideMethod (c$, "getColorModel", +function () { +return java.awt.image.ColorModel.getRGBdefault (); +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "PaintContext"); +Clazz_declarePackage ("java.awt.image"); +Clazz_load (["java.awt.Transparency", "java.awt.color.ColorSpace"], "java.awt.image.ColorModel", ["java.lang.IllegalArgumentException", "$.NullPointerException", "$.UnsupportedOperationException", "JU.AU"], function () { +c$ = Clazz_decorateAsClass (function () { +this.pixel_bits = 0; +this.nBits = null; +this.transparency = 3; +this.supportsAlpha = true; +this.$isAlphaPremultiplied = false; +this.numComponents = -1; +this.numColorComponents = -1; +this.colorSpace = null; +this.colorSpaceType = 5; +this.maxBits = 0; +this.is_sRGB = true; +this.transferType = 0; +Clazz_instantialize (this, arguments); +}, java.awt.image, "ColorModel", null, java.awt.Transparency); +Clazz_prepareFields (c$, function () { +this.colorSpace = java.awt.color.ColorSpace.getInstance (1000); +}); +c$.getRGBdefault = Clazz_defineMethod (c$, "getRGBdefault", +function () { +if (java.awt.image.ColorModel.RGBdefault == null) { +java.awt.image.ColorModel.RGBdefault = new java.awt.image.DirectColorModel (32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000); +}return java.awt.image.ColorModel.RGBdefault; +}); +Clazz_makeConstructor (c$, +function (bits) { +this.pixel_bits = bits; +if (bits < 1) { +throw new IllegalArgumentException ("Number of bits must be > 0"); +}this.numComponents = 4; +this.numColorComponents = 3; +this.maxBits = bits; +this.transferType = java.awt.image.ColorModel.getDefaultTransferType (bits); +}, "~N"); +Clazz_makeConstructor (c$, +function (pixel_bits, bits, cspace, hasAlpha, isAlphaPremultiplied, transparency, transferType) { +this.colorSpace = cspace; +this.colorSpaceType = cspace.getType (); +this.numColorComponents = cspace.getNumComponents (); +this.numComponents = this.numColorComponents + (hasAlpha ? 1 : 0); +this.supportsAlpha = hasAlpha; +if (bits.length < this.numComponents) { +throw new IllegalArgumentException ("Number of color/alpha components should be " + this.numComponents + " but length of bits array is " + bits.length); +}if (transparency < 1 || transparency > 3) { +throw new IllegalArgumentException ("Unknown transparency: " + transparency); +}if (this.supportsAlpha == false) { +this.$isAlphaPremultiplied = false; +this.transparency = 1; +} else { +this.$isAlphaPremultiplied = isAlphaPremultiplied; +this.transparency = transparency; +}this.nBits = bits.clone (); +this.pixel_bits = pixel_bits; +if (pixel_bits <= 0) { +throw new IllegalArgumentException ("Number of pixel bits must be > 0"); +}this.maxBits = 0; +for (var i = 0; i < bits.length; i++) { +if (bits[i] < 0) { +throw new IllegalArgumentException ("Number of bits must be >= 0"); +}if (this.maxBits < bits[i]) { +this.maxBits = bits[i]; +}} +if (this.maxBits == 0) { +throw new IllegalArgumentException ("There must be at least one component with > 0 pixel bits."); +}if (cspace !== java.awt.color.ColorSpace.getInstance (1000)) { +this.is_sRGB = false; +}this.transferType = transferType; +}, "~N,~A,java.awt.color.ColorSpace,~B,~B,~N,~N"); +Clazz_defineMethod (c$, "hasAlpha", +function () { +return this.supportsAlpha; +}); +Clazz_defineMethod (c$, "isAlphaPremultiplied", +function () { +return this.$isAlphaPremultiplied; +}); +Clazz_defineMethod (c$, "getTransferType", +function () { +return this.transferType; +}); +Clazz_defineMethod (c$, "getPixelSize", +function () { +return this.pixel_bits; +}); +Clazz_defineMethod (c$, "getComponentSize", +function (componentIdx) { +if (this.nBits == null) { +throw new NullPointerException ("Number of bits array is null."); +}return this.nBits[componentIdx]; +}, "~N"); +Clazz_defineMethod (c$, "getComponentSize", +function () { +if (this.nBits != null) { +return this.nBits.clone (); +}return null; +}); +Clazz_overrideMethod (c$, "getTransparency", +function () { +return this.transparency; +}); +Clazz_defineMethod (c$, "getNumComponents", +function () { +return this.numComponents; +}); +Clazz_defineMethod (c$, "getNumColorComponents", +function () { +return this.numColorComponents; +}); +Clazz_defineMethod (c$, "getRGB", +function (pixel) { +return (this.getAlpha (pixel) << 24) | (this.getRed (pixel) << 16) | (this.getGreen (pixel) << 8) | (this.getBlue (pixel) << 0); +}, "~N"); +Clazz_defineMethod (c$, "getRed", +function (inData) { +var pixel = 0; +var length = 0; +var idata = inData; +pixel = idata[0]; +length = idata.length; +if (length == 1) { +return this.getRed (pixel); +} else { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}}, "~O"); +Clazz_defineMethod (c$, "getGreen", +function (inData) { +var pixel = 0; +var length = 0; +var idata = inData; +pixel = idata[0]; +length = idata.length; +if (length == 1) { +return this.getGreen (pixel); +} else { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}}, "~O"); +Clazz_defineMethod (c$, "getBlue", +function (inData) { +var pixel = 0; +var length = 0; +var idata = inData; +pixel = idata[0]; +length = idata.length; +if (length == 1) { +return this.getBlue (pixel); +} else { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}}, "~O"); +Clazz_defineMethod (c$, "getAlpha", +function (inData) { +var pixel = 0; +var length = 0; +var idata = inData; +pixel = idata[0]; +length = idata.length; +if (length == 1) { +return this.getAlpha (pixel); +} else { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}}, "~O"); +Clazz_defineMethod (c$, "getRGB", +function (inData) { +return (this.getAlpha (inData) << 24) | (this.getRed (inData) << 16) | (this.getGreen (inData) << 8) | (this.getBlue (inData) << 0); +}, "~O"); +Clazz_defineMethod (c$, "getDataElements", +function (rgb, pixel) { +throw new UnsupportedOperationException ("This method is not supported by this color model."); +}, "~N,~O"); +Clazz_defineMethod (c$, "getComponents", +function (pixel, components, offset) { +throw new UnsupportedOperationException ("This method is not supported by this color model."); +}, "~N,~A,~N"); +Clazz_defineMethod (c$, "getComponents", +function (pixel, components, offset) { +throw new UnsupportedOperationException ("This method is not supported by this color model."); +}, "~O,~A,~N"); +Clazz_defineMethod (c$, "getUnnormalizedComponents", +function (normComponents, normOffset, components, offset) { +if (this.colorSpace == null) { +throw new UnsupportedOperationException ("This method is not supported by this color model."); +}if (this.nBits == null) { +throw new UnsupportedOperationException ("This method is not supported. Unable to determine #bits per component."); +}if ((normComponents.length - normOffset) < this.numComponents) { +throw new IllegalArgumentException ("Incorrect number of components. Expecting " + this.numComponents); +}if (components == null) { +components = Clazz_newIntArray (offset + this.numComponents, 0); +}if (this.supportsAlpha && this.$isAlphaPremultiplied) { +var normAlpha = normComponents[normOffset + this.numColorComponents]; +for (var i = 0; i < this.numColorComponents; i++) { +components[offset + i] = Clazz_floatToInt (normComponents[normOffset + i] * ((1 << this.nBits[i]) - 1) * normAlpha + 0.5); +} +components[offset + this.numColorComponents] = Clazz_floatToInt (normAlpha * ((1 << this.nBits[this.numColorComponents]) - 1) + 0.5); +} else { +for (var i = 0; i < this.numComponents; i++) { +components[offset + i] = Clazz_floatToInt (normComponents[normOffset + i] * ((1 << this.nBits[i]) - 1) + 0.5); +} +}return components; +}, "~A,~N,~A,~N"); +Clazz_defineMethod (c$, "getNormalizedComponents", +function (components, offset, normComponents, normOffset) { +if (this.colorSpace == null) { +throw new UnsupportedOperationException ("This method is not supported by this color model."); +}if (this.nBits == null) { +throw new UnsupportedOperationException ("This method is not supported. Unable to determine #bits per component."); +}if ((components.length - offset) < this.numComponents) { +throw new IllegalArgumentException ("Incorrect number of components. Expecting " + this.numComponents); +}if (normComponents == null) { +normComponents = Clazz_newFloatArray (this.numComponents + normOffset, 0); +}if (this.supportsAlpha && this.$isAlphaPremultiplied) { +var normAlpha = components[offset + this.numColorComponents]; +normAlpha /= ((1 << this.nBits[this.numColorComponents]) - 1); +if (normAlpha != 0.0) { +for (var i = 0; i < this.numColorComponents; i++) { +normComponents[normOffset + i] = (components[offset + i]) / (normAlpha * (((1 << this.nBits[i]) - 1))); +} +} else { +for (var i = 0; i < this.numColorComponents; i++) { +normComponents[normOffset + i] = 0.0; +} +}normComponents[normOffset + this.numColorComponents] = normAlpha; +} else { +for (var i = 0; i < this.numComponents; i++) { +normComponents[normOffset + i] = (components[offset + i]) / (((1 << this.nBits[i]) - 1)); +} +}return normComponents; +}, "~A,~N,~A,~N"); +Clazz_defineMethod (c$, "getDataElement", +function (components, offset) { +return this.getDataElementInt (components, offset); +}, "~A,~N"); +Clazz_defineMethod (c$, "getDataElementInt", +function (components, offset) { +throw new UnsupportedOperationException ("This method is not supported by this color model."); +}, "~A,~N"); +Clazz_defineMethod (c$, "getDataElement", +function (normComponents, normOffset) { +if (JU.AU.isAI (normComponents)) { +var ints = normComponents; +return this.getDataElementInt (ints, normOffset); +}var components = this.getUnnormalizedComponents (normComponents, normOffset, null, 0); +return this.getDataElement (components, 0); +}, "~A,~N"); +Clazz_defineMethod (c$, "getDataElements", +function (normComponents, normOffset, obj) { +var components = this.getUnnormalizedComponents (normComponents, normOffset, null, 0); +return this.getDataElements (components, 0, obj); +}, "~A,~N,~O"); +Clazz_defineMethod (c$, "getNormalizedComponents", +function (pixel, normComponents, normOffset) { +var components = this.getComponents (pixel, null, 0); +return this.getNormalizedComponents (components, 0, normComponents, normOffset); +}, "~O,~A,~N"); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (!(Clazz_instanceOf (obj, java.awt.image.ColorModel))) { +return false; +}var cm = obj; +if (this === cm) { +return true; +}if (this.supportsAlpha != cm.hasAlpha () || this.$isAlphaPremultiplied != cm.isAlphaPremultiplied () || this.pixel_bits != cm.getPixelSize () || this.transparency != cm.getTransparency () || this.numComponents != cm.getNumComponents ()) { +return false; +}var nb = cm.getComponentSize (); +if ((this.nBits != null) && (nb != null)) { +for (var i = 0; i < this.numComponents; i++) { +if (this.nBits[i] != nb[i]) { +return false; +}} +} else { +return ((this.nBits == null) && (nb == null)); +}return true; +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +var result = 0; +result = (this.supportsAlpha ? 2 : 3) + (this.$isAlphaPremultiplied ? 4 : 5) + this.pixel_bits * 6 + this.transparency * 7 + this.numComponents * 8; +if (this.nBits != null) { +for (var i = 0; i < this.numComponents; i++) { +result = result + this.nBits[i] * (i + 9); +} +}return result; +}); +Clazz_defineMethod (c$, "getColorSpace", +function () { +return this.colorSpace; +}); +Clazz_defineMethod (c$, "isCompatibleRaster", +function (raster) { +throw new UnsupportedOperationException ("This method has not been implemented for this ColorModel."); +}, "java.awt.image.Raster"); +Clazz_defineMethod (c$, "createCompatibleWritableRaster", +function (w, h) { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}, "~N,~N"); +Clazz_defineMethod (c$, "createCompatibleSampleModel", +function (w, h) { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}, "~N,~N"); +Clazz_defineMethod (c$, "isCompatibleSampleModel", +function (sm) { +throw new UnsupportedOperationException ("This method is not supported by this color model"); +}, "java.awt.image.SampleModel"); +Clazz_overrideMethod (c$, "finalize", +function () { +}); +Clazz_defineMethod (c$, "getAlphaRaster", +function (raster) { +return null; +}, "java.awt.image.WritableRaster"); +Clazz_overrideMethod (c$, "toString", +function () { +return String.instantialize ("ColorModel: #pixelBits = " + this.pixel_bits + " numComponents = " + this.numComponents + " color space = " + this.colorSpace + " transparency = " + this.transparency + " has alpha = " + this.supportsAlpha + " isAlphaPre = " + this.$isAlphaPremultiplied); +}); +c$.getDefaultTransferType = Clazz_defineMethod (c$, "getDefaultTransferType", +function (pixel_bits) { +if (pixel_bits <= 8) { +return 0; +}return 3; +}, "~N"); +c$.isLinearRGBspace = Clazz_defineMethod (c$, "isLinearRGBspace", +function (cs) { +return false; +}, "java.awt.color.ColorSpace"); +c$.isLinearGRAYspace = Clazz_defineMethod (c$, "isLinearGRAYspace", +function (cs) { +return false; +}, "java.awt.color.ColorSpace"); +Clazz_defineStatics (c$, +"RGBdefault", null, +"l8Tos8", null, +"s8Tol8", null, +"l16Tos8", null, +"s8Tol16", null, +"g8Tos8Map", null, +"lg16Toog8Map", null, +"g16Tos8Map", null, +"lg16Toog16Map", null); +}); +Clazz_declarePackage ("java.awt.color"); +Clazz_load (null, "java.awt.color.ColorSpace", ["java.lang.IllegalArgumentException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.type = 0; +this.numComponents = 0; +this.compName = null; +Clazz_instantialize (this, arguments); +}, java.awt.color, "ColorSpace"); +Clazz_makeConstructor (c$, +function (type, numcomponents) { +this.type = type; +this.numComponents = numcomponents; +}, "~N,~N"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function (colorspace) { +var theColorSpace; +switch (colorspace) { +default: +case 1000: +if (java.awt.color.ColorSpace.sRGBspace == null) { +java.awt.color.ColorSpace.sRGBspace = new java.awt.color.ColorSpace (5, 3); +}theColorSpace = java.awt.color.ColorSpace.sRGBspace; +break; +} +return theColorSpace; +}, "~N"); +Clazz_defineMethod (c$, "isCS_sRGB", +function () { +return (this === java.awt.color.ColorSpace.sRGBspace); +}); +Clazz_defineMethod (c$, "toRGB", +function (colorvalue) { +return colorvalue; +}, "~A"); +Clazz_defineMethod (c$, "fromRGB", +function (rgbvalue) { +return rgbvalue; +}, "~A"); +Clazz_defineMethod (c$, "getType", +function () { +return this.type; +}); +Clazz_defineMethod (c$, "getNumComponents", +function () { +return this.numComponents; +}); +Clazz_defineMethod (c$, "getName", +function (idx) { +if ((idx < 0) || (idx > this.numComponents - 1)) { +throw new IllegalArgumentException ("Component index out of range: " + idx); +}if (this.compName == null) { +switch (this.type) { +case 0: +this.compName = Clazz_newArray (-1, ["X", "Y", "Z"]); +break; +case 1: +this.compName = Clazz_newArray (-1, ["L", "a", "b"]); +break; +case 2: +this.compName = Clazz_newArray (-1, ["L", "u", "v"]); +break; +case 3: +this.compName = Clazz_newArray (-1, ["Y", "Cb", "Cr"]); +break; +case 4: +this.compName = Clazz_newArray (-1, ["Y", "x", "y"]); +break; +case 5: +this.compName = Clazz_newArray (-1, ["Red", "Green", "Blue"]); +break; +case 6: +this.compName = Clazz_newArray (-1, ["Gray"]); +break; +case 7: +this.compName = Clazz_newArray (-1, ["Hue", "Saturation", "Value"]); +break; +case 8: +this.compName = Clazz_newArray (-1, ["Hue", "Lightness", "Saturation"]); +break; +case 9: +this.compName = Clazz_newArray (-1, ["Cyan", "Magenta", "Yellow", "Black"]); +break; +case 11: +this.compName = Clazz_newArray (-1, ["Cyan", "Magenta", "Yellow"]); +break; +default: +var tmp = new Array (this.numComponents); +for (var i = 0; i < tmp.length; i++) { +tmp[i] = "Unnamed color component(" + i + ")"; +} +this.compName = tmp; +} +}return this.compName[idx]; +}, "~N"); +Clazz_defineMethod (c$, "getMinValue", +function (component) { +if ((component < 0) || (component > this.numComponents - 1)) { +throw new IllegalArgumentException ("Component index out of range: " + component); +}return 0.0; +}, "~N"); +Clazz_defineMethod (c$, "getMaxValue", +function (component) { +if ((component < 0) || (component > this.numComponents - 1)) { +throw new IllegalArgumentException ("Component index out of range: " + component); +}return 1.0; +}, "~N"); +Clazz_defineStatics (c$, +"sRGBspace", null, +"TYPE_XYZ", 0, +"TYPE_Lab", 1, +"TYPE_Luv", 2, +"TYPE_YCbCr", 3, +"TYPE_Yxy", 4, +"TYPE_RGB", 5, +"TYPE_GRAY", 6, +"TYPE_HSV", 7, +"TYPE_HLS", 8, +"TYPE_CMYK", 9, +"TYPE_CMY", 11, +"TYPE_2CLR", 12, +"TYPE_3CLR", 13, +"TYPE_4CLR", 14, +"TYPE_5CLR", 15, +"TYPE_6CLR", 16, +"TYPE_7CLR", 17, +"TYPE_8CLR", 18, +"TYPE_9CLR", 19, +"TYPE_ACLR", 20, +"TYPE_BCLR", 21, +"TYPE_CCLR", 22, +"TYPE_DCLR", 23, +"TYPE_ECLR", 24, +"TYPE_FCLR", 25, +"CS_sRGB", 1000, +"CS_LINEAR_RGB", 1004, +"CS_CIEXYZ", 1001, +"CS_PYCC", 1002, +"CS_GRAY", 1003); +}); +Clazz_declarePackage ("java.util"); +Clazz_load (["java.util.Arrays", "$.Collections", "$.HashMap"], "java.util.ResourceBundle", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "java.lang.ClassNotFoundException", "$.IllegalArgumentException", "$.InternalError", "$.InterruptedException", "$.NullPointerException", "$.StringBuilder", "$.Thread", "java.util.ArrayList", "$.HashSet", "java.util.Locale", "$.MissingResourceException", "swingjs.JSToolkit", "swingjs.api.Interface"], function () { +c$ = Clazz_decorateAsClass (function () { +this.parent = null; +this.locale = null; +this.expired = false; +this.$keySet = null; +Clazz_instantialize (this, arguments); +}, java.util, "ResourceBundle"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "getString", +function (key) { +return this.getObject (key); +}, "~S"); +Clazz_defineMethod (c$, "getStringArray", +function (key) { +return this.getObject (key); +}, "~S"); +Clazz_defineMethod (c$, "getObject", +function (key) { +var obj = this.handleGetObject (key); +if (obj == null) { +if (this.parent != null) { +obj = this.parent.getObject (key); +}if (obj == null) throw new java.util.MissingResourceException ("Can't find resource for bundle " + this.getClass ().getName () + ", key " + key, this.getClass ().getName (), key); +}return obj; +}, "~S"); +Clazz_defineMethod (c$, "getLocale", +function () { +return this.locale; +}); +Clazz_defineMethod (c$, "setParent", +function (parent) { +this.parent = parent; +}, "java.util.ResourceBundle"); +c$.getBundle = Clazz_defineMethod (c$, "getBundle", +function (baseName, targetLocale, loader, control) { +var n = 4; +{ +n = arguments.length; +}switch (n) { +case 2: +if ((Clazz_instanceOf (targetLocale, java.util.ResourceBundle.Control))) { +control = targetLocale; +targetLocale = null; +}break; +case 3: +if ((Clazz_instanceOf (loader, java.util.ResourceBundle.Control))) { +control = loader; +loader = null; +}break; +} +if (targetLocale == null) targetLocale = java.util.Locale.getDefault (); +if (control == null) control = java.util.ResourceBundle.Control.getControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); +return java.util.ResourceBundle.getBundleImpl (baseName, targetLocale, loader, control); +}, "~S,~O,~O,java.util.ResourceBundle.Control"); +c$.getBundleImpl = Clazz_defineMethod (c$, "getBundleImpl", + function (baseName, locale, loader, control) { +if (control == null) { +throw new NullPointerException ("ResourceBundle locale or control is null"); +}var cacheKey = new java.util.ResourceBundle.CacheKey (baseName, locale, loader); +var bundle = null; +var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); +if (bundleRef != null) { +bundle = bundleRef; +bundleRef = null; +}if (java.util.ResourceBundle.isValidBundle (bundle)) { +return bundle; +}var formats = control.getFormats (baseName); +var baseBundle = null; +for (var targetLocale = locale; targetLocale != null; targetLocale = control.getFallbackLocale (baseName, targetLocale)) { +var candidateLocales = control.getCandidateLocales (baseName, targetLocale); +bundle = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, 0, control, baseBundle); +if (java.util.ResourceBundle.isValidBundle (bundle)) { +var isBaseBundle = java.util.Locale.ROOT.equals (bundle.locale); +if (!isBaseBundle || bundle.locale.equals (locale) || (candidateLocales.size () == 1 && bundle.locale.equals (candidateLocales.get (0)))) { +break; +}if (isBaseBundle && baseBundle == null) { +baseBundle = bundle; +}}} +if (bundle == null) { +if (baseBundle == null) { +java.util.ResourceBundle.throwMissingResourceException (baseName, locale, cacheKey.getCause ()); +}bundle = baseBundle; +}return bundle; +}, "~S,java.util.Locale,~O,java.util.ResourceBundle.Control"); +c$.findBundle = Clazz_defineMethod (c$, "findBundle", + function (cacheKey, candidateLocales, formats, index, control, baseBundle) { +var targetLocale = candidateLocales.get (index); +var parent = null; +if (index != candidateLocales.size () - 1) { +parent = java.util.ResourceBundle.findBundle (cacheKey, candidateLocales, formats, index + 1, control, baseBundle); +} else if (baseBundle != null && java.util.Locale.ROOT.equals (targetLocale)) { +return baseBundle; +}var expiredBundle = false; +cacheKey.setLocale (targetLocale); +var bundle = java.util.ResourceBundle.findBundleInCache (cacheKey, control); +if (java.util.ResourceBundle.isValidBundle (bundle)) { +expiredBundle = bundle.expired; +if (!expiredBundle) { +if (bundle.parent === parent) { +return bundle; +}var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); +if (bundleRef != null && bundleRef === bundle) { +java.util.ResourceBundle.cacheList.remove (cacheKey); +}}}if (bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE) { +var constKey = cacheKey.clone (); +try { +try { +bundle = java.util.ResourceBundle.loadBundle (cacheKey, formats, control, expiredBundle); +if (bundle != null) { +if (bundle.parent == null) { +bundle.setParent (parent); +}bundle.locale = targetLocale; +bundle = java.util.ResourceBundle.putBundleInCache (cacheKey, bundle, control); +return bundle; +}java.util.ResourceBundle.putBundleInCache (cacheKey, java.util.ResourceBundle.NONEXISTENT_BUNDLE, control); +} finally { +} +} finally { +if (Clazz_instanceOf (constKey.getCause (), InterruptedException)) { +Thread.currentThread ().interrupt (); +}} +}return parent; +}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.List,~N,java.util.ResourceBundle.Control,java.util.ResourceBundle"); +c$.loadBundle = Clazz_defineMethod (c$, "loadBundle", + function (cacheKey, formats, control, reload) { +var targetLocale = cacheKey.getLocale (); +var bundle = null; +var size = formats.size (); +for (var i = 0; i < size; i++) { +var format = formats.get (i); +try { +bundle = control.newBundle (cacheKey.getName (), targetLocale, format, null, reload); +} catch (e$$) { +if (Clazz_exceptionOf (e$$, LinkageError)) { +var error = e$$; +{ +cacheKey.setCause (error); +} +} else if (Clazz_exceptionOf (e$$, Exception)) { +var cause = e$$; +{ +cacheKey.setCause (cause); +} +} else { +throw e$$; +} +} +if (bundle != null) { +cacheKey.setFormat (format); +bundle.locale = targetLocale; +bundle.expired = false; +break; +}} +return bundle; +}, "java.util.ResourceBundle.CacheKey,java.util.List,java.util.ResourceBundle.Control,~B"); +c$.isValidBundle = Clazz_defineMethod (c$, "isValidBundle", + function (bundle) { +return bundle != null && bundle !== java.util.ResourceBundle.NONEXISTENT_BUNDLE; +}, "java.util.ResourceBundle"); +c$.throwMissingResourceException = Clazz_defineMethod (c$, "throwMissingResourceException", + function (baseName, locale, cause) { +if (Clazz_instanceOf (cause, java.util.MissingResourceException)) { +cause = null; +}throw new java.util.MissingResourceException ("Can't find bundle for base name " + baseName + ", locale " + locale, baseName + "_" + locale, "", cause); +}, "~S,java.util.Locale,Throwable"); +c$.findBundleInCache = Clazz_defineMethod (c$, "findBundleInCache", + function (cacheKey, control) { +var bundleRef = java.util.ResourceBundle.cacheList.get (cacheKey); +if (bundleRef == null) { +return null; +}var bundle = bundleRef; +return bundle; +}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle.Control"); +c$.putBundleInCache = Clazz_defineMethod (c$, "putBundleInCache", + function (cacheKey, bundle, control) { +var key = cacheKey.clone (); +java.util.ResourceBundle.cacheList.put (key, bundle); +return bundle; +}, "java.util.ResourceBundle.CacheKey,java.util.ResourceBundle,java.util.ResourceBundle.Control"); +c$.clearCache = Clazz_defineMethod (c$, "clearCache", +function () { +java.util.ResourceBundle.cacheList.clear (); +}); +Clazz_defineMethod (c$, "containsKey", +function (key) { +if (key == null) { +throw new NullPointerException (); +}for (var rb = this; rb != null; rb = rb.parent) { +if (rb.handleKeySet ().contains (key)) { +return true; +}} +return false; +}, "~S"); +Clazz_defineMethod (c$, "keySet", +function () { +var keys = new java.util.HashSet (); +for (var rb = this; rb != null; rb = rb.parent) { +keys.addAll (rb.handleKeySet ()); +} +return keys; +}); +Clazz_defineMethod (c$, "handleKeySet", +function () { +if (this.$keySet == null) { +{ +if (this.$keySet == null) { +var keys = new java.util.HashSet (); +var enumKeys = this.getKeys (); +while (enumKeys.hasMoreElements ()) { +var key = enumKeys.nextElement (); +if (this.handleGetObject (key) != null) { +keys.add (key); +}} +this.$keySet = keys; +}}}return this.$keySet; +}); +c$.$ResourceBundle$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (java.util, "ResourceBundle$1", java.util.ResourceBundle); +Clazz_defineMethod (c$, "getKeys", +function () { +return null; +}); +Clazz_defineMethod (c$, "handleGetObject", +function (key) { +return null; +}, "~S"); +Clazz_overrideMethod (c$, "toString", +function () { +return "NONEXISTENT_BUNDLE"; +}); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.name = null; +this.locale = null; +this.format = null; +this.cause = null; +this.hashCodeCache = 0; +Clazz_instantialize (this, arguments); +}, java.util.ResourceBundle, "CacheKey", null, Cloneable); +Clazz_makeConstructor (c$, +function (a, b, c) { +this.name = a; +this.locale = b; +if (this.name != null) this.calculateHashCode (); +}, "~S,java.util.Locale,~O"); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getLocale", +function () { +return this.locale; +}); +Clazz_defineMethod (c$, "setLocale", +function (a) { +if (!this.locale.equals (a)) { +this.locale = a; +this.calculateHashCode (); +}return this; +}, "java.util.Locale"); +Clazz_overrideMethod (c$, "equals", +function (a) { +if (this === a) { +return true; +}try { +var b = a; +if (this.hashCodeCache != b.hashCodeCache) { +return false; +}if (!this.name.equals (b.name)) { +return false; +}if (!this.locale.equals (b.locale)) { +return false; +}return true; +} catch (e$$) { +if (Clazz_exceptionOf (e$$, NullPointerException)) { +var e = e$$; +{ +} +} else if (Clazz_exceptionOf (e$$, ClassCastException)) { +var e = e$$; +{ +} +} else { +throw e$$; +} +} +return false; +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +return this.hashCodeCache; +}); +Clazz_defineMethod (c$, "calculateHashCode", + function () { +this.hashCodeCache = this.name.hashCode () << 3; +this.hashCodeCache ^= this.locale.hashCode (); +}); +Clazz_defineMethod (c$, "clone", +function () { +try { +var a = Clazz_superCall (this, java.util.ResourceBundle.CacheKey, "clone", []); +a.cause = null; +return a; +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_defineMethod (c$, "setFormat", +function (a) { +this.format = a; +}, "~S"); +Clazz_defineMethod (c$, "setCause", + function (a) { +if (this.cause == null) { +this.cause = a; +} else { +if (Clazz_instanceOf (this.cause, ClassNotFoundException)) { +this.cause = a; +}}}, "Throwable"); +Clazz_defineMethod (c$, "getCause", + function () { +return this.cause; +}); +Clazz_overrideMethod (c$, "toString", +function () { +var a = this.locale.toString (); +if (a.length == 0) { +if (this.locale.getVariant ().length != 0) { +a = "__" + this.locale.getVariant (); +} else { +a = "\"\""; +}}return "CacheKey[" + this.name + ", lc=" + a + "(format=" + this.format + ")]"; +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.util.ResourceBundle, "Control"); +Clazz_makeConstructor (c$, +function () { +}); +c$.getControl = Clazz_defineMethod (c$, "getControl", +function (a) { +if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { +return java.util.ResourceBundle.SingleFormatControl.PROPERTIES_ONLY; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { +return java.util.ResourceBundle.SingleFormatControl.CLASS_ONLY; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { +return java.util.ResourceBundle.Control.INSTANCE; +}throw new IllegalArgumentException (); +}, "java.util.List"); +c$.getNoFallbackControl = Clazz_defineMethod (c$, "getNoFallbackControl", +function (a) { +if (a.equals (java.util.ResourceBundle.Control.FORMAT_DEFAULT)) { +return java.util.ResourceBundle.NoFallbackControl.NO_FALLBACK; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_PROPERTIES)) { +return java.util.ResourceBundle.NoFallbackControl.PROPERTIES_ONLY_NO_FALLBACK; +}if (a.equals (java.util.ResourceBundle.Control.FORMAT_CLASS)) { +return java.util.ResourceBundle.NoFallbackControl.CLASS_ONLY_NO_FALLBACK; +}throw new IllegalArgumentException (); +}, "java.util.List"); +Clazz_defineMethod (c$, "getFormats", +function (a) { +if (a == null) { +throw new NullPointerException (); +}return java.util.ResourceBundle.Control.FORMAT_DEFAULT; +}, "~S"); +Clazz_defineMethod (c$, "getCandidateLocales", +function (a, b) { +if (a == null) { +throw new NullPointerException (); +}var c = b.getLanguage (); +var d = b.getCountry (); +var e = b.getVariant (); +var f = new java.util.ArrayList (4); +if (e.length > 0) { +f.add (b); +}if (d.length > 0) { +f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, d, "")); +}if (c.length > 0) { +f.add ((f.size () == 0) ? b : java.util.Locale.getInstance (c, "", "")); +}f.add (java.util.Locale.ROOT); +return f; +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "getFallbackLocale", +function (a, b) { +if (a == null) { +throw new NullPointerException (); +}var c = java.util.Locale.getDefault (); +return b.equals (c) ? null : c; +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "newBundle", +function (a, b, c, d, e) { +var f = this.toBundleName (a, b); +var g = null; +if (c.equals ("java.class")) { +g = swingjs.api.Interface.getInstance (f, false); +} else if (c.equals ("java.properties")) { +var h = this.toResourceName0 (f, "properties"); +if (h == null) { +return null; +}var i = swingjs.JSToolkit.getJavaResource (h); +var j = null; +j = (i == null ? null : new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (i.getBytes ()))); +if (j != null) { +try { +g = this.newPropertyBundle (j); +} finally { +j.close (); +} +}} else { +throw new IllegalArgumentException ("unknown format: " + c); +}return g; +}, "~S,java.util.Locale,~S,~O,~B"); +Clazz_defineMethod (c$, "newPropertyBundle", + function (a) { +return (swingjs.api.Interface.getInstance ("java.util.PropertyResourceBundle", false)).setStream (a); +}, "java.io.InputStream"); +Clazz_defineMethod (c$, "getTimeToLive", +function (a, b) { +if (a == null || b == null) { +throw new NullPointerException (); +}return -2; +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "toBundleName", +function (a, b) { +if (b === java.util.Locale.ROOT) { +return a; +}var c = b.getLanguage (); +var d = b.getCountry (); +var e = b.getVariant (); +if (c === "" && d === "" && e === "") { +return a; +}var f = new StringBuilder (a); +f.append ('_'); +if (e !== "") { +f.append (c).append ('_').append (d).append ('_').append (e); +} else if (d !== "") { +f.append (c).append ('_').append (d); +} else { +f.append (c); +}return f.toString (); +}, "~S,java.util.Locale"); +Clazz_defineMethod (c$, "toResourceName", +function (a, b) { +var c = new StringBuilder (a.length + 1 + b.length); +c.append (a.$replace ('.', '/')).append ('.').append (b); +return c.toString (); +}, "~S,~S"); +Clazz_defineMethod (c$, "toResourceName0", + function (a, b) { +if (a.contains ("://")) { +return null; +} else { +return this.toResourceName (a, b); +}}, "~S,~S"); +c$.FORMAT_DEFAULT = c$.prototype.FORMAT_DEFAULT = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class", "java.properties"])); +c$.FORMAT_CLASS = c$.prototype.FORMAT_CLASS = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.class"])); +c$.FORMAT_PROPERTIES = c$.prototype.FORMAT_PROPERTIES = java.util.Collections.unmodifiableList (java.util.Arrays.asList (["java.properties"])); +Clazz_defineStatics (c$, +"TTL_DONT_CACHE", -1, +"TTL_NO_EXPIRATION_CONTROL", -2); +c$.INSTANCE = c$.prototype.INSTANCE = new java.util.ResourceBundle.Control (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.formats = null; +Clazz_instantialize (this, arguments); +}, java.util.ResourceBundle, "SingleFormatControl", java.util.ResourceBundle.Control); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.util.ResourceBundle.SingleFormatControl, []); +this.formats = a; +}, "java.util.List"); +Clazz_overrideMethod (c$, "getFormats", +function (a) { +if (a == null) { +throw new NullPointerException (); +}return this.formats; +}, "~S"); +c$.PROPERTIES_ONLY = c$.prototype.PROPERTIES_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); +c$.CLASS_ONLY = c$.prototype.CLASS_ONLY = new java.util.ResourceBundle.SingleFormatControl (java.util.ResourceBundle.Control.FORMAT_CLASS); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.util.ResourceBundle, "NoFallbackControl", java.util.ResourceBundle.SingleFormatControl); +Clazz_overrideMethod (c$, "getFallbackLocale", +function (a, b) { +if (a == null || b == null) { +throw new NullPointerException (); +}return null; +}, "~S,java.util.Locale"); +c$.NO_FALLBACK = c$.prototype.NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_DEFAULT); +c$.PROPERTIES_ONLY_NO_FALLBACK = c$.prototype.PROPERTIES_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_PROPERTIES); +c$.CLASS_ONLY_NO_FALLBACK = c$.prototype.CLASS_ONLY_NO_FALLBACK = new java.util.ResourceBundle.NoFallbackControl (java.util.ResourceBundle.Control.FORMAT_CLASS); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"INITIAL_CACHE_SIZE", 32); +c$.NONEXISTENT_BUNDLE = c$.prototype.NONEXISTENT_BUNDLE = ((Clazz_isClassDefined ("java.util.ResourceBundle$1") ? 0 : java.util.ResourceBundle.$ResourceBundle$1$ ()), Clazz_innerTypeInstance (java.util.ResourceBundle$1, this, null)); +c$.cacheList = c$.prototype.cacheList = new java.util.HashMap (32); +}); +Clazz_declarePackage ("java.applet"); +Clazz_load (["java.awt.Panel"], "java.applet.Applet", ["java.net.URL", "java.util.Locale"], function () { +c$ = Clazz_decorateAsClass (function () { +this.stub = null; +Clazz_instantialize (this, arguments); +}, java.applet, "Applet", java.awt.Panel); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.applet.Applet, []); +this.setPanel (); +}); +Clazz_defineMethod (c$, "setStub", +function (stub) { +this.stub = stub; +}, "java.applet.AppletStub"); +Clazz_defineMethod (c$, "isActive", +function () { +if (this.stub != null) { +return this.stub.isActive (); +} else { +return false; +}}); +Clazz_defineMethod (c$, "getDocumentBase", +function () { +return this.stub.getDocumentBase (); +}); +Clazz_defineMethod (c$, "getCodeBase", +function () { +return this.stub.getCodeBase (); +}); +Clazz_defineMethod (c$, "getParameter", +function (name) { +return this.stub.getParameter (name); +}, "~S"); +Clazz_defineMethod (c$, "getAppletContext", +function () { +return this.stub.getAppletContext (); +}); +Clazz_defineMethod (c$, "resize", +function (width, height) { +var d = this.size (); +if ((d.width != width) || (d.height != height)) { +Clazz_superCall (this, java.applet.Applet, "resize", [width, height]); +if (this.stub != null) { +this.stub.appletResize (width, height); +}}}, "~N,~N"); +Clazz_defineMethod (c$, "resize", +function (d) { +this.resize (d.width, d.height); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "showStatus", +function (msg) { +this.getAppletContext ().showStatus (msg); +}, "~S"); +Clazz_defineMethod (c$, "getImage", +function (url) { +return this.getAppletContext ().getImage (url); +}, "java.net.URL"); +Clazz_defineMethod (c$, "getImage", +function (url, name) { +try { +return this.getImage ( new java.net.URL (url, name)); +} catch (e) { +if (Clazz_exceptionOf (e, java.net.MalformedURLException)) { +return null; +} else { +throw e; +} +} +}, "java.net.URL,~S"); +Clazz_defineMethod (c$, "getAppletInfo", +function () { +return null; +}); +Clazz_defineMethod (c$, "getLocale", +function () { +var locale = Clazz_superCall (this, java.applet.Applet, "getLocale", []); +if (locale == null) { +return java.util.Locale.getDefault (); +}return locale; +}); +Clazz_defineMethod (c$, "getParameterInfo", +function () { +return null; +}); +Clazz_defineMethod (c$, "init", +function () { +}); +Clazz_defineMethod (c$, "start", +function () { +}); +Clazz_defineMethod (c$, "stop", +function () { +}); +Clazz_defineMethod (c$, "destroy", +function () { +}); +}); +Clazz_declarePackage ("java.net"); +Clazz_load (["java.util.Hashtable"], "java.net.URL", ["java.io.IOException", "java.lang.Character", "$.Error", "java.net.MalformedURLException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.protocol = null; +this.host = null; +this.port = -1; +this.file = null; +this.query = null; +this.authority = null; +this.path = null; +this.userInfo = null; +this.ref = null; +this.handler = null; +this.$hashCode = -1; +Clazz_instantialize (this, arguments); +}, java.net, "URL", null, java.io.Serializable); +Clazz_makeConstructor (c$, +function (context, spec, handler) { +{ +switch (arguments.length) { +case 1: +spec = context;context = handler = null; +break; +case 2: +handler = null; +break; +case 3: +if (context == null || Clazz_instanceOf(context, java.net.URL)) +break; +default: +alert("java.net.URL constructor format not supported"); +break; +} +context && context.valueOf && context.valueOf() == null && (context = null); +}var original = spec; +var i; +var limit; +var c; +var start = 0; +var newProtocol = null; +var aRef = false; +var isRelative = false; +try { +limit = spec.length; +while ((limit > 0) && (spec.charAt (limit - 1) <= ' ')) { +limit--; +} +while ((start < limit) && (spec.charAt (start) <= ' ')) { +start++; +} +if (spec.regionMatches (true, start, "url:", 0, 4)) { +start += 4; +}if (start < spec.length && spec.charAt (start) == '#') { +aRef = true; +}for (i = start; !aRef && (i < limit) && ((c = spec.charCodeAt (i)) != 47); i++) { +if (c == 58) { +var s = spec.substring (start, i).toLowerCase (); +if (this.isValidProtocol (s)) { +newProtocol = s; +start = i + 1; +}break; +}} +this.protocol = newProtocol; +if ((context != null) && ((newProtocol == null) || newProtocol.equalsIgnoreCase (context.protocol))) { +if (handler == null) { +handler = context.handler; +}if (context.path != null && context.path.startsWith ("/")) newProtocol = null; +if (newProtocol == null) { +this.protocol = context.protocol; +this.authority = context.authority; +this.userInfo = context.userInfo; +this.host = context.host; +this.port = context.port; +this.file = context.file; +this.path = context.path; +isRelative = true; +}}if (this.protocol == null) { +throw new java.net.MalformedURLException ("no protocol: " + original); +}if (handler == null && (handler = java.net.URL.getURLStreamHandler (this.protocol)) == null) { +throw new java.net.MalformedURLException ("unknown protocol: " + this.protocol); +}this.handler = handler; +i = spec.indexOf ('#', start); +if (i >= 0) { +this.ref = spec.substring (i + 1, limit); +limit = i; +}if (isRelative && start == limit) { +this.query = context.query; +if (this.ref == null) { +this.ref = context.ref; +}}handler.parseURL (this, spec, start, limit); +} catch (e$$) { +if (Clazz_exceptionOf (e$$, java.net.MalformedURLException)) { +var e = e$$; +{ +throw e; +} +} else if (Clazz_exceptionOf (e$$, Exception)) { +var e = e$$; +{ +var exception = new java.net.MalformedURLException (e.getMessage ()); +exception.initCause (e); +throw exception; +} +} else { +throw e$$; +} +} +}, "java.net.URL,~S,java.net.URLStreamHandler"); +Clazz_defineMethod (c$, "isValidProtocol", + function (protocol) { +var len = protocol.length; +if (len < 1) return false; +var c = protocol.charAt (0); +if (!Character.isLetter (c)) return false; +for (var i = 1; i < len; i++) { +c = protocol.charAt (i); +if (!Character.isLetterOrDigit (c) && c != '.' && c != '+' && c != '-') { +return false; +}} +return true; +}, "~S"); +Clazz_defineMethod (c$, "set5", +function (protocol, host, port, file, ref) { +{ +this.protocol = protocol; +this.host = host; +this.authority = port == -1 ? host : host + ":" + port; +this.port = port; +this.file = file; +this.ref = ref; +this.$hashCode = -1; +var q = file.lastIndexOf ('?'); +if (q != -1) { +this.query = file.substring (q + 1); +this.path = file.substring (0, q); +} else this.path = file; +}}, "~S,~S,~N,~S,~S"); +Clazz_defineMethod (c$, "set", +function (protocol, host, port, authority, userInfo, path, query, ref) { +{ +this.protocol = protocol; +this.host = host; +this.port = port; +this.file = query == null ? path : path + "?" + query; +this.userInfo = userInfo; +this.path = path; +this.ref = ref; +this.$hashCode = -1; +this.query = query; +this.authority = authority; +}}, "~S,~S,~N,~S,~S,~S,~S,~S"); +Clazz_defineMethod (c$, "getQuery", +function () { +return this.query; +}); +Clazz_defineMethod (c$, "getPath", +function () { +return this.path; +}); +Clazz_defineMethod (c$, "getUserInfo", +function () { +return this.userInfo; +}); +Clazz_defineMethod (c$, "getAuthority", +function () { +return this.authority; +}); +Clazz_defineMethod (c$, "getPort", +function () { +return this.port; +}); +Clazz_defineMethod (c$, "getDefaultPort", +function () { +return this.handler.getDefaultPort (); +}); +Clazz_defineMethod (c$, "getProtocol", +function () { +return this.protocol; +}); +Clazz_defineMethod (c$, "getHost", +function () { +return this.host; +}); +Clazz_defineMethod (c$, "getFile", +function () { +return this.file; +}); +Clazz_defineMethod (c$, "getRef", +function () { +return this.ref; +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (!(Clazz_instanceOf (obj, java.net.URL))) return false; +var u2 = obj; +return this.handler.equals2 (this, u2); +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +if (this.$hashCode != -1) return this.$hashCode; +this.$hashCode = this.handler.hashCode (this); +return this.$hashCode; +}); +Clazz_defineMethod (c$, "sameFile", +function (other) { +return this.handler.sameFile (this, other); +}, "java.net.URL"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.toExternalForm (); +}); +Clazz_defineMethod (c$, "toExternalForm", +function () { +return this.handler.toExternalForm (this); +}); +Clazz_defineMethod (c$, "openConnection", +function () { +return this.handler.openConnection (this); +}); +Clazz_defineMethod (c$, "openStream", +function () { +return this.openConnection ().getInputStream (); +}); +Clazz_defineMethod (c$, "getContent", +function () { +return this.openConnection ().getInputStream (); +}); +c$.setURLStreamHandlerFactory = Clazz_defineMethod (c$, "setURLStreamHandlerFactory", +function (fac) { +{ +if (java.net.URL.factory != null) { +throw new Error ("factory already defined"); +}var security = System.getSecurityManager (); +if (security != null) { +security.checkSetFactory (); +}java.net.URL.handlers.clear (); +java.net.URL.factory = fac; +}}, "java.net.URLStreamHandlerFactory"); +c$.getURLStreamHandler = Clazz_defineMethod (c$, "getURLStreamHandler", +function (protocol) { +var handler = java.net.URL.handlers.get (protocol); +if (handler == null) { +if (java.net.URL.factory != null) { +handler = java.net.URL.factory.createURLStreamHandler (protocol); +}}return handler; +}, "~S"); +Clazz_defineStatics (c$, +"factory", null); +c$.handlers = c$.prototype.handlers = new java.util.Hashtable (); +c$.streamHandlerLock = c$.prototype.streamHandlerLock = new Clazz._O (); +}); + +// modified by Bob Hanson 3/21/2014 6:44:21 AM to reduce this.b$[....] phrases to simply this.h$ +// BH added ability to use a non-Java key for HTML elements, for example. +// BH 8/24/2014 8:48:58 PM all synchronization and inner classes removed + + +Clazz_load([],"java.util.HashtableIterator",[],function(){ +c$=Clazz_decorateAsClass(function(){ +this.position=0; +this.expectedModCount=0; +this.type=null; +this.lastEntry=null; +this.lastPosition=0; +this.canRemove=false; +Clazz_instantialize(this,arguments); +},java.util,"HashtableIterator",null,java.util.Iterator); +Clazz_makeConstructor(c$, +function(a){ +this.type=a; +this.h$ = a.h$; +this.position=this.h$.lastSlot; +this.expectedModCount=this.h$.modCount; +},"java.util.AbstractSet"); +Clazz_overrideMethod(c$,"hasNext", +function(){ +if(this.lastEntry&&this.lastEntry.next){ +return true; +}while(this.position>=this.h$.firstSlot){ +if(this.h$.elementData[this.position]==null){ +this.position--; +}else{ +return true; +}} +return false; +}); +Clazz_overrideMethod(c$,"next", +function(){ +if(this.expectedModCount==this.h$.modCount){ +if(this.lastEntry){ +this.lastEntry=this.lastEntry.next; +}if(this.lastEntry==null){ +while(this.position>=this.h$.firstSlot&&(this.lastEntry=this.h$.elementData[this.position])==null){ +this.position--; +} +if(this.lastEntry){ +this.lastPosition=this.position; +this.position--; +}}if(this.lastEntry){ +this.canRemove=true; +return this.type.get(this.lastEntry); +}throw new java.util.NoSuchElementException(); +}throw new java.util.ConcurrentModificationException(); +}); +Clazz_overrideMethod(c$,"remove", +function(){ +if(this.expectedModCount==this.h$.modCount){ +if(this.canRemove){ +this.canRemove=false; +{ +var a=false; +var b=this.h$.elementData[this.lastPosition]; +if(b===this.lastEntry){ +this.h$.elementData[this.lastPosition]=b.next; +a=true; +}else{ +while(b&&b.next!==this.lastEntry){ +b=b.next; +} +if(b){ +b.next=this.lastEntry.next; +a=true; +}}if(a){ +this.h$.modCount++; +this.h$.elementCount--; +this.expectedModCount++; +return; +}}}else{ +throw new IllegalStateException(); +}}throw new java.util.ConcurrentModificationException(); +}); +}); + + + +//////////////////////////// + + +Clazz_load([],"java.util.HashtableEnumerator",[],function(){ +c$=Clazz_decorateAsClass(function(){ +this.key=false; +this.start=0; +this.entry=null; +Clazz_instantialize(this,arguments); +},java.util,"HashtableEnumerator",null,java.util.Enumeration); + +Clazz_makeConstructor(c$, +function(a, b){ +this.key = a; +this.h$ = b; +if (this.h$)this.start=this.h$.lastSlot+1; +},"~B,java.util.Hashtable"); +Clazz_overrideMethod(c$,"hasMoreElements", +function(){ +if (!this.h$)return false; +if(this.entry)return true; + +while(--this.start>=this.h$.firstSlot){ +if(this.h$.elementData[this.start]){ +this.entry=this.h$.elementData[this.start]; +return true; +}} +return false; +}); +Clazz_overrideMethod(c$,"nextElement", +function(){ +if(this.hasMoreElements()){ +var a=this.key?this.entry.key:this.entry.value; +this.entry=this.entry.next; +return a; +} +throw new java.util.NoSuchElementException(); +}); +}); + +//////////////////////////// + +Clazz_load([],"java.util.HashtableEntrySet",[],function(){ +c$=Clazz_decorateAsClass(function(){ +Clazz_instantialize(this,arguments); +},java.util,"HashtableEntrySet",java.util.AbstractSet); + +Clazz_makeConstructor(c$, +function(a){ +this.h$ = a; +},"java.util.Hashtable"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.h$.elementCount; +}); +Clazz_overrideMethod(c$,"clear", +function(){ +this.h$.clear(); +}); +Clazz_overrideMethod(c$,"remove", +function(object){ +if(this.contains(object)){ +this.h$.remove((object).getKey()); +return true; +}return false; +},"~O"); +Clazz_defineMethod(c$,"contains", +function(object){ +var entry=this.h$.getEntry((object).getKey()); +return object.equals(entry); +},"~O"); + +Clazz_overrideMethod(c$,"get", +function(entry){ +return entry; +},"java.util.MapEntry"); + +Clazz_defineMethod(c$,"iterator", +function(){ +return new java.util.HashtableIterator(this); +}); +}); + + +//////////////////////////// + +Clazz_load([],"java.util.HashtableKeySet",[],function(){ +c$=Clazz_decorateAsClass(function(){ +Clazz_instantialize(this,arguments); +},java.util,"HashtableKeySet",java.util.AbstractSet); + +Clazz_makeConstructor(c$, +function(a){ +this.h$ = a; +},"java.util.Hashtable"); + +Clazz_overrideMethod(c$,"contains", +function(object){ +return this.h$.containsKey(object); +},"~O"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.h$.elementCount; +}); +Clazz_overrideMethod(c$,"clear", +function(){ +this.h$.clear(); +}); +Clazz_overrideMethod(c$,"remove", +function(key){ +if(this.h$.containsKey(key)){ +this.h$.remove(key); +return true; +}return false; +},"~O"); + +Clazz_overrideMethod(c$,"get", +function(entry){ +return entry.key; +},"java.util.MapEntry"); + +Clazz_overrideMethod(c$,"iterator", +function(){ +return new java.util.HashtableIterator(this); +}); +}); + +//////////////////////////// + +Clazz_load([],"java.util.HashtableValueCollection",[],function(){ +c$=Clazz_decorateAsClass(function(){ +Clazz_instantialize(this,arguments); +},java.util,"HashtableValueCollection",null,java.util.AbstractCollection); + +Clazz_makeConstructor(c$, +function(a){ +this.h$ = a; +},"java.util.Hashtable"); +Clazz_overrideMethod(c$,"contains", +function(object){ +return this.h$.contains(object); +},"~O"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.h$.elementCount; +}); +Clazz_overrideMethod(c$,"clear", +function(){ +this.h$.clear(); +}); + +Clazz_overrideMethod(c$,"get", +function(entry){ +return entry.value; +},"java.util.MapEntry"); + +Clazz_overrideMethod(c$,"iterator", +function(){ +return new java.util.HashtableIterator(this); +}); +}); +//////////////////////////// + + +Clazz_load(["java.util.MapEntry"],"java.util.HashtableEntry",[],function(){ +c$=Clazz_decorateAsClass(function(){ +this.next=null; +this.hashcode=0; +Clazz_instantialize(this,arguments); +},java.util,"HashtableEntry",java.util.MapEntry); +Clazz_overrideConstructor(c$, +function(a,b){ +this.key = a; +this.value = b; +this.hashcode=a.hashCode(); +}); +Clazz_defineMethod(c$,"clone", +function(){ +var a=Clazz_superCall(this,java.util.HashtableEntry,"clone",[]); +if(this.next!=null){ +a.next=this.next.clone(); +} +return a; +}); +Clazz_overrideMethod(c$,"setValue", +function(a){ +if(a==null){ +throw new NullPointerException(); +}var b=this.value; +this.value=a; +return b; +},"~O"); +Clazz_defineMethod(c$,"getKeyHash", +function(){ +return this.key.hashCode(); +}); +Clazz_defineMethod(c$,"equalsKey", +function(a,b){ +return this.hashcode==(!a.hashCode || a.hashCode())&&this.key.equals(a); +},"~O,~N"); +Clazz_overrideMethod(c$,"toString", +function(){ +return this.key+"="+this.value; +}); +}); + + + +//////////////////////////// + + +Clazz_load(["java.util.Dictionary","$.Enumeration","$.HashtableEnumerator","$.Iterator","$.Map","$.MapEntry","$.NoSuchElementException"],"java.util.Hashtable",["java.lang.IllegalArgumentException","$.IllegalStateException","$.NullPointerException","$.StringBuilder","java.util.AbstractCollection","$.AbstractSet","$.Arrays","$.Collections","$.ConcurrentModificationException","java.util.MapEntry.Type","java.util.HashtableEntry"],function(){ +c$=Clazz_decorateAsClass(function(){ +this.elementCount=0; +this.elementData=null; +this.loadFactor=0; +this.threshold=0; +this.firstSlot=0; +this.lastSlot=-1; +this.modCount=0; +Clazz_instantialize(this,arguments); +},java.util,"Hashtable",java.util.Dictionary,[java.util.Map,Cloneable,java.io.Serializable]); +c$.newEntry=Clazz_defineMethod(c$,"newEntry", +($fz=function(key,value,hash){ +return new java.util.HashtableEntry(key,value); +},$fz.isPrivate=true,$fz),"~O,~O,~N"); +Clazz_overrideConstructor(c$, +function(){ +this.elementCount=0; +this.elementData=this.newElementArray(11); +this.firstSlot=this.elementData.length; +this.loadFactor=0.75; +this.computeMaxSize(); +}); +Clazz_defineMethod(c$,"newElementArray", +($fz=function(size){ +return new Array(size); +},$fz.isPrivate=true,$fz),"~N"); +Clazz_overrideMethod(c$,"clear", +function(){ +this.elementCount=0; +for (var i = this.elementData.length; --i >= 0;) + this.elementData[i] = null; +this.modCount++; +}); +Clazz_defineMethod(c$,"clone", +function(){ +try{ +var hashtable=Clazz_superCall(this,java.util.Hashtable,"clone",[]); +hashtable.elementData=this.elementData.clone(); +var entry; +for(var i=this.elementData.length;--i>=0;){ +if((entry=this.elementData[i])){ +hashtable.elementData[i]=entry.clone(); +}} +return hashtable; +}catch(e){ +if(Clazz_instanceOf(e,CloneNotSupportedException)){ +return null; +}else{ +throw e; +} +} +}); +Clazz_defineMethod(c$,"computeMaxSize", +($fz=function(){ +this.threshold=Math.round((this.elementData.length*this.loadFactor)); +},$fz.isPrivate=true,$fz)); +Clazz_defineMethod(c$,"contains", +function(value){ +if(value==null){ +throw new NullPointerException(); +}for(var i=this.elementData.length;--i>=0;){ +var entry=this.elementData[i]; +while(entry){ +if(value.equals(entry.value)){ +return true; +}entry=entry.next; +} +} +return false; +},"~O"); +Clazz_overrideMethod(c$,"containsKey", +function(key){ + if(!key.hashCode) { + key.hashCode = function(){return 1}; + if (!key.equals) + key.equals = function(a) {return this == a}; + } +return this.getEntry(key)!=null ; +},"~O"); +Clazz_overrideMethod(c$,"containsValue", +function(value){ +return this.contains(value); +},"~O"); +Clazz_overrideMethod(c$,"elements", +function(){ +if(this.elementCount==0){ +return java.util.Hashtable.EMPTY_ENUMERATION; +} +return new java.util.HashtableEnumerator(false, this); +}); +Clazz_overrideMethod(c$,"entrySet", +function(){ +return new java.util.HashtableEntrySet(this); +}); +Clazz_overrideMethod(c$,"equals", +function(object){ +if(this===object){ +return true; +}if(Clazz_instanceOf(object,java.util.Map)){ +var map=object; +if(this.size()!=map.size()){ +return false; +}var entries=this.entrySet(); +for(var e,$e=map.entrySet().iterator();$e.hasNext()&&((e=$e.next())||true);){ +if(!entries.contains(e)){ +return false; +}} +return true; +}return false; +},"~O"); +Clazz_overrideMethod(c$,"get", +function(key){ + if(!key.hashCode) { + key.hashCode = function(){return 1}; + if (!key.equals) + key.equals = function(a) {return this == a}; + } +var hash=key.hashCode(); +var index=(hash&0x7FFFFFFF)%this.elementData.length; +var entry=this.elementData[index]; +while(entry){ +if(entry.equalsKey(key,hash)){ +return entry.value; +}entry=entry.next; +} +return null; +},"~O"); +Clazz_defineMethod(c$,"getEntry", +function(key){ +var hash=key.hashCode(); +var index=(hash&0x7FFFFFFF)%this.elementData.length; +var entry=this.elementData[index]; +while(entry){ +if(entry.equalsKey(key,hash)){ +return entry; +}entry=entry.next; +} +return null; +},"~O"); +Clazz_overrideMethod(c$,"hashCode", +function(){ +var result=0; +var it=this.entrySet().iterator(); +while(it.hasNext()){ +var entry=it.next(); +var key=entry.getKey(); +var value=entry.getValue(); +var hash=(key!==this?key.hashCode():0)^(value!==this?(value!=null?value.hashCode():0):0); +result+=hash; +} +return result; +}); +Clazz_overrideMethod(c$,"isEmpty", +function(){ +return this.elementCount==0; +}); +Clazz_overrideMethod(c$,"keys", +function(){ +if(this.elementCount==0){ +return java.util.Hashtable.EMPTY_ENUMERATION; +} +return new java.util.HashtableEnumerator(true, this); +}); +Clazz_overrideMethod(c$,"keySet", +function(){ +return new java.util.HashtableKeySet(this); +}); +Clazz_overrideMethod(c$,"put", +function(key,value){ +if(key!=null&&value!=null){ + if(!key.hashCode) { + key.hashCode = function(){return 1}; + if (!key.equals) + key.equals = function(a) {return this == a}; + } + var hash=key.hashCode(); + var index=(hash&0x7FFFFFFF)%this.elementData.length; + var entry=this.elementData[index]; + while(entry!=null&&!entry.equalsKey(key,hash)){ + entry=entry.next; +} +if(entry==null){ +this.modCount++; +if(++this.elementCount>this.threshold){ +this.rehash(); +index=(hash&0x7FFFFFFF)%this.elementData.length; +}if(indexthis.lastSlot){ +this.lastSlot=index; +} + +entry=java.util.Hashtable.newEntry(key,value,hash); +entry.next=this.elementData[index]; +this.elementData[index]=entry; +return null; +}var result=entry.value; +entry.value=value; +return result; +}throw new NullPointerException(); +},"~O,~O"); +Clazz_overrideMethod(c$,"putAll", +function(map){ +for(var entry,$entry=map.entrySet().iterator();$entry.hasNext()&&((entry=$entry.next())||true);){ +this.put(entry.getKey(),entry.getValue()); +} +},"java.util.Map"); + +Clazz_defineMethod(c$,"rehash", +function(){ +var length=(this.elementData.length<<1)+1; +if(length==0){ +length=1; +}var newFirst=length; +var newLast=-1; +var newData=this.newElementArray(length); +for(var i=this.lastSlot+1;--i>=this.firstSlot;){ +var entry=this.elementData[i]; +while(entry!=null){ +var index=(entry.getKeyHash()&0x7FFFFFFF)%length; +if(indexnewLast){ +newLast=index; +}var next=entry.next; +entry.next=newData[index]; +newData[index]=entry; +entry=next; +} +} +this.firstSlot=newFirst; +this.lastSlot=newLast; +this.elementData=newData; +this.computeMaxSize(); +}); +Clazz_overrideMethod(c$,"remove", +function(key){ +var hash=key.hashCode(); +var index=(hash&0x7FFFFFFF)%this.elementData.length; +var last=null; +var entry=this.elementData[index]; +while(entry!=null&&!entry.equalsKey(key,hash)){ +last=entry; +entry=entry.next; +} +if(entry!=null){ +this.modCount++; +if(last==null){ +this.elementData[index]=entry.next; +}else{ +last.next=entry.next; +}this.elementCount--; +var result=entry.value; +entry.value=null; +return result; +}return null; +},"~O"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.elementCount; +}); +Clazz_overrideMethod(c$,"toString", +function(){ +if(this.isEmpty()){ +return"{}"; +}var buffer=new StringBuilder(this.size()*28); +buffer.append('{'); +for(var i=this.lastSlot;i>=this.firstSlot;i--){ +var entry=this.elementData[i]; +while(entry!=null){ +if(entry.key!==this){ +buffer.append(entry.key); +}else{ +buffer.append("(this Map)"); +}buffer.append('='); +if(entry.value!==this){ +buffer.append(entry.value); +}else{ +buffer.append("(this Map)"); +}buffer.append(", "); +entry=entry.next; +} +} +if(this.elementCount>0){ +buffer.setLength(buffer.length()-2); +}buffer.append('}'); +return buffer.toString(); +}); +Clazz_overrideMethod(c$,"values", +function(){ +return new java.util.HashtableValueCollection(this); +}); +java.util.Hashtable.EMPTY_ENUMERATION = new java.util.HashtableEnumerator(); +}); +c$=Clazz_declareType(java.util,"Dictionary"); +Clazz_makeConstructor(c$, +function(){ +}); +Clazz_declarePackage ("java.net"); +Clazz_load (["java.io.IOException"], "java.net.MalformedURLException", null, function () { +c$ = Clazz_declareType (java.net, "MalformedURLException", java.io.IOException); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.net.MalformedURLException, []); +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (null, "java.awt.GraphicsEnvironment", ["swingjs.JSToolkit"], function () { +c$ = Clazz_declareType (java.awt, "GraphicsEnvironment"); +Clazz_makeConstructor (c$, +function () { +}); +c$.getLocalGraphicsEnvironment = Clazz_defineMethod (c$, "getLocalGraphicsEnvironment", +function () { +if (java.awt.GraphicsEnvironment.localEnv == null) { +java.awt.GraphicsEnvironment.localEnv = swingjs.JSToolkit.getInstance ("swingjs.JSGraphicsEnvironment"); +}return java.awt.GraphicsEnvironment.localEnv; +}); +c$.isHeadless = Clazz_defineMethod (c$, "isHeadless", +function () { +return false; +}); +c$.getHeadlessProperty = Clazz_defineMethod (c$, "getHeadlessProperty", + function () { +return false; +}); +c$.checkHeadless = Clazz_defineMethod (c$, "checkHeadless", +function () { +}); +Clazz_defineMethod (c$, "isHeadlessInstance", +function () { +return java.awt.GraphicsEnvironment.getHeadlessProperty (); +}); +Clazz_defineMethod (c$, "registerFont", +function (font) { +return true; +}, "java.awt.Font"); +Clazz_defineMethod (c$, "preferLocaleFonts", +function () { +}); +Clazz_defineMethod (c$, "preferProportionalFonts", +function () { +}); +Clazz_defineMethod (c$, "getCenterPoint", +function () { +return null; +}); +Clazz_defineStatics (c$, +"localEnv", null); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.WindowEvent", ["java.awt.Window", "jssun.awt.AppContext", "$.SunToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.opposite = null; +this.oldState = 0; +this.newState = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "WindowEvent", java.awt.event.ComponentEvent); +Clazz_makeConstructor (c$, +function (source, id, opposite, oldState, newState) { +Clazz_superConstructor (this, java.awt.event.WindowEvent, [source, id]); +this.opposite = opposite; +this.oldState = oldState; +this.newState = newState; +}, "java.awt.Window,~N,java.awt.Window,~N,~N"); +Clazz_makeConstructor (c$, +function (source, id, opposite) { +this.construct (source, id, opposite, 0, 0); +}, "java.awt.Window,~N,java.awt.Window"); +Clazz_makeConstructor (c$, +function (source, id, oldState, newState) { +this.construct (source, id, null, oldState, newState); +}, "java.awt.Window,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (source, id) { +this.construct (source, id, null, 0, 0); +}, "java.awt.Window,~N"); +Clazz_defineMethod (c$, "getWindow", +function () { +return (Clazz_instanceOf (this.source, java.awt.Window)) ? this.source : null; +}); +Clazz_defineMethod (c$, "getOppositeWindow", +function () { +if (this.opposite == null) { +return null; +}return (jssun.awt.SunToolkit.targetToAppContext (this.opposite) === jssun.awt.AppContext.getAppContext ()) ? this.opposite : null; +}); +Clazz_defineMethod (c$, "getOldState", +function () { +return this.oldState; +}); +Clazz_defineMethod (c$, "getNewState", +function () { +return this.newState; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 200: +typeStr = "WINDOW_OPENED"; +break; +case 201: +typeStr = "WINDOW_CLOSING"; +break; +case 202: +typeStr = "WINDOW_CLOSED"; +break; +case 203: +typeStr = "WINDOW_ICONIFIED"; +break; +case 204: +typeStr = "WINDOW_DEICONIFIED"; +break; +case 205: +typeStr = "WINDOW_ACTIVATED"; +break; +case 206: +typeStr = "WINDOW_DEACTIVATED"; +break; +case 207: +typeStr = "WINDOW_GAINED_FOCUS"; +break; +case 208: +typeStr = "WINDOW_LOST_FOCUS"; +break; +case 209: +typeStr = "WINDOW_STATE_CHANGED"; +break; +default: +typeStr = "unknown type"; +} +typeStr += ",opposite=" + this.getOppositeWindow () + ",oldState=" + this.oldState + ",newState=" + this.newState; +return typeStr; +}); +Clazz_defineStatics (c$, +"WINDOW_FIRST", 200, +"WINDOW_OPENED", 200, +"WINDOW_CLOSING", 201, +"WINDOW_CLOSED", 202, +"WINDOW_ICONIFIED", 203, +"WINDOW_DEICONIFIED", 204, +"WINDOW_ACTIVATED", 205, +"WINDOW_DEACTIVATED", 206, +"WINDOW_GAINED_FOCUS", 207, +"WINDOW_LOST_FOCUS", 208, +"WINDOW_STATE_CHANGED", 209, +"WINDOW_LAST", 209); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Container", "javax.swing.Action", "java.util.ArrayList", "javax.swing.SwingUtilities", "javax.swing.event.EventListenerList", "jssun.awt.RequestFocusController"], "javax.swing.JComponent", ["java.lang.IllegalArgumentException", "java.util.HashSet", "$.Hashtable", "java.applet.Applet", "java.awt.Component", "$.Insets", "$.Rectangle", "$.Window", "java.beans.PropertyChangeListener", "java.util.Locale", "javax.swing.ActionMap", "$.AncestorNotifier", "$.ArrayTable", "$.CellRendererPane", "$.ClientPropertyKey", "$.ComponentInputMap", "$.InputMap", "$.JApplet", "$.JDialog", "$.JFrame", "$.JWindow", "$.KeyStroke", "$.KeyboardManager", "javax.swing.Popup.HeavyWeightWindow", "javax.swing.RepaintManager", "javax.swing.border.AbstractBorder", "javax.swing.event.AncestorListener", "jssun.font.FontDesignMetrics", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.isAlignmentXSet = false; +this.alignmentX = 0; +this.isAlignmentYSet = false; +this.alignmentY = 0; +this.ui = null; +this.listenerList = null; +this.clientProperties = null; +this.autoscrolls = false; +this.border = null; +this.flags = 0; +this.verifyInputWhenFocusTarget = true; +this.paintingChild = null; +this.popupMenu = null; +this.focusInputMap = null; +this.ancestorInputMap = null; +this.windowInputMap = null; +this.actionMap = null; +if (!Clazz_isClassDefined ("javax.swing.JComponent.ActionStandin")) { +javax.swing.JComponent.$JComponent$ActionStandin$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "JComponent", java.awt.Container); +Clazz_prepareFields (c$, function () { +this.listenerList = new javax.swing.event.EventListenerList (); +}); +c$.safelyGetGraphics = Clazz_defineMethod (c$, "safelyGetGraphics", +function (c, root) { +{ +javax.swing.JComponent.componentObtainingGraphicsFrom = root; +var g = c.getGraphics (); +javax.swing.JComponent.componentObtainingGraphicsFrom = null; +return g; +}}, "java.awt.Component,java.awt.Component"); +c$.getGraphicsInvoked = Clazz_defineMethod (c$, "getGraphicsInvoked", +function (root) { +if (!javax.swing.JComponent.isComponentObtainingGraphicsFrom (root)) { +var rootPane = (root).getRootPane (); +if (rootPane != null) { +rootPane.disableTrueDoubleBuffering (); +}}}, "java.awt.Component"); +c$.isComponentObtainingGraphicsFrom = Clazz_defineMethod (c$, "isComponentObtainingGraphicsFrom", + function (c) { +{ +return (javax.swing.JComponent.componentObtainingGraphicsFrom === c); +}}, "java.awt.Component"); +c$.getManagingFocusForwardTraversalKeys = Clazz_defineMethod (c$, "getManagingFocusForwardTraversalKeys", +function () { +{ +if (javax.swing.JComponent.managingFocusForwardTraversalKeys == null) { +javax.swing.JComponent.managingFocusForwardTraversalKeys = new java.util.HashSet (1); +javax.swing.JComponent.managingFocusForwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 2)); +}}return javax.swing.JComponent.managingFocusForwardTraversalKeys; +}); +c$.getManagingFocusBackwardTraversalKeys = Clazz_defineMethod (c$, "getManagingFocusBackwardTraversalKeys", +function () { +{ +if (javax.swing.JComponent.managingFocusBackwardTraversalKeys == null) { +javax.swing.JComponent.managingFocusBackwardTraversalKeys = new java.util.HashSet (1); +javax.swing.JComponent.managingFocusBackwardTraversalKeys.add (javax.swing.KeyStroke.getKeyStroke (9, 3)); +}}return javax.swing.JComponent.managingFocusBackwardTraversalKeys; +}); +c$.fetchRectangle = Clazz_defineMethod (c$, "fetchRectangle", + function () { +{ +var rect; +var size = javax.swing.JComponent.tempRectangles.size (); +if (size > 0) { +rect = javax.swing.JComponent.tempRectangles.remove (size - 1); +} else { +rect = new java.awt.Rectangle (0, 0, 0, 0); +}return rect; +}}); +c$.recycleRectangle = Clazz_defineMethod (c$, "recycleRectangle", + function (rect) { +{ +javax.swing.JComponent.tempRectangles.add (rect); +}}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "setInheritsPopupMenu", +function (value) { +var oldValue = this.getFlag (23); +this.setFlag (23, value); +this.firePropertyChangeBool ("inheritsPopupMenu", oldValue, value); +}, "~B"); +Clazz_defineMethod (c$, "getInheritsPopupMenu", +function () { +return this.getFlag (23); +}); +Clazz_defineMethod (c$, "setComponentPopupMenu", +function (popup) { +if (popup != null) { +this.enableEvents (16); +}var oldPopup = this.popupMenu; +this.popupMenu = popup; +this.firePropertyChangeObject ("componentPopupMenu", oldPopup, popup); +}, "javax.swing.JPopupMenu"); +Clazz_defineMethod (c$, "getComponentPopupMenu", +function () { +if (!this.getInheritsPopupMenu ()) { +return this.popupMenu; +}if (this.popupMenu == null) { +var parent = this.getParent (); +while (parent != null) { +if (Clazz_instanceOf (parent, javax.swing.JComponent)) { +return (parent).getComponentPopupMenu (); +}if (Clazz_instanceOf (parent, java.awt.Window) || Clazz_instanceOf (parent, java.applet.Applet)) { +break; +}parent = parent.getParent (); +} +return null; +}return this.popupMenu; +}); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JComponent); +this.enableEvents (8); +Clazz_superCall (this, javax.swing.JComponent, "setLocale", [javax.swing.JComponent.getDefaultLocale ()]); +}); +Clazz_defineMethod (c$, "updateUI", +function () { +}); +Clazz_defineMethod (c$, "setUI", +function (newUI) { +this.uninstallUIAndProperties (); +this.ui = newUI; +if (this.ui != null) { +this.ui.installUI (this); +}this.revalidate (); +this.repaint (); +}, "javax.swing.plaf.ComponentUI"); +Clazz_defineMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_defineMethod (c$, "uninstallUIAndProperties", + function () { +if (this.ui != null) { +this.ui.uninstallUI (this); +}}); +Clazz_defineMethod (c$, "getUIClassID", +function () { +return "ComponentUI"; +}); +Clazz_defineMethod (c$, "getComponentGraphics", +function (g) { +var componentGraphics = g; +componentGraphics.setColor (this.getForeground ()); +componentGraphics.setFont (this.getFont ()); +return componentGraphics; +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintComponent", +function (g) { +if (this.ui != null) { +var scratchGraphics = (g == null) ? null : g.createSwingJS (); +try { +this.ui.update (scratchGraphics, this); +} finally { +scratchGraphics.dispose (); +} +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintChildren", +function (g) { +var isJComponent; +var sg = g; +{ +var i = this.getComponentCount () - 1; +if (i < 0) { +return; +}if (this.paintingChild != null && (Clazz_instanceOf (this.paintingChild, javax.swing.JComponent))) { +for (; i >= 0; i--) { +if (this.getComponent (i) === this.paintingChild) { +break; +}} +}var tmpRect = javax.swing.JComponent.fetchRectangle (); +for (; i >= 0; i--) { +var comp = this.getComponent (i); +isJComponent = (Clazz_instanceOf (comp, javax.swing.JComponent)); +if (comp != null && (isJComponent || javax.swing.JComponent.isLightweightComponent (comp)) && (comp.isVisible () == true)) { +var cr = comp.getBounds (tmpRect); +var cg = sg.create4 (cr.x, cr.y, cr.width, cr.height); +cg.setColor (comp.getForeground ()); +cg.setFont (comp.getFont ()); +var shouldSetFlagBack = false; +try { +if (isJComponent) { +(comp).paint (cg); +} else { +comp.paint (cg); +}} finally { +cg.dispose (); +if (shouldSetFlagBack) { +(comp).setFlag (1, false); +(comp).setFlag (2, false); +}} +}} +javax.swing.JComponent.recycleRectangle (tmpRect); +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintBorder", +function (g) { +var border = this.getBorder (); +if (border != null) { +border.paintBorder (this, g, 0, 0, this.getWidth (), this.getHeight ()); +}}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "paint", +function (g) { +var shouldClearPaintFlags = false; +if ((this.getWidth () <= 0) || (this.getHeight () <= 0)) { +return; +}var componentGraphics = this.getComponentGraphics (g); +var co = componentGraphics.createSwingJS (); +try { +if (this.getParent () != null && !(Clazz_instanceOf (this.getParent (), javax.swing.JComponent))) { +this.adjustPaintFlags (); +shouldClearPaintFlags = true; +}this.paintComponent (co); +this.paintBorder (co); +this.paintChildren (co); +} finally { +co.dispose (); +if (shouldClearPaintFlags) { +this.setFlag (1, false); +this.setFlag (2, false); +this.setFlag (11, false); +this.setFlag (12, false); +}} +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintForceDoubleBuffered", +function (g) { +var rm = javax.swing.RepaintManager.currentManager (this); +var clip = g.getClipBounds (); +rm.beginPaint (); +this.setFlag (13, true); +try { +rm.paint (this, this, g, clip.x, clip.y, clip.width, clip.height); +} finally { +rm.endPaint (); +this.setFlag (13, false); +} +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "isPainting", +function () { +var component = this; +while (component != null) { +if (Clazz_instanceOf (component, javax.swing.JComponent) && (component).getFlag (1)) { +return true; +}component = component.getParent (); +} +return false; +}); +Clazz_defineMethod (c$, "adjustPaintFlags", + function () { +var jparent = null; +var parent; +for (parent = this.getParent (); parent != null; parent = parent.getParent ()) { +if (Clazz_instanceOf (parent, javax.swing.JComponent)) { +jparent = parent; +if (jparent.getFlag (1)) this.setFlag (1, true); +if (jparent.getFlag (2)) this.setFlag (2, true); +if (jparent.getFlag (11)) this.setFlag (11, true); +if (jparent.getFlag (12)) this.setFlag (12, true); +break; +}} +}); +Clazz_overrideMethod (c$, "printAll", +function (g) { +this.setFlag (12, true); +try { +this.print (g); +} finally { +this.setFlag (12, false); +} +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "print", +function (g) { +this.setFlag (11, true); +this.firePropertyChangeBool ("paintingForPrint", false, true); +try { +this.paint (g); +} finally { +this.setFlag (11, false); +this.firePropertyChangeBool ("paintingForPrint", true, false); +} +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "printComponent", +function (g) { +this.paintComponent (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "printChildren", +function (g) { +this.paintChildren (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "printBorder", +function (g) { +this.paintBorder (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "isPaintingTile", +function () { +return this.getFlag (2); +}); +Clazz_defineMethod (c$, "isPaintingForPrint", +function () { +return this.getFlag (11); +}); +Clazz_defineMethod (c$, "isManagingFocus", +function () { +return false; +}); +Clazz_defineMethod (c$, "registerNextFocusableComponent", + function () { +this.registerNextFocusableComponent (this.getNextFocusableComponent ()); +}); +Clazz_defineMethod (c$, "registerNextFocusableComponent", + function (nextFocusableComponent) { +if (nextFocusableComponent == null) { +return; +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "deregisterNextFocusableComponent", + function () { +var nextFocusableComponent = this.getNextFocusableComponent (); +if (nextFocusableComponent == null) { +return; +}var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor (); +if (nearestRoot == null) { +return; +}}); +Clazz_defineMethod (c$, "setNextFocusableComponent", +function (aComponent) { +var displayable = this.isDisplayable (); +if (displayable) { +this.deregisterNextFocusableComponent (); +}this.putClientProperty ("nextFocus", aComponent); +if (displayable) { +this.registerNextFocusableComponent (aComponent); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "getNextFocusableComponent", +function () { +return this.getClientProperty ("nextFocus"); +}); +Clazz_defineMethod (c$, "setRequestFocusEnabled", +function (requestFocusEnabled) { +this.setFlag (22, !requestFocusEnabled); +}, "~B"); +Clazz_defineMethod (c$, "isRequestFocusEnabled", +function () { +return !this.getFlag (22); +}); +Clazz_defineMethod (c$, "requestFocus", +function (temporary) { +Clazz_superCall (this, javax.swing.JComponent, "requestFocus", []); +return true; +}, "~B"); +Clazz_defineMethod (c$, "requestFocusInWindow", +function (temporary) { +return Clazz_superCall (this, javax.swing.JComponent, "requestFocusInWindow", []); +}, "~B"); +Clazz_defineMethod (c$, "grabFocus", +function () { +this.requestFocus (); +}); +Clazz_defineMethod (c$, "setVerifyInputWhenFocusTarget", +function (verifyInputWhenFocusTarget) { +var oldVerifyInputWhenFocusTarget = this.verifyInputWhenFocusTarget; +this.verifyInputWhenFocusTarget = verifyInputWhenFocusTarget; +this.firePropertyChangeBool ("verifyInputWhenFocusTarget", oldVerifyInputWhenFocusTarget, verifyInputWhenFocusTarget); +}, "~B"); +Clazz_defineMethod (c$, "getVerifyInputWhenFocusTarget", +function () { +return this.verifyInputWhenFocusTarget; +}); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +return jssun.font.FontDesignMetrics.getMetrics (font); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "getPreferredSize", +function () { +return this.getPrefSizeJComp (); +}); +Clazz_defineMethod (c$, "getPrefSizeJComp", +function () { +var size = (this.isPreferredSizeSet () || this.ui == null ? null : this.ui.getPreferredSize (this)); +return (size == null ? this.preferredSize () : size); +}); +Clazz_defineMethod (c$, "getMaximumSize", +function () { +if (this.isMaximumSizeSet ()) { +return Clazz_superCall (this, javax.swing.JComponent, "getMaximumSize", []); +}var size = null; +if (this.ui != null) { +size = this.ui.getMaximumSize (this); +}return (size != null) ? size : Clazz_superCall (this, javax.swing.JComponent, "getMaximumSize", []); +}); +Clazz_defineMethod (c$, "getMinimumSize", +function () { +if (this.isMinimumSizeSet ()) { +return Clazz_superCall (this, javax.swing.JComponent, "getMinimumSize", []); +}var size = null; +if (this.ui != null) { +size = this.ui.getMinimumSize (this); +}return (size != null) ? size : Clazz_superCall (this, javax.swing.JComponent, "getMinimumSize", []); +}); +Clazz_overrideMethod (c$, "contains", +function (x, y) { +return (this.ui != null) ? this.ui.contains (this, x, y) : this.inside (x, y); +}, "~N,~N"); +Clazz_defineMethod (c$, "setBorder", +function (border) { +var oldBorder = this.border; +this.border = border; +this.firePropertyChangeObject ("border", oldBorder, border); +if (border !== oldBorder) { +if (border == null || oldBorder == null || !(border.getBorderInsets (this).equals (oldBorder.getBorderInsets (this)))) { +this.revalidate (); +}this.repaint (); +}}, "javax.swing.border.Border"); +Clazz_defineMethod (c$, "getBorder", +function () { +return this.border; +}); +Clazz_defineMethod (c$, "getInsets", +function () { +if (this.border != null) { +return this.border.getBorderInsets (this); +}return Clazz_superCall (this, javax.swing.JComponent, "getInsets", []); +}); +Clazz_defineMethod (c$, "getInsets", +function (insets) { +if (insets == null) { +insets = new java.awt.Insets (0, 0, 0, 0); +}if (this.border != null) { +if (Clazz_instanceOf (this.border, javax.swing.border.AbstractBorder)) { +return (this.border).getBorderInsets (this, insets); +} else { +return this.border.getBorderInsets (this); +}} else { +insets.left = insets.top = insets.right = insets.bottom = 0; +return insets; +}}, "java.awt.Insets"); +Clazz_defineMethod (c$, "getAlignmentY", +function () { +if (this.isAlignmentYSet) { +return this.alignmentY; +}return Clazz_superCall (this, javax.swing.JComponent, "getAlignmentY", []); +}); +Clazz_defineMethod (c$, "setAlignmentY", +function (alignmentY) { +this.alignmentY = alignmentY > 1.0 ? 1.0 : alignmentY < 0.0 ? 0.0 : alignmentY; +this.isAlignmentYSet = true; +}, "~N"); +Clazz_defineMethod (c$, "getAlignmentX", +function () { +if (this.isAlignmentXSet) { +return this.alignmentX; +}return Clazz_superCall (this, javax.swing.JComponent, "getAlignmentX", []); +}); +Clazz_defineMethod (c$, "setAlignmentX", +function (alignmentX) { +this.alignmentX = alignmentX > 1.0 ? 1.0 : alignmentX < 0.0 ? 0.0 : alignmentX; +this.isAlignmentXSet = true; +}, "~N"); +Clazz_defineMethod (c$, "setInputVerifier", +function (inputVerifier) { +var oldInputVerifier = this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER); +this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER, inputVerifier); +this.firePropertyChangeObject ("inputVerifier", oldInputVerifier, inputVerifier); +}, "javax.swing.InputVerifier"); +Clazz_defineMethod (c$, "getInputVerifier", +function () { +return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_INPUT_VERIFIER); +}); +Clazz_defineMethod (c$, "registerKeyboardAction", +function (anAction, aCommand, aKeyStroke, aCondition) { +var inputMap = this.getInputMap (aCondition, true); +if (inputMap != null) { +var actionMap = this.getActionMap (true); +var action = Clazz_innerTypeInstance (javax.swing.JComponent.ActionStandin, this, null, anAction, aCommand); +inputMap.put (aKeyStroke, action); +if (actionMap != null) { +actionMap.put (action, action); +}}}, "java.awt.event.ActionListener,~S,javax.swing.KeyStroke,~N"); +Clazz_defineMethod (c$, "registerWithKeyboardManager", + function (onlyIfNew) { +var inputMap = this.getInputMap (2, false); +var strokes; +var registered = this.getClientProperty ("_WhenInFocusedWindow"); +if (inputMap != null) { +strokes = inputMap.allKeys (); +if (strokes != null) { +for (var counter = strokes.length - 1; counter >= 0; counter--) { +if (!onlyIfNew || registered == null || registered.get (strokes[counter]) == null) { +this.registerWithKeyboardManager (strokes[counter]); +}if (registered != null) { +registered.remove (strokes[counter]); +}} +}} else { +strokes = null; +}if (registered != null && registered.size () > 0) { +var keys = registered.keys (); +while (keys.hasMoreElements ()) { +var ks = keys.nextElement (); +this.unregisterWithKeyboardManager (ks); +} +registered.clear (); +}if (strokes != null && strokes.length > 0) { +if (registered == null) { +registered = new java.util.Hashtable (strokes.length); +this.putClientProperty ("_WhenInFocusedWindow", registered); +}for (var counter = strokes.length - 1; counter >= 0; counter--) { +registered.put (strokes[counter], strokes[counter]); +} +} else { +this.putClientProperty ("_WhenInFocusedWindow", null); +}}, "~B"); +Clazz_defineMethod (c$, "unregisterWithKeyboardManager", + function () { +var registered = this.getClientProperty ("_WhenInFocusedWindow"); +if (registered != null && registered.size () > 0) { +var keys = registered.keys (); +while (keys.hasMoreElements ()) { +var ks = keys.nextElement (); +this.unregisterWithKeyboardManager (ks); +} +}this.putClientProperty ("_WhenInFocusedWindow", null); +}); +Clazz_defineMethod (c$, "componentInputMapChanged", +function (inputMap) { +var km = this.getInputMap (2, false); +while (km !== inputMap && km != null) { +km = km.getParent (); +} +if (km != null) { +this.registerWithKeyboardManager (false); +}}, "javax.swing.ComponentInputMap"); +Clazz_defineMethod (c$, "registerWithKeyboardManager", + function (aKeyStroke) { +javax.swing.KeyboardManager.getCurrentManager ().registerKeyStroke (aKeyStroke, this); +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "unregisterWithKeyboardManager", + function (aKeyStroke) { +javax.swing.KeyboardManager.getCurrentManager ().unregisterKeyStroke (aKeyStroke, this); +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "registerKeyboardAction", +function (anAction, aKeyStroke, aCondition) { +this.registerKeyboardAction (anAction, null, aKeyStroke, aCondition); +}, "java.awt.event.ActionListener,javax.swing.KeyStroke,~N"); +Clazz_defineMethod (c$, "unregisterKeyboardAction", +function (aKeyStroke) { +var am = this.getActionMap (false); +for (var counter = 0; counter < 3; counter++) { +var km = this.getInputMap (counter, false); +if (km != null) { +var actionID = km.get (aKeyStroke); +if (am != null && actionID != null) { +am.remove (actionID); +}km.remove (aKeyStroke); +}} +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "getRegisteredKeyStrokes", +function () { +var counts = Clazz_newIntArray (3, 0); +var strokes = new Array (3); +for (var counter = 0; counter < 3; counter++) { +var km = this.getInputMap (counter, false); +strokes[counter] = (km != null) ? km.allKeys () : null; +counts[counter] = (strokes[counter] != null) ? strokes[counter].length : 0; +} +var retValue = new Array (counts[0] + counts[1] + counts[2]); +for (var counter = 0, last = 0; counter < 3; counter++) { +if (counts[counter] > 0) { +System.arraycopy (strokes[counter], 0, retValue, last, counts[counter]); +last += counts[counter]; +}} +return retValue; +}); +Clazz_defineMethod (c$, "getConditionForKeyStroke", +function (aKeyStroke) { +for (var counter = 0; counter < 3; counter++) { +var inputMap = this.getInputMap (counter, false); +if (inputMap != null && inputMap.get (aKeyStroke) != null) { +return counter; +}} +return -1; +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "getActionForKeyStroke", +function (aKeyStroke) { +var am = this.getActionMap (false); +if (am == null) { +return null; +}for (var counter = 0; counter < 3; counter++) { +var inputMap = this.getInputMap (counter, false); +if (inputMap != null) { +var actionBinding = inputMap.get (aKeyStroke); +if (actionBinding != null) { +var action = am.get (actionBinding); +if (Clazz_instanceOf (action, javax.swing.JComponent.ActionStandin)) { +return (action).actionListener; +}return action; +}}} +return null; +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "resetKeyboardActions", +function () { +for (var counter = 0; counter < 3; counter++) { +var inputMap = this.getInputMap (counter, false); +if (inputMap != null) { +inputMap.clear (); +}} +var am = this.getActionMap (false); +if (am != null) { +am.clear (); +}}); +Clazz_defineMethod (c$, "setInputMap", +function (condition, map) { +switch (condition) { +case 2: +if (map != null && !(Clazz_instanceOf (map, javax.swing.ComponentInputMap))) { +throw new IllegalArgumentException ("WHEN_IN_FOCUSED_WINDOW InputMaps must be of type ComponentInputMap"); +}this.windowInputMap = map; +this.setFlag (7, true); +this.registerWithKeyboardManager (false); +break; +case 1: +this.ancestorInputMap = map; +this.setFlag (6, true); +break; +case 0: +this.focusInputMap = map; +this.setFlag (5, true); +break; +default: +throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"); +} +}, "~N,javax.swing.InputMap"); +Clazz_defineMethod (c$, "getInputMap", +function (condition) { +return this.getInputMap (condition, true); +}, "~N"); +Clazz_defineMethod (c$, "getInputMap", +function () { +return this.getInputMap (0, true); +}); +Clazz_defineMethod (c$, "setActionMap", +function (am) { +this.actionMap = am; +this.setFlag (8, true); +}, "javax.swing.ActionMap"); +Clazz_defineMethod (c$, "getActionMap", +function () { +return this.getActionMap (true); +}); +Clazz_defineMethod (c$, "getInputMap", +function (condition, create) { +switch (condition) { +case 0: +if (this.getFlag (5)) { +return this.focusInputMap; +}if (create) { +var km = new javax.swing.InputMap (); +this.setInputMap (condition, km); +return km; +}break; +case 1: +if (this.getFlag (6)) { +return this.ancestorInputMap; +}if (create) { +var km = new javax.swing.InputMap (); +this.setInputMap (condition, km); +return km; +}break; +case 2: +if (this.getFlag (7)) { +return this.windowInputMap; +}if (create) { +var km = new javax.swing.ComponentInputMap (this); +this.setInputMap (condition, km); +return km; +}break; +default: +throw new IllegalArgumentException ("condition must be one of JComponent.WHEN_IN_FOCUSED_WINDOW, JComponent.WHEN_FOCUSED or JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT"); +} +return null; +}, "~N,~B"); +Clazz_defineMethod (c$, "getActionMap", +function (create) { +{ +(arguments.length == 0) && (create = true); +}if (this.getFlag (8)) { +return this.actionMap; +}if (create) { +var am = new javax.swing.ActionMap (); +this.setActionMap (am); +return am; +}return null; +}, "~B"); +Clazz_defineMethod (c$, "getBaseline", +function (width, height) { +Clazz_superCall (this, javax.swing.JComponent, "getBaseline", [width, height]); +if (this.ui != null) { +return this.ui.getBaseline (this, width, height); +}return -1; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getBaselineResizeBehavior", +function () { +if (this.ui != null) { +return this.ui.getBaselineResizeBehavior (this); +}return java.awt.Component.BaselineResizeBehavior.OTHER; +}); +Clazz_defineMethod (c$, "requestDefaultFocus", +function () { +var nearestRoot = (this.isFocusCycleRoot ()) ? this : this.getFocusCycleRootAncestor (); +if (nearestRoot == null) { +return false; +}return false; +}); +Clazz_defineMethod (c$, "setVisible", +function (aFlag) { +if (aFlag != this.isVisible ()) { +Clazz_superCall (this, javax.swing.JComponent, "setVisible", [aFlag]); +var parent = this.getParent (); +if (parent != null) { +var r = this.getBounds (); +parent.repaint (r.x, r.y, r.width, r.height); +}this.revalidate (); +}}, "~B"); +Clazz_defineMethod (c$, "setEnabled", +function (enabled) { +var oldEnabled = this.isEnabled (); +Clazz_superCall (this, javax.swing.JComponent, "setEnabled", [enabled]); +this.firePropertyChangeBool ("enabled", oldEnabled, enabled); +if (enabled != oldEnabled) { +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "setForeground", +function (fg) { +var oldFg = this.getForeground (); +Clazz_superCall (this, javax.swing.JComponent, "setForeground", [fg]); +if ((oldFg != null) ? !oldFg.equals (fg) : ((fg != null) && !fg.equals (oldFg))) { +this.repaint (); +}}, "java.awt.Color"); +Clazz_defineMethod (c$, "setBackground", +function (bg) { +var oldBg = this.getBackground (); +Clazz_superCall (this, javax.swing.JComponent, "setBackground", [bg]); +if ((oldBg != null) ? !oldBg.equals (bg) : ((bg != null) && !bg.equals (oldBg))) { +this.repaint (); +}}, "java.awt.Color"); +Clazz_defineMethod (c$, "setFont", +function (font) { +var oldFont = this.getFont (); +Clazz_superCall (this, javax.swing.JComponent, "setFont", [font]); +if (font !== oldFont) { +this.revalidate (); +this.repaint (); +}}, "java.awt.Font"); +c$.getDefaultLocale = Clazz_defineMethod (c$, "getDefaultLocale", +function () { +var l = javax.swing.SwingUtilities.appContextGet ("JComponent.defaultLocale"); +if (l == null) { +l = java.util.Locale.getDefault (); +javax.swing.JComponent.setDefaultLocale (l); +}return l; +}); +c$.setDefaultLocale = Clazz_defineMethod (c$, "setDefaultLocale", +function (l) { +javax.swing.SwingUtilities.appContextPut ("JComponent.defaultLocale", l); +}, "java.util.Locale"); +Clazz_defineMethod (c$, "processComponentKeyEvent", +function (e) { +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "processKeyEvent", +function (e) { +var shouldProcessKey; +Clazz_superCall (this, javax.swing.JComponent, "processKeyEvent", [e]); +if (!e.isConsumed ()) { +this.processComponentKeyEvent (e); +}shouldProcessKey = javax.swing.JComponent.KeyboardState.shouldProcess (e); +if (e.isConsumed ()) { +return; +}if (shouldProcessKey && this.processKeyBindings (e, e.getID () == 401)) { +e.consume (); +}}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "processKeyBinding", +function (ks, e, condition, pressed) { +var map = this.getInputMap (condition, false); +var am = this.getActionMap (false); +if (map != null && am != null && this.isEnabled ()) { +var binding = map.get (ks); +var action = (binding == null) ? null : am.get (binding); +if (action != null) { +return javax.swing.SwingUtilities.notifyAction (action, ks, e, this, e.getModifiers ()); +}}return false; +}, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B"); +Clazz_defineMethod (c$, "processKeyBindings", +function (e, pressed) { +if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (e)) { +return false; +}var ks; +if (e.getID () == 400) { +ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ()); +} else { +ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), (pressed ? false : true)); +}if (this.processKeyBinding (ks, e, 0, pressed)) return true; +var parent = this; +while (parent != null && !(Clazz_instanceOf (parent, java.awt.Window)) && !(Clazz_instanceOf (parent, java.applet.Applet))) { +if (Clazz_instanceOf (parent, javax.swing.JComponent)) { +if ((parent).processKeyBinding (ks, e, 1, pressed)) return true; +}parent = parent.getParent (); +} +if (parent != null) { +return javax.swing.JComponent.processKeyBindingsForAllComponents (e, parent, pressed); +}return false; +}, "java.awt.event.KeyEvent,~B"); +c$.processKeyBindingsForAllComponents = Clazz_defineMethod (c$, "processKeyBindingsForAllComponents", +function (e, container, pressed) { +while (true) { +if (javax.swing.KeyboardManager.getCurrentManager ().fireKeyboardAction (e, pressed, container)) { +return true; +}if (Clazz_instanceOf (container, javax.swing.Popup.HeavyWeightWindow)) { +container = (container).getOwner (); +} else { +return false; +}} +}, "java.awt.event.KeyEvent,java.awt.Container,~B"); +Clazz_defineMethod (c$, "setToolTipText", +function (text) { +this.putClientProperty ("ToolTipText", text); +}, "~S"); +Clazz_defineMethod (c$, "getToolTipText", +function () { +return this.getClientProperty ("ToolTipText"); +}); +Clazz_defineMethod (c$, "getToolTipText", +function (event) { +return this.getToolTipText (); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "getToolTipLocation", +function (event) { +return null; +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "getPopupLocation", +function (event) { +return null; +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "createToolTip", +function () { +var tip = new javax.swing.JToolTip (); +tip.setComponent (this); +return tip; +}); +Clazz_defineMethod (c$, "scrollRectToVisible", +function (aRect) { +var parent; +var dx = this.getX (); +var dy = this.getY (); +for (parent = this.getParent (); !(parent == null) && !(Clazz_instanceOf (parent, javax.swing.JComponent)) && !(Clazz_instanceOf (parent, javax.swing.CellRendererPane)); parent = parent.getParent ()) { +var bounds = parent.getBounds (); +dx += bounds.x; +dy += bounds.y; +} +if (!(parent == null) && !(Clazz_instanceOf (parent, javax.swing.CellRendererPane))) { +aRect.x += dx; +aRect.y += dy; +(parent).scrollRectToVisible (aRect); +aRect.x -= dx; +aRect.y -= dy; +}}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "setAutoscrolls", +function (autoscrolls) { +}, "~B"); +Clazz_defineMethod (c$, "getAutoscrolls", +function () { +return this.autoscrolls; +}); +Clazz_defineMethod (c$, "superProcessMouseMotionEvent", +function (e) { +Clazz_superCall (this, javax.swing.JComponent, "processMouseMotionEvent", [e]); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "setCreatedDoubleBuffer", +function (newValue) { +this.setFlag (9, newValue); +}, "~B"); +Clazz_defineMethod (c$, "getCreatedDoubleBuffer", +function () { +return this.getFlag (9); +}); +Clazz_defineMethod (c$, "getClientProperties", + function () { +if (this.clientProperties == null) { +this.clientProperties = new javax.swing.ArrayTable (); +}return this.clientProperties; +}); +Clazz_defineMethod (c$, "getClientProperty", +function (key) { +if (this.clientProperties == null) { +return null; +} else { +{ +return this.clientProperties.get (key); +}}}, "~O"); +Clazz_defineMethod (c$, "putClientProperty", +function (key, value) { +if (value == null && this.clientProperties == null) { +return; +}var clientProperties = this.getClientProperties (); +var oldValue; +{ +oldValue = clientProperties.get (key); +if (value != null) { +clientProperties.put (key, value); +} else if (oldValue != null) { +clientProperties.remove (key); +} else { +return; +}}this.clientPropertyChanged (key, oldValue, value); +this.firePropertyChangeObject (key.toString (), oldValue, value); +}, "~O,~O"); +Clazz_defineMethod (c$, "clientPropertyChanged", +function (key, oldValue, newValue) { +}, "~O,~O,~O"); +Clazz_defineMethod (c$, "setUIProperty", +function (propertyName, value) { +if (propertyName === "opaque") { +if (!this.getFlag (24)) { +this.setOpaque ((value).booleanValue ()); +this.setFlag (24, false); +}} else if (propertyName === "autoscrolls") { +if (!this.getFlag (25)) { +this.setAutoscrolls ((value).booleanValue ()); +this.setFlag (25, false); +}} else if (propertyName === "focusTraversalKeysForward") { +} else if (propertyName === "focusTraversalKeysBackward") { +} else { +System.out.println (swingjs.JSToolkit.getClassName (this) + " property \"" + propertyName + "\" cannot be set using this method" + swingjs.JSToolkit.getStackTrace (5)); +}}, "~S,~O"); +c$.isLightweightComponent = Clazz_defineMethod (c$, "isLightweightComponent", +function (c) { +return !(Clazz_instanceOf (c, javax.swing.JApplet) || Clazz_instanceOf (c, javax.swing.JFrame) || Clazz_instanceOf (c, javax.swing.JWindow) || Clazz_instanceOf (c, javax.swing.JDialog)); +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "isOpaque", +function () { +return this.getFlag (3); +}); +Clazz_defineMethod (c$, "setOpaque", +function (isOpaque) { +var oldValue = this.getFlag (3); +this.setFlag (3, isOpaque); +this.setFlag (24, true); +this.firePropertyChangeBool ("opaque", oldValue, isOpaque); +}, "~B"); +Clazz_defineMethod (c$, "rectangleIsObscured", +function (x, y, width, height) { +var numChildren = this.getComponentCount (); +for (var i = 0; i < numChildren; i++) { +var child = this.getComponent (i); +var cx; +var cy; +var cw; +var ch; +cx = child.getX (); +cy = child.getY (); +cw = child.getWidth (); +ch = child.getHeight (); +if (x >= cx && (x + width) <= (cx + cw) && y >= cy && (y + height) <= (cy + ch) && child.isVisible ()) { +if (Clazz_instanceOf (child, javax.swing.JComponent)) { +return (child).isOpaque (); +} else { +return false; +}}} +return false; +}, "~N,~N,~N,~N"); +c$.computeVisibleRect = Clazz_defineMethod (c$, "computeVisibleRect", +function (c, visibleRect) { +var p = c.getParent (); +var bounds = c.getBounds (); +if (p == null || Clazz_instanceOf (p, java.awt.Window) || Clazz_instanceOf (p, java.applet.Applet)) { +visibleRect.reshape (0, 0, bounds.width, bounds.height); +} else { +javax.swing.JComponent.computeVisibleRect (p, visibleRect); +visibleRect.x -= bounds.x; +visibleRect.y -= bounds.y; +javax.swing.SwingUtilities.computeIntersection (0, 0, bounds.width, bounds.height, visibleRect); +}}, "java.awt.Component,java.awt.Rectangle"); +Clazz_defineMethod (c$, "computeVisibleRect", +function (visibleRect) { +javax.swing.JComponent.computeVisibleRect (this, visibleRect); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "getVisibleRect", +function () { +var visibleRect = new java.awt.Rectangle (); +this.computeVisibleRect (visibleRect); +return visibleRect; +}); +Clazz_defineMethod (c$, "getTopLevelAncestor", +function () { +for (var p = this; p != null; p = p.getParent ()) { +if (Clazz_instanceOf (p, java.awt.Window) || Clazz_instanceOf (p, java.applet.Applet)) { +return p; +}} +return null; +}); +Clazz_defineMethod (c$, "getAncestorNotifier", + function () { +return this.getClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER); +}); +Clazz_defineMethod (c$, "addAncestorListener", +function (listener) { +var ancestorNotifier = this.getAncestorNotifier (); +if (ancestorNotifier == null) { +ancestorNotifier = new javax.swing.AncestorNotifier (this); +this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, ancestorNotifier); +}ancestorNotifier.addAncestorListener (listener); +}, "javax.swing.event.AncestorListener"); +Clazz_defineMethod (c$, "removeAncestorListener", +function (listener) { +var ancestorNotifier = this.getAncestorNotifier (); +if (ancestorNotifier == null) { +return; +}ancestorNotifier.removeAncestorListener (listener); +if (ancestorNotifier.listenerList.getListenerList ().length == 0) { +ancestorNotifier.removeAllListeners (); +this.putClientProperty (javax.swing.ClientPropertyKey.JComponent_ANCESTOR_NOTIFIER, null); +}}, "javax.swing.event.AncestorListener"); +Clazz_defineMethod (c$, "getAncestorListeners", +function () { +var ancestorNotifier = this.getAncestorNotifier (); +if (ancestorNotifier == null) { +return new Array (0); +}return ancestorNotifier.getAncestorListeners (); +}); +Clazz_defineMethod (c$, "getListeners", +function (listenerType) { +var result; +if (listenerType === javax.swing.event.AncestorListener) { +result = this.getAncestorListeners (); +} else if (listenerType === java.beans.PropertyChangeListener) { +result = this.getPropertyChangeListeners (); +} else { +result = this.listenerList.getListeners (listenerType); +}if (result.length == 0) { +return Clazz_superCall (this, javax.swing.JComponent, "getListeners", [listenerType]); +}return result; +}, "Class"); +Clazz_defineMethod (c$, "addNotify", +function () { +Clazz_superCall (this, javax.swing.JComponent, "addNotify", []); +this.firePropertyChangeObject ("ancestor", null, this.getParent ()); +this.registerWithKeyboardManager (false); +this.registerNextFocusableComponent (); +}); +Clazz_defineMethod (c$, "removeNotify", +function () { +Clazz_superCall (this, javax.swing.JComponent, "removeNotify", []); +this.firePropertyChangeObject ("ancestor", this.getParent (), null); +this.unregisterWithKeyboardManager (); +this.deregisterNextFocusableComponent (); +if (this.getCreatedDoubleBuffer ()) { +javax.swing.RepaintManager.currentManager (this).resetDoubleBuffer (); +this.setCreatedDoubleBuffer (false); +}}); +Clazz_defineMethod (c$, "repaint", +function (tm, x, y, width, height) { +javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "repaint", +function (r) { +this.repaint (0, r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "revalidate", +function () { +if (this.getParent () == null) { +return; +}if (javax.swing.SwingUtilities.isEventDispatchThread ()) { +this.invalidate (); +javax.swing.RepaintManager.currentManager (this).addInvalidComponent (this); +} else { +{ +if (this.getFlag (28)) { +return; +}this.setFlag (28, true); +}var callRevalidate = ((Clazz_isClassDefined ("javax.swing.JComponent$2") ? 0 : javax.swing.JComponent.$JComponent$2$ ()), Clazz_innerTypeInstance (javax.swing.JComponent$2, this, null)); +javax.swing.SwingUtilities.invokeLater (callRevalidate); +}}); +Clazz_defineMethod (c$, "isValidateRoot", +function () { +return false; +}); +Clazz_defineMethod (c$, "isOptimizedDrawingEnabled", +function () { +return true; +}); +Clazz_defineMethod (c$, "isPaintingOrigin", +function () { +return false; +}); +Clazz_defineMethod (c$, "paintImmediately", +function (x, y, w, h) { +{ +if (arguments.length == 1) { +var r = x; +x = r.x; +y = r.y; +w = r.width; +h = r.height; +} +}var c = this; +var parent; +if (!this.isShowing ()) { +return; +}while (!(c).isOpaque ()) { +parent = c.getParent (); +if (parent != null) { +x += c.getX (); +y += c.getY (); +c = parent; +} else { +break; +}if (!(Clazz_instanceOf (c, javax.swing.JComponent))) { +break; +}} +if (Clazz_instanceOf (c, javax.swing.JComponent)) { +(c)._paintImmediately (x, y, w, h); +} else { +c.repaint (x, y, w, h); +}}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paintImmediately", +function (r) { +this.paintImmediately (r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "alwaysOnTop", +function () { +return false; +}); +Clazz_defineMethod (c$, "setPaintingChild", +function (paintingChild) { +this.paintingChild = paintingChild; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "_paintImmediately", +function (x, y, w, h) { +var g; +var c; +var tmpX; +var tmpY; +var tmpWidth; +var tmpHeight; +var offsetX = 0; +var offsetY = 0; +var hasBuffer = false; +var bufferedComponent = null; +var paintingComponent = this; +var path = new java.util.ArrayList (7); +var pIndex = -1; +var pCount = 0; +tmpX = tmpY = tmpWidth = tmpHeight = 0; +var paintImmediatelyClip = javax.swing.JComponent.fetchRectangle (); +paintImmediatelyClip.x = x; +paintImmediatelyClip.y = y; +paintImmediatelyClip.width = w; +paintImmediatelyClip.height = h; +var ontop = this.alwaysOnTop () && this.isOpaque (); +if (ontop) { +javax.swing.SwingUtilities.computeIntersection (0, 0, this.getWidth (), this.getHeight (), paintImmediatelyClip); +if (paintImmediatelyClip.width == 0) { +javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); +return; +}}var child; +for (c = this, child = null; c != null && !(Clazz_instanceOf (c, java.awt.Window)) && !(Clazz_instanceOf (c, java.applet.Applet)); child = c, c = c.getParent ()) { +var jc = (Clazz_instanceOf (c, javax.swing.JComponent)) ? c : null; +path.add (c); +if (!ontop && jc != null && !jc.isOptimizedDrawingEnabled ()) { +var resetPC; +if (c !== this) { +if (jc.isPaintingOrigin ()) { +resetPC = true; +} else { +var children = c.getComponents (); +var i = 0; +for (; i < children.length; i++) { +if (children[i] === child) break; +} +switch (jc.getObscuredState (i, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height)) { +case 0: +resetPC = false; +break; +case 2: +javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); +return; +default: +resetPC = true; +break; +} +}} else { +resetPC = false; +}if (resetPC) { +paintingComponent = jc; +pIndex = pCount; +offsetX = offsetY = 0; +hasBuffer = false; +}}pCount++; +if (!ontop) { +var bx = c.getX (); +var by = c.getY (); +tmpWidth = c.getWidth (); +tmpHeight = c.getHeight (); +javax.swing.SwingUtilities.computeIntersection (tmpX, tmpY, tmpWidth, tmpHeight, paintImmediatelyClip); +paintImmediatelyClip.x += bx; +paintImmediatelyClip.y += by; +offsetX += bx; +offsetY += by; +}} +if (c == null || paintImmediatelyClip.width <= 0 || paintImmediatelyClip.height <= 0) { +javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); +return; +}paintingComponent.setFlag (13, true); +paintImmediatelyClip.x -= offsetX; +paintImmediatelyClip.y -= offsetY; +if (paintingComponent !== this) { +var comp; +var i = pIndex; +for (; i > 0; i--) { +comp = path.get (i); +if (Clazz_instanceOf (comp, javax.swing.JComponent)) { +(comp).setPaintingChild (path.get (i - 1)); +}} +}try { +g = javax.swing.JComponent.safelyGetGraphics (paintingComponent, c).createSwingJS (); +try { +if (hasBuffer) { +var rm = javax.swing.RepaintManager.currentManager (bufferedComponent); +rm.beginPaint (); +try { +rm.paint (paintingComponent, bufferedComponent, g, paintImmediatelyClip.x, paintImmediatelyClip.y, paintImmediatelyClip.width, paintImmediatelyClip.height); +} finally { +rm.endPaint (); +} +} else { +paintingComponent.paint (g); +}} finally { +g.dispose (); +} +} finally { +if (paintingComponent !== this) { +var comp; +var i = pIndex; +for (; i > 0; i--) { +comp = path.get (i); +if (Clazz_instanceOf (comp, javax.swing.JComponent)) { +(comp).setPaintingChild (null); +}} +}paintingComponent.setFlag (13, false); +} +javax.swing.JComponent.recycleRectangle (paintImmediatelyClip); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paintToOffscreen", +function (g, x, y, w, h, maxX, maxY) { +try { +this.setFlag (1, true); +if ((y + h) < maxY || (x + w) < maxX) { +this.setFlag (2, true); +}if (this.getFlag (13)) { +this.paint (g); +} else { +if (!this.rectangleIsObscured (x, y, w, h)) { +this.paintComponent (g); +this.paintBorder (g); +}this.paintChildren (g); +}} finally { +this.setFlag (1, false); +this.setFlag (2, false); +} +}, "java.awt.Graphics,~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getObscuredState", + function (compIndex, x, y, width, height) { +var retValue = 0; +var tmpRect = javax.swing.JComponent.fetchRectangle (); +for (var i = compIndex - 1; i >= 0; i--) { +var sibling = this.getComponent (i); +if (!sibling.isVisible ()) { +continue; +}var siblingRect; +var opaque; +if (Clazz_instanceOf (sibling, javax.swing.JComponent)) { +opaque = (sibling).isOpaque (); +if (!opaque) { +if (retValue == 1) { +continue; +}}} else { +opaque = true; +}siblingRect = sibling.getBounds (tmpRect); +if (opaque && x >= siblingRect.x && (x + width) <= (siblingRect.x + siblingRect.width) && y >= siblingRect.y && (y + height) <= (siblingRect.y + siblingRect.height)) { +javax.swing.JComponent.recycleRectangle (tmpRect); +return 2; +} else if (retValue == 0 && !((x + width <= siblingRect.x) || (y + height <= siblingRect.y) || (x >= siblingRect.x + siblingRect.width) || (y >= siblingRect.y + siblingRect.height))) { +retValue = 1; +}} +javax.swing.JComponent.recycleRectangle (tmpRect); +return retValue; +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "checkIfChildObscuredBySibling", +function () { +return true; +}); +Clazz_defineMethod (c$, "setFlag", + function (aFlag, aValue) { +if (aValue) { +this.flags |= (1 << aFlag); +} else { +this.flags &= ~(1 << aFlag); +}}, "~N,~B"); +Clazz_defineMethod (c$, "getFlag", + function (aFlag) { +var mask = (1 << aFlag); +return ((this.flags & mask) == mask); +}, "~N"); +Clazz_defineMethod (c$, "setDoubleBuffered", +function (aFlag) { +}, "~B"); +Clazz_overrideMethod (c$, "isDoubleBuffered", +function () { +return this.getFlag (0); +}); +Clazz_defineMethod (c$, "getRootPane", +function () { +return javax.swing.SwingUtilities.getRootPane (this); +}); +Clazz_defineMethod (c$, "paramString", +function () { +var preferredSizeString = (this.isPreferredSizeSet () ? this.getPreferredSize ().toString () : ""); +var minimumSizeString = (this.isMinimumSizeSet () ? this.getMinimumSize ().toString () : ""); +var maximumSizeString = (this.isMaximumSizeSet () ? this.getMaximumSize ().toString () : ""); +var borderString = (this.border == null ? "" : (this.border === this ? "this" : this.border.toString ())); +return Clazz_superCall (this, javax.swing.JComponent, "paramString", []) + ",alignmentX=" + this.alignmentX + ",alignmentY=" + this.alignmentY + ",border=" + borderString + ",flags=" + this.flags + ",maximumSize=" + maximumSizeString + ",minimumSize=" + minimumSizeString + ",preferredSize=" + preferredSizeString; +}); +c$.$JComponent$ActionStandin$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +this.actionListener = null; +this.command = null; +this.action = null; +Clazz_instantialize (this, arguments); +}, javax.swing.JComponent, "ActionStandin", null, javax.swing.Action); +Clazz_makeConstructor (c$, +function (a, b) { +this.actionListener = a; +if (Clazz_instanceOf (a, javax.swing.Action)) { +this.action = a; +} else { +this.action = null; +}this.command = b; +}, "java.awt.event.ActionListener,~S"); +Clazz_defineMethod (c$, "getValue", +function (a) { +if (a != null) { +if (a.equals ("ActionCommandKey")) { +return this.command; +}if (this.action != null) { +return this.action.getValue (a); +}if (a.equals ("Name")) { +return "ActionStandin"; +}}return null; +}, "~S"); +Clazz_defineMethod (c$, "isEnabled", +function () { +if (this.actionListener == null) { +return false; +}if (this.action == null) { +return true; +}return this.action.isEnabled (); +}); +Clazz_defineMethod (c$, "actionPerformed", +function (a) { +if (this.actionListener != null) { +this.actionListener.actionPerformed (a); +}}, "java.awt.event.ActionEvent"); +Clazz_overrideMethod (c$, "putValue", +function (a, b) { +}, "~S,~O"); +Clazz_overrideMethod (c$, "setEnabled", +function (a) { +}, "~B"); +Clazz_overrideMethod (c$, "addPropertyChangeListener", +function (a) { +}, "java.beans.PropertyChangeListener"); +Clazz_overrideMethod (c$, "removePropertyChangeListener", +function (a) { +}, "java.beans.PropertyChangeListener"); +c$ = Clazz_p0p (); +}; +c$.$JComponent$2$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing, "JComponent$2", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +{ +this.b$["javax.swing.JComponent"].setFlag (28, false); +}this.b$["javax.swing.JComponent"].revalidate (); +}); +c$ = Clazz_p0p (); +}; +c$.$JComponent$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing, "JComponent$1", null, jssun.awt.RequestFocusController); +Clazz_overrideMethod (c$, "acceptRequestFocus", +function (from, to, temporary, focusedWindowChangeAllowed, cause) { +if ((to == null) || !(Clazz_instanceOf (to, javax.swing.JComponent))) { +return true; +}if ((from == null) || !(Clazz_instanceOf (from, javax.swing.JComponent))) { +return true; +}var target = to; +if (!target.getVerifyInputWhenFocusTarget ()) { +return true; +}var jFocusOwner = from; +var iv = jFocusOwner.getInputVerifier (); +if (iv == null) { +return true; +} else { +var currentSource = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY); +if (currentSource === jFocusOwner) { +return true; +}javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, jFocusOwner); +try { +return iv.shouldYieldFocus (jFocusOwner); +} finally { +if (currentSource != null) { +javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY, currentSource); +} else { +javax.swing.SwingUtilities.appContextRemove (javax.swing.JComponent.INPUT_VERIFIER_SOURCE_KEY); +}} +}}, "java.awt.Component,java.awt.Component,~B,~B,jssun.awt.CausedFocusEvent.Cause"); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.array = null; +this.count = 0; +this.capacity = 0; +Clazz_instantialize (this, arguments); +}, javax.swing.JComponent, "IntVector"); +Clazz_defineMethod (c$, "size", +function () { +return this.count; +}); +Clazz_defineMethod (c$, "elementAt", +function (a) { +return this.array[a]; +}, "~N"); +Clazz_defineMethod (c$, "addElement", +function (a) { +if (this.count == this.capacity) { +this.capacity = (this.capacity + 2) * 2; +var b = Clazz_newIntArray (this.capacity, 0); +if (this.count > 0) { +System.arraycopy (this.array, 0, b, 0, this.count); +}this.array = b; +}this.array[this.count++] = a; +}, "~N"); +Clazz_defineMethod (c$, "setElementAt", +function (a, b) { +this.array[b] = a; +}, "~N,~N"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.JComponent, "KeyboardState"); +c$.getKeyCodeArray = Clazz_defineMethod (c$, "getKeyCodeArray", +function () { +var a = javax.swing.SwingUtilities.appContextGet (javax.swing.JComponent.KeyboardState.keyCodesKey); +if (a == null) { +a = new javax.swing.JComponent.IntVector (); +javax.swing.SwingUtilities.appContextPut (javax.swing.JComponent.KeyboardState.keyCodesKey, a); +}return a; +}); +c$.registerKeyPressed = Clazz_defineMethod (c$, "registerKeyPressed", +function (a) { +var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray (); +var c = b.size (); +var d; +for (d = 0; d < c; d++) { +if (b.elementAt (d) == -1) { +b.setElementAt (a, d); +return; +}} +b.addElement (a); +}, "~N"); +c$.registerKeyReleased = Clazz_defineMethod (c$, "registerKeyReleased", +function (a) { +var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray (); +var c = b.size (); +var d; +for (d = 0; d < c; d++) { +if (b.elementAt (d) == a) { +b.setElementAt (-1, d); +return; +}} +}, "~N"); +c$.keyIsPressed = Clazz_defineMethod (c$, "keyIsPressed", +function (a) { +var b = javax.swing.JComponent.KeyboardState.getKeyCodeArray (); +var c = b.size (); +var d; +for (d = 0; d < c; d++) { +if (b.elementAt (d) == a) { +return true; +}} +return false; +}, "~N"); +c$.shouldProcess = Clazz_defineMethod (c$, "shouldProcess", +function (a) { +switch (a.getID ()) { +case 401: +if (!javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ())) { +javax.swing.JComponent.KeyboardState.registerKeyPressed (a.getKeyCode ()); +}return true; +case 402: +if (javax.swing.JComponent.KeyboardState.keyIsPressed (a.getKeyCode ()) || a.getKeyCode () == 154) { +javax.swing.JComponent.KeyboardState.registerKeyReleased (a.getKeyCode ()); +return true; +}return false; +case 400: +return true; +default: +return false; +} +}, "java.awt.event.KeyEvent"); +c$.keyCodesKey = c$.prototype.keyCodesKey = javax.swing.JComponent.KeyboardState; +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"uiClassID", "ComponentUI", +"managingFocusForwardTraversalKeys", null, +"managingFocusBackwardTraversalKeys", null, +"NOT_OBSCURED", 0, +"PARTIALLY_OBSCURED", 1, +"COMPLETELY_OBSCURED", 2, +"DEBUG_GRAPHICS_LOADED", false); +c$.INPUT_VERIFIER_SOURCE_KEY = c$.prototype.INPUT_VERIFIER_SOURCE_KEY = new Clazz._O (); +Clazz_defineStatics (c$, +"WHEN_FOCUSED", 0, +"WHEN_ANCESTOR_OF_FOCUSED_COMPONENT", 1, +"WHEN_IN_FOCUSED_WINDOW", 2, +"UNDEFINED_CONDITION", -1, +"WHEN_IN_FOCUSED_WINDOW_BINDINGS", "_WhenInFocusedWindow", +"TOOL_TIP_TEXT_KEY", "ToolTipText", +"NEXT_FOCUS", "nextFocus", +"IS_DOUBLE_BUFFERED", 0, +"ANCESTOR_USING_BUFFER", 1, +"IS_PAINTING_TILE", 2, +"IS_OPAQUE", 3, +"FOCUS_INPUTMAP_CREATED", 5, +"ANCESTOR_INPUTMAP_CREATED", 6, +"WIF_INPUTMAP_CREATED", 7, +"ACTIONMAP_CREATED", 8, +"CREATED_DOUBLE_BUFFER", 9, +"IS_PRINTING", 11, +"IS_PRINTING_ALL", 12, +"IS_REPAINTING", 13, +"REQUEST_FOCUS_DISABLED", 22, +"INHERITS_POPUP_MENU", 23, +"OPAQUE_SET", 24, +"AUTOSCROLLS_SET", 25, +"REVALIDATE_RUNNABLE_SCHEDULED", 28); +c$.tempRectangles = c$.prototype.tempRectangles = new java.util.ArrayList (11); +Clazz_defineStatics (c$, +"defaultLocale", "JComponent.defaultLocale", +"componentObtainingGraphicsFrom", null); +c$.componentObtainingGraphicsFromLock = c$.prototype.componentObtainingGraphicsFromLock = new Clazz._O (); +c$.focusController = c$.prototype.focusController = ((Clazz_isClassDefined ("javax.swing.JComponent$1") ? 0 : javax.swing.JComponent.$JComponent$1$ ()), Clazz_innerTypeInstance (javax.swing.JComponent$1, this, null)); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.event.ActionListener"], "javax.swing.Action", null, function () { +c$ = Clazz_declareInterface (javax.swing, "Action", java.awt.event.ActionListener); +Clazz_defineStatics (c$, +"DEFAULT", "Default", +"NAME", "Name", +"SHORT_DESCRIPTION", "ShortDescription", +"LONG_DESCRIPTION", "LongDescription", +"SMALL_ICON", "SmallIcon", +"ACTION_COMMAND_KEY", "ActionCommandKey", +"ACCELERATOR_KEY", "AcceleratorKey", +"MNEMONIC_KEY", "MnemonicKey", +"SELECTED_KEY", "SwingSelectedKey", +"DISPLAYED_MNEMONIC_INDEX_KEY", "SwingDisplayedMnemonicIndexKey", +"LARGE_ICON_KEY", "SwingLargeIconKey"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Frame", "java.awt.event.WindowListener", "javax.swing.SwingConstants"], "javax.swing.SwingUtilities", ["java.lang.Character", "$.Error", "$.Thread", "java.applet.Applet", "java.awt.Component", "$.Container", "$.EventQueue", "$.Point", "$.Rectangle", "$.Window", "java.awt.event.ActionEvent", "$.MouseEvent", "$.MouseWheelEvent", "javax.swing.JComponent", "javax.swing.JComponent.ActionStandin", "javax.swing.JRootPane", "$.RootPaneContainer", "javax.swing.event.MenuDragMouseEvent", "javax.swing.plaf.UIResource", "jssun.awt.AppContext", "jssun.swing.UIAction", "swingjs.api.Interface"], function () { +c$ = Clazz_declareType (javax.swing, "SwingUtilities", null, javax.swing.SwingConstants); +c$.installSwingDropTargetAsNecessary = Clazz_defineMethod (c$, "installSwingDropTargetAsNecessary", +function (c, t) { +}, "java.awt.Component,javax.swing.TransferHandler"); +c$.isRectangleContainingRectangle = Clazz_defineMethod (c$, "isRectangleContainingRectangle", +function (a, b) { +if (b.x >= a.x && (b.x + b.width) <= (a.x + a.width) && b.y >= a.y && (b.y + b.height) <= (a.y + a.height)) { +return true; +}return false; +}, "java.awt.Rectangle,java.awt.Rectangle"); +c$.getLocalBounds = Clazz_defineMethod (c$, "getLocalBounds", +function (aComponent) { +var b = new java.awt.Rectangle (aComponent.getBounds ()); +b.x = b.y = 0; +return b; +}, "java.awt.Component"); +c$.getWindowAncestor = Clazz_defineMethod (c$, "getWindowAncestor", +function (c) { +for (var p = c.getParent (); p != null; p = p.getParent ()) { +if (Clazz_instanceOf (p, java.awt.Window)) { +return p; +}} +return null; +}, "java.awt.Component"); +c$.convertScreenLocationToParent = Clazz_defineMethod (c$, "convertScreenLocationToParent", +function (parent, x, y) { +for (var p = parent; p != null; p = p.getParent ()) { +if (Clazz_instanceOf (p, java.awt.Window)) { +var point = new java.awt.Point (x, y); +javax.swing.SwingUtilities.convertPointFromScreen (point, parent); +return point; +}} +throw new Error ("convertScreenLocationToParent: no window ancestor"); +}, "java.awt.Container,~N,~N"); +c$.convertPoint = Clazz_defineMethod (c$, "convertPoint", +function (source, aPoint, destination) { +var p; +if (source == null && destination == null) return aPoint; +if (source == null) { +source = javax.swing.SwingUtilities.getWindowAncestor (destination); +if (source == null) throw new Error ("Source component not connected to component tree hierarchy"); +}p = new java.awt.Point (aPoint); +javax.swing.SwingUtilities.convertPointToScreen (p, source); +if (destination == null) { +destination = javax.swing.SwingUtilities.getWindowAncestor (source); +if (destination == null) throw new Error ("Destination component not connected to component tree hierarchy"); +}javax.swing.SwingUtilities.convertPointFromScreen (p, destination); +return p; +}, "java.awt.Component,java.awt.Point,java.awt.Component"); +c$.convertPoint = Clazz_defineMethod (c$, "convertPoint", +function (source, x, y, destination) { +var point = new java.awt.Point (x, y); +return javax.swing.SwingUtilities.convertPoint (source, point, destination); +}, "java.awt.Component,~N,~N,java.awt.Component"); +c$.convertRectangle = Clazz_defineMethod (c$, "convertRectangle", +function (source, aRectangle, destination) { +var point = new java.awt.Point (aRectangle.x, aRectangle.y); +point = javax.swing.SwingUtilities.convertPoint (source, point, destination); +return new java.awt.Rectangle (point.x, point.y, aRectangle.width, aRectangle.height); +}, "java.awt.Component,java.awt.Rectangle,java.awt.Component"); +c$.getAncestorOfClass = Clazz_defineMethod (c$, "getAncestorOfClass", +function (c, comp) { +if (comp == null || c == null) return null; +var parent = comp.getParent (); +while (parent != null && !(c.isInstance (parent))) parent = parent.getParent (); + +return parent; +}, "Class,java.awt.Component"); +c$.getAncestorNamed = Clazz_defineMethod (c$, "getAncestorNamed", +function (name, comp) { +if (comp == null || name == null) return null; +var parent = comp.getParent (); +while (parent != null && !(name.equals (parent.getName ()))) parent = parent.getParent (); + +return parent; +}, "~S,java.awt.Component"); +c$.getDeepestComponentAt = Clazz_defineMethod (c$, "getDeepestComponentAt", +function (parent, x, y) { +if (!parent.contains (x, y)) { +return null; +}if (Clazz_instanceOf (parent, java.awt.Container)) { +var components = (parent).getComponents (); +for (var i = 0; i < components.length; i++) { +var comp = components[i]; +if (comp != null && comp.isVisible ()) { +var loc = comp.getLocation (); +if (Clazz_instanceOf (comp, java.awt.Container)) { +comp = javax.swing.SwingUtilities.getDeepestComponentAt (comp, x - loc.x, y - loc.y); +} else { +comp = comp.getComponentAt (x - loc.x, y - loc.y); +}if (comp != null && comp.isVisible ()) { +return comp; +}}} +}return parent; +}, "java.awt.Component,~N,~N"); +c$.convertMouseEvent = Clazz_defineMethod (c$, "convertMouseEvent", +function (source, sourceEvent, destination) { +var p = javax.swing.SwingUtilities.convertPoint (source, new java.awt.Point (sourceEvent.getX (), sourceEvent.getY ()), destination); +var newSource; +if (destination != null) newSource = destination; + else newSource = source; +var newEvent; +if (Clazz_instanceOf (sourceEvent, java.awt.event.MouseWheelEvent)) { +var sourceWheelEvent = sourceEvent; +newEvent = new java.awt.event.MouseWheelEvent (newSource, sourceWheelEvent.getID (), sourceWheelEvent.getWhen (), sourceWheelEvent.getModifiers (), p.x, p.y, sourceWheelEvent.getXOnScreen (), sourceWheelEvent.getYOnScreen (), sourceWheelEvent.getClickCount (), sourceWheelEvent.isPopupTrigger (), sourceWheelEvent.getScrollType (), sourceWheelEvent.getScrollAmount (), sourceWheelEvent.getWheelRotation ()); +} else if (Clazz_instanceOf (sourceEvent, javax.swing.event.MenuDragMouseEvent)) { +var sourceMenuDragEvent = sourceEvent; +newEvent = new javax.swing.event.MenuDragMouseEvent (newSource, sourceMenuDragEvent.getID (), sourceMenuDragEvent.getWhen (), sourceMenuDragEvent.getModifiers (), p.x, p.y, sourceMenuDragEvent.getXOnScreen (), sourceMenuDragEvent.getYOnScreen (), sourceMenuDragEvent.getClickCount (), sourceMenuDragEvent.isPopupTrigger (), sourceMenuDragEvent.getPath (), sourceMenuDragEvent.getMenuSelectionManager ()); +} else { +newEvent = new java.awt.event.MouseEvent (newSource, sourceEvent.getID (), sourceEvent.getWhen (), sourceEvent.getModifiers (), p.x, p.y, sourceEvent.getXOnScreen (), sourceEvent.getYOnScreen (), sourceEvent.getClickCount (), sourceEvent.isPopupTrigger (), 0); +}return newEvent; +}, "java.awt.Component,java.awt.event.MouseEvent,java.awt.Component"); +c$.convertPointToScreen = Clazz_defineMethod (c$, "convertPointToScreen", +function (p, c) { +var x; +var y; +do { +if (Clazz_instanceOf (c, javax.swing.JComponent)) { +x = (c).getX (); +y = (c).getY (); +} else if (Clazz_instanceOf (c, java.applet.Applet) || Clazz_instanceOf (c, java.awt.Window)) { +try { +var pp = c.getLocationOnScreen (); +x = pp.x; +y = pp.y; +} catch (icse) { +if (Clazz_exceptionOf (icse, java.awt.IllegalComponentStateException)) { +x = c.getX (); +y = c.getY (); +} else { +throw icse; +} +} +} else { +x = c.getX (); +y = c.getY (); +}p.x += x; +p.y += y; +if (Clazz_instanceOf (c, java.awt.Window) || Clazz_instanceOf (c, java.applet.Applet)) break; +c = c.getParent (); +} while (c != null); +}, "java.awt.Point,java.awt.Component"); +c$.convertPointFromScreen = Clazz_defineMethod (c$, "convertPointFromScreen", +function (p, c) { +var x; +var y; +do { +if (Clazz_instanceOf (c, javax.swing.JComponent)) { +x = (c).getX (); +y = (c).getY (); +} else if (Clazz_instanceOf (c, java.applet.Applet) || Clazz_instanceOf (c, java.awt.Window)) { +try { +var pp = c.getLocationOnScreen (); +x = pp.x; +y = pp.y; +} catch (icse) { +if (Clazz_exceptionOf (icse, java.awt.IllegalComponentStateException)) { +x = c.getX (); +y = c.getY (); +} else { +throw icse; +} +} +} else { +x = c.getX (); +y = c.getY (); +}p.x -= x; +p.y -= y; +if (Clazz_instanceOf (c, java.awt.Window) || Clazz_instanceOf (c, java.applet.Applet)) break; +c = c.getParent (); +} while (c != null); +}, "java.awt.Point,java.awt.Component"); +c$.windowForComponent = Clazz_defineMethod (c$, "windowForComponent", +function (c) { +return javax.swing.SwingUtilities.getWindowAncestor (c); +}, "java.awt.Component"); +c$.isDescendingFrom = Clazz_defineMethod (c$, "isDescendingFrom", +function (a, b) { +if (a === b) return true; +for (var p = a.getParent (); p != null; p = p.getParent ()) if (p === b) return true; + +return false; +}, "java.awt.Component,java.awt.Component"); +c$.computeIntersection = Clazz_defineMethod (c$, "computeIntersection", +function (x, y, width, height, dest) { +var x1 = (x > dest.x) ? x : dest.x; +var x2 = ((x + width) < (dest.x + dest.width)) ? (x + width) : (dest.x + dest.width); +var y1 = (y > dest.y) ? y : dest.y; +var y2 = ((y + height) < (dest.y + dest.height) ? (y + height) : (dest.y + dest.height)); +dest.x = x1; +dest.y = y1; +dest.width = x2 - x1; +dest.height = y2 - y1; +if (dest.width < 0 || dest.height < 0) { +dest.x = dest.y = dest.width = dest.height = 0; +}return dest; +}, "~N,~N,~N,~N,java.awt.Rectangle"); +c$.computeUnion = Clazz_defineMethod (c$, "computeUnion", +function (x, y, width, height, dest) { +var x1 = (x < dest.x) ? x : dest.x; +var x2 = ((x + width) > (dest.x + dest.width)) ? (x + width) : (dest.x + dest.width); +var y1 = (y < dest.y) ? y : dest.y; +var y2 = ((y + height) > (dest.y + dest.height)) ? (y + height) : (dest.y + dest.height); +dest.x = x1; +dest.y = y1; +dest.width = (x2 - x1); +dest.height = (y2 - y1); +return dest; +}, "~N,~N,~N,~N,java.awt.Rectangle"); +c$.computeDifference = Clazz_defineMethod (c$, "computeDifference", +function (rectA, rectB) { +if (rectB == null || !rectA.intersects (rectB) || javax.swing.SwingUtilities.isRectangleContainingRectangle (rectB, rectA)) { +return new Array (0); +}var t = new java.awt.Rectangle (); +var a = null; +var b = null; +var c = null; +var d = null; +var result; +var rectCount = 0; +if (javax.swing.SwingUtilities.isRectangleContainingRectangle (rectA, rectB)) { +t.x = rectA.x; +t.y = rectA.y; +t.width = rectB.x - rectA.x; +t.height = rectA.height; +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.x = rectB.x; +t.y = rectA.y; +t.width = rectB.width; +t.height = rectB.y - rectA.y; +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}t.x = rectB.x; +t.y = rectB.y + rectB.height; +t.width = rectB.width; +t.height = rectA.y + rectA.height - (rectB.y + rectB.height); +if (t.width > 0 && t.height > 0) { +c = new java.awt.Rectangle (t); +rectCount++; +}t.x = rectB.x + rectB.width; +t.y = rectA.y; +t.width = rectA.x + rectA.width - (rectB.x + rectB.width); +t.height = rectA.height; +if (t.width > 0 && t.height > 0) { +d = new java.awt.Rectangle (t); +rectCount++; +}} else { +if (rectB.x <= rectA.x && rectB.y <= rectA.y) { +if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) { +t.x = rectA.x; +t.y = rectB.y + rectB.height; +t.width = rectA.width; +t.height = rectA.y + rectA.height - (rectB.y + rectB.height); +if (t.width > 0 && t.height > 0) { +a = t; +rectCount++; +}} else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) { +t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); +if (t.width > 0 && t.height > 0) { +a = t; +rectCount++; +}} else { +t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), (rectB.y + rectB.height) - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}}} else if (rectB.x <= rectA.x && (rectB.y + rectB.height) >= (rectA.y + rectA.height)) { +if ((rectB.x + rectB.width) > (rectA.x + rectA.width)) { +t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +a = t; +rectCount++; +}} else { +t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape ((rectB.x + rectB.width), rectB.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), (rectA.y + rectA.height) - rectB.y); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}}} else if (rectB.x <= rectA.x) { +if ((rectB.x + rectB.width) >= (rectA.x + rectA.width)) { +t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}} else { +t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape ((rectB.x + rectB.width), rectB.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectB.height); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); +if (t.width > 0 && t.height > 0) { +c = new java.awt.Rectangle (t); +rectCount++; +}}} else if (rectB.x <= (rectA.x + rectA.width) && (rectB.x + rectB.width) > (rectA.x + rectA.width)) { +if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) { +t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); +if (t.width > 0 && t.height > 0) { +a = t; +rectCount++; +}} else if (rectB.y <= rectA.y) { +t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, (rectB.y + rectB.height) - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}} else if ((rectB.y + rectB.height) > (rectA.y + rectA.height)) { +t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, rectB.y, rectB.x - rectA.x, (rectA.y + rectA.height) - rectB.y); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}} else { +t.reshape (rectA.x, rectA.y, rectA.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, rectB.y, rectB.x - rectA.x, rectB.height); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectA.x, (rectB.y + rectB.height), rectA.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); +if (t.width > 0 && t.height > 0) { +c = new java.awt.Rectangle (t); +rectCount++; +}}} else if (rectB.x >= rectA.x && (rectB.x + rectB.width) <= (rectA.x + rectA.width)) { +if (rectB.y <= rectA.y && (rectB.y + rectB.height) > (rectA.y + rectA.height)) { +t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}} else if (rectB.y <= rectA.y) { +t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectB.x, (rectB.y + rectB.height), rectB.width, (rectA.y + rectA.height) - (rectB.y + rectB.height)); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); +if (t.width > 0 && t.height > 0) { +c = new java.awt.Rectangle (t); +rectCount++; +}} else { +t.reshape (rectA.x, rectA.y, rectB.x - rectA.x, rectA.height); +if (t.width > 0 && t.height > 0) { +a = new java.awt.Rectangle (t); +rectCount++; +}t.reshape (rectB.x, rectA.y, rectB.width, rectB.y - rectA.y); +if (t.width > 0 && t.height > 0) { +b = new java.awt.Rectangle (t); +rectCount++; +}t.reshape ((rectB.x + rectB.width), rectA.y, (rectA.x + rectA.width) - (rectB.x + rectB.width), rectA.height); +if (t.width > 0 && t.height > 0) { +c = new java.awt.Rectangle (t); +rectCount++; +}}}}result = new Array (rectCount); +rectCount = 0; +if (a != null) result[rectCount++] = a; +if (b != null) result[rectCount++] = b; +if (c != null) result[rectCount++] = c; +if (d != null) result[rectCount++] = d; +return result; +}, "java.awt.Rectangle,java.awt.Rectangle"); +c$.isLeftMouseButton = Clazz_defineMethod (c$, "isLeftMouseButton", +function (anEvent) { +return ((anEvent.getModifiers () & 16) != 0); +}, "java.awt.event.MouseEvent"); +c$.isMiddleMouseButton = Clazz_defineMethod (c$, "isMiddleMouseButton", +function (anEvent) { +return ((anEvent.getModifiers () & 8) == 8); +}, "java.awt.event.MouseEvent"); +c$.isRightMouseButton = Clazz_defineMethod (c$, "isRightMouseButton", +function (anEvent) { +return ((anEvent.getModifiers () & 4) == 4); +}, "java.awt.event.MouseEvent"); +c$.paintComponent = Clazz_defineMethod (c$, "paintComponent", +function (g, c, p, x, y, w, h) { +javax.swing.SwingUtilities.getCellRendererPane (c, p).paintComponent (g, c, p, x, y, w, h, false); +}, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N"); +c$.paintComponent = Clazz_defineMethod (c$, "paintComponent", +function (g, c, p, r) { +javax.swing.SwingUtilities.paintComponent (g, c, p, r.x, r.y, r.width, r.height); +}, "java.awt.Graphics,java.awt.Component,java.awt.Container,java.awt.Rectangle"); +c$.getCellRendererPane = Clazz_defineMethod (c$, "getCellRendererPane", + function (c, p) { +var shell = c.getParent (); +if (Clazz_instanceOf (shell, javax.swing.CellRendererPane)) { +if (shell.getParent () !== p) { +p.add (shell); +}} else { +shell = swingjs.api.Interface.getInstance ("javax.swing.CellRendererPane", false); +shell.add (c); +p.add (shell); +}return shell; +}, "java.awt.Component,java.awt.Container"); +c$.updateComponentTreeUI = Clazz_defineMethod (c$, "updateComponentTreeUI", +function (c) { +javax.swing.SwingUtilities.updateComponentTreeUI0 (c); +c.invalidate (); +c.validate (); +c.repaint (); +}, "java.awt.Component"); +c$.updateComponentTreeUI0 = Clazz_defineMethod (c$, "updateComponentTreeUI0", + function (c) { +if (Clazz_instanceOf (c, javax.swing.JComponent)) { +var jc = c; +jc.updateUI (); +var jpm = jc.getComponentPopupMenu (); +if (jpm != null) { +javax.swing.SwingUtilities.updateComponentTreeUI (jpm); +}}var children = null; +if (Clazz_instanceOf (c, javax.swing.JMenu)) { +children = (c).getMenuComponents (); +} else if (Clazz_instanceOf (c, java.awt.Container)) { +children = (c).getComponents (); +}if (children != null) { +for (var i = 0; i < children.length; i++) { +javax.swing.SwingUtilities.updateComponentTreeUI0 (children[i]); +} +}}, "java.awt.Component"); +c$.invokeLater = Clazz_defineMethod (c$, "invokeLater", +function (doRun) { +java.awt.EventQueue.invokeLater (doRun); +}, "Runnable"); +c$.invokeAndWait = Clazz_defineMethod (c$, "invokeAndWait", +function (doRun) { +java.awt.EventQueue.invokeAndWait (doRun); +}, "Runnable"); +c$.isEventDispatchThread = Clazz_defineMethod (c$, "isEventDispatchThread", +function () { +return java.awt.EventQueue.isDispatchThread (); +}); +c$.getRootPane = Clazz_defineMethod (c$, "getRootPane", +function (c) { +if (Clazz_instanceOf (c, javax.swing.RootPaneContainer)) { +return (c).getRootPane (); +}for (; c != null; c = c.getParent ()) { +if (Clazz_instanceOf (c, javax.swing.JRootPane)) { +return c; +}} +return null; +}, "java.awt.Component"); +c$.getRoot = Clazz_defineMethod (c$, "getRoot", +function (c) { +var applet = null; +for (var p = c; p != null; p = p.getParent ()) { +if (Clazz_instanceOf (p, java.awt.Window)) { +return p; +}if (Clazz_instanceOf (p, java.applet.Applet)) { +applet = p; +}} +return applet; +}, "java.awt.Component"); +c$.processKeyBindings = Clazz_defineMethod (c$, "processKeyBindings", +function (event) { +if (event != null) { +if (event.isConsumed ()) { +return false; +}var component = event.getComponent (); +var pressed = (event.getID () == 401); +if (!javax.swing.SwingUtilities.isValidKeyEventForKeyBindings (event)) { +return false; +}while (component != null) { +if (Clazz_instanceOf (component, javax.swing.JComponent)) { +return (component).processKeyBindings (event, pressed); +}if ((Clazz_instanceOf (component, java.applet.Applet)) || (Clazz_instanceOf (component, java.awt.Window))) { +return javax.swing.JComponent.processKeyBindingsForAllComponents (event, component, pressed); +}component = component.getParent (); +} +}return false; +}, "java.awt.event.KeyEvent"); +c$.isValidKeyEventForKeyBindings = Clazz_defineMethod (c$, "isValidKeyEventForKeyBindings", +function (e) { +if (e.getID () == 400) { +var mod = e.getModifiers (); +if (((mod & 8) != 0) && ((mod & 2) == 0)) { +return false; +}}return true; +}, "java.awt.event.KeyEvent"); +c$.notifyAction = Clazz_defineMethod (c$, "notifyAction", +function (action, ks, event, sender, modifiers) { +if (action == null) { +return false; +}if (Clazz_instanceOf (action, jssun.swing.UIAction)) { +if (!(action).isEnabled (sender)) { +return false; +}} else if (!action.isEnabled ()) { +return false; +}var commandO; +var stayNull; +commandO = action.getValue ("ActionCommandKey"); +if (commandO == null && (Clazz_instanceOf (action, javax.swing.JComponent.ActionStandin))) { +stayNull = true; +} else { +stayNull = false; +}var command; +if (commandO != null) { +command = commandO.toString (); +} else if (!stayNull && event.getKeyChar () != '\uffff') { +command = String.valueOf (event.getKeyChar ()); +} else { +command = null; +}action.actionPerformed ( new java.awt.event.ActionEvent (sender, 1001, command, event.getWhen (), modifiers)); +return true; +}, "javax.swing.Action,javax.swing.KeyStroke,java.awt.event.KeyEvent,~O,~N"); +c$.replaceUIInputMap = Clazz_defineMethod (c$, "replaceUIInputMap", +function (component, type, uiInputMap) { +var map = component.getInputMap (type, (uiInputMap != null)); +while (map != null) { +var parent = map.getParent (); +if (parent == null || (Clazz_instanceOf (parent, javax.swing.plaf.UIResource))) { +map.setParent (uiInputMap); +return; +}map = parent; +} +}, "javax.swing.JComponent,~N,javax.swing.InputMap"); +c$.replaceUIActionMap = Clazz_defineMethod (c$, "replaceUIActionMap", +function (component, uiActionMap) { +var map = component.getActionMap ((uiActionMap != null)); +;while (map != null) { +var parent = map.getParent (); +if (parent == null || (Clazz_instanceOf (parent, javax.swing.plaf.UIResource))) { +map.setParent (uiActionMap); +return; +}map = parent; +} +}, "javax.swing.JComponent,javax.swing.ActionMap"); +c$.getUIInputMap = Clazz_defineMethod (c$, "getUIInputMap", +function (component, condition) { +var map = component.getInputMap (condition, false); +while (map != null) { +var parent = map.getParent (); +if (Clazz_instanceOf (parent, javax.swing.plaf.UIResource)) { +return parent; +}map = parent; +} +return null; +}, "javax.swing.JComponent,~N"); +c$.getUIActionMap = Clazz_defineMethod (c$, "getUIActionMap", +function (component) { +var map = component.getActionMap (false); +while (map != null) { +var parent = map.getParent (); +if (Clazz_instanceOf (parent, javax.swing.plaf.UIResource)) { +return parent; +}map = parent; +} +return null; +}, "javax.swing.JComponent"); +c$.getSharedOwnerFrame = Clazz_defineMethod (c$, "getSharedOwnerFrame", +function () { +var sharedOwnerFrame = javax.swing.SwingUtilities.appContextGet (javax.swing.SwingUtilities.sharedOwnerFrameKey); +if (sharedOwnerFrame == null) { +sharedOwnerFrame = new javax.swing.SwingUtilities.SharedOwnerFrame (); +javax.swing.SwingUtilities.appContextPut (javax.swing.SwingUtilities.sharedOwnerFrameKey, sharedOwnerFrame); +}return sharedOwnerFrame; +}); +c$.getSharedOwnerFrameShutdownListener = Clazz_defineMethod (c$, "getSharedOwnerFrameShutdownListener", +function () { +var sharedOwnerFrame = javax.swing.SwingUtilities.getSharedOwnerFrame (); +return sharedOwnerFrame; +}); +c$.appContextGet = Clazz_defineMethod (c$, "appContextGet", +function (key) { +return jssun.awt.AppContext.getAppContext ().get (key); +}, "~O"); +c$.appContextPut = Clazz_defineMethod (c$, "appContextPut", +function (key, value) { +jssun.awt.AppContext.getAppContext ().put (key, value); +}, "~O,~O"); +c$.appContextRemove = Clazz_defineMethod (c$, "appContextRemove", +function (key) { +jssun.awt.AppContext.getAppContext ().remove (key); +}, "~O"); +c$.loadSystemClass = Clazz_defineMethod (c$, "loadSystemClass", +function (className) { +return Clazz._4Name (className, true, Thread.currentThread ().getContextClassLoader ()); +}, "~S"); +c$.isLeftToRight = Clazz_defineMethod (c$, "isLeftToRight", +function (c) { +return c.getComponentOrientation ().isLeftToRight (); +}, "java.awt.Component"); +c$.doesIconReferenceImage = Clazz_defineMethod (c$, "doesIconReferenceImage", +function (icon, image) { +var iconImage = (icon != null && (Clazz_instanceOf (icon, javax.swing.ImageIcon))) ? (icon).getImage () : null; +return (iconImage === image); +}, "javax.swing.Icon,java.awt.Image"); +c$.findDisplayedMnemonicIndex = Clazz_defineMethod (c$, "findDisplayedMnemonicIndex", +function (text, mnemonic) { +if (text == null || mnemonic == 0) { +return -1; +}var uc = Character.toUpperCase (String.fromCharCode (mnemonic)); +var lc = Character.toLowerCase (String.fromCharCode (mnemonic)); +var uci = text.indexOf (uc); +var lci = text.indexOf (lc); +if (uci == -1) { +return lci; +} else if (lci == -1) { +return uci; +} else { +return (lci < uci) ? lci : uci; +}}, "~S,~N"); +c$.calculateInnerArea = Clazz_defineMethod (c$, "calculateInnerArea", +function (c, r) { +if (c == null) { +return null; +}var rect = r; +var insets = c.getInsets (); +if (rect == null) { +rect = new java.awt.Rectangle (); +}rect.x = insets.left; +rect.y = insets.top; +rect.width = c.getWidth () - insets.left - insets.right; +rect.height = c.getHeight () - insets.top - insets.bottom; +return rect; +}, "javax.swing.JComponent,java.awt.Rectangle"); +c$.updateRendererOrEditorUI = Clazz_defineMethod (c$, "updateRendererOrEditorUI", +function (rendererOrEditor) { +if (rendererOrEditor == null) { +return; +}var component = null; +if (Clazz_instanceOf (rendererOrEditor, java.awt.Component)) { +component = rendererOrEditor; +}if (Clazz_instanceOf (rendererOrEditor, javax.swing.DefaultCellEditor)) { +component = (rendererOrEditor).getComponent (); +}if (component != null) { +javax.swing.SwingUtilities.updateComponentTreeUI (component); +}}, "~O"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.SwingUtilities, "SharedOwnerFrame", java.awt.Frame, java.awt.event.WindowListener); +Clazz_defineMethod (c$, "addNotify", +function () { +Clazz_superCall (this, javax.swing.SwingUtilities.SharedOwnerFrame, "addNotify", []); +this.installListeners (); +}); +Clazz_defineMethod (c$, "installListeners", +function () { +var a = this.getOwnedWindows (); +for (var b = 0; b < a.length; b++) { +var c = a[b]; +if (c != null) { +c.removeWindowListener (this); +c.addWindowListener (this); +}} +}); +Clazz_overrideMethod (c$, "windowClosed", +function (a) { +var b = this.getOwnedWindows (); +for (var c = 0; c < b.length; c++) { +var d = b[c]; +if (d != null) { +if (d.isDisplayable ()) { +return; +}d.removeWindowListener (this); +}this.dispose (); +} +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowOpened", +function (a) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowClosing", +function (a) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowIconified", +function (a) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowDeiconified", +function (a) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowActivated", +function (a) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowDeactivated", +function (a) { +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "show", +function () { +}); +Clazz_overrideMethod (c$, "dispose", +function () { +}); +c$ = Clazz_p0p (); +c$.sharedOwnerFrameKey = c$.prototype.sharedOwnerFrameKey = new Clazz._O (); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.Window"], "java.awt.Frame", ["java.lang.IllegalArgumentException", "java.awt.Cursor", "$.IllegalComponentStateException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.maximizedBounds = null; +this.title = "Untitled"; +this.resizable = true; +this.undecorated = false; +this.mbManagement = false; +this.$state = 0; +this.ownedWindows = null; +this.menuBar = null; +Clazz_instantialize (this, arguments); +}, java.awt, "Frame", java.awt.Window); +Clazz_makeConstructor (c$, +function () { +this.construct (""); +}); +Clazz_makeConstructor (c$, +function (gc) { +this.construct ("", gc); +}, "java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (title) { +Clazz_superConstructor (this, java.awt.Frame, []); +this.initFrame (title, null); +}, "~S"); +Clazz_makeConstructor (c$, +function (title, gc) { +Clazz_superConstructor (this, java.awt.Frame, [gc]); +this.initFrame (title, gc); +}, "~S,java.awt.GraphicsConfiguration"); +Clazz_defineMethod (c$, "initFrame", + function (title, gc) { +this.title = title; +}, "~S,java.awt.GraphicsConfiguration"); +Clazz_overrideMethod (c$, "constructComponentName", +function () { +{ +return "frame" + java.awt.Frame.$nameCounter++; +}}); +Clazz_defineMethod (c$, "addNotify", +function () { +if (this.peer == null) { +this.peer = this.getToolkit ().createFrame (this); +}var p = this.peer; +p.setMaximizedBounds (this.maximizedBounds); +Clazz_superCall (this, java.awt.Frame, "addNotify", []); +}); +Clazz_defineMethod (c$, "getTitle", +function () { +return this.title; +}); +Clazz_defineMethod (c$, "setTitle", +function (title) { +var oldTitle = this.title; +if (title == null) { +title = ""; +}{ +this.title = title; +}this.firePropertyChangeObject ("title", oldTitle, title); +}, "~S"); +Clazz_defineMethod (c$, "getIconImage", +function () { +var icons = this.icons; +if (icons != null) { +if (icons.size () > 0) { +return icons.get (0); +}}return null; +}); +Clazz_defineMethod (c$, "isResizable", +function () { +return this.resizable; +}); +Clazz_defineMethod (c$, "setResizable", +function (resizable) { +var oldResizable = this.resizable; +{ +this.resizable = resizable; +}this.firePropertyChangeBool ("resizable", oldResizable, resizable); +}, "~B"); +Clazz_defineMethod (c$, "setState", +function (state) { +var current = this.getExtendedState (); +if (state == 1 && (current & 1) == 0) { +this.setExtendedState (current | 1); +} else if (state == 0 && (current & 1) != 0) { +this.setExtendedState (current & -2); +}}, "~N"); +Clazz_defineMethod (c$, "setExtendedState", +function (state) { +if (!this.isFrameStateSupported (state)) { +return; +}this.$state = state; +}, "~N"); +Clazz_defineMethod (c$, "isFrameStateSupported", + function (state) { +if (!this.getToolkit ().isFrameStateSupported (state)) { +if (((state & 1) != 0) && !this.getToolkit ().isFrameStateSupported (1)) { +return false; +} else { +state &= -2; +}return this.getToolkit ().isFrameStateSupported (state); +}return true; +}, "~N"); +Clazz_defineMethod (c$, "getState", +function () { +return (this.getExtendedState () & 1) != 0 ? 1 : 0; +}); +Clazz_defineMethod (c$, "getExtendedState", +function () { +return this.$state; +}); +Clazz_defineMethod (c$, "setMaximizedBounds", +function (bounds) { +this.maximizedBounds = bounds; +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "getMaximizedBounds", +function () { +return this.maximizedBounds; +}); +Clazz_defineMethod (c$, "setUndecorated", +function (undecorated) { +{ +if (this.isDisplayable ()) { +throw new java.awt.IllegalComponentStateException ("The frame is displayable."); +}this.undecorated = undecorated; +}}, "~B"); +Clazz_defineMethod (c$, "isUndecorated", +function () { +return this.undecorated; +}); +Clazz_overrideMethod (c$, "removeNotify", +function () { +}); +Clazz_defineMethod (c$, "paramString", +function () { +var str = Clazz_superCall (this, java.awt.Frame, "paramString", []); +if (this.title != null) { +str += ",title=" + this.title; +}if (this.resizable) { +str += ",resizable"; +}this.getExtendedState (); +if (this.$state == 0) { +str += ",normal"; +} else { +if ((this.$state & 1) != 0) { +str += ",iconified"; +}if ((this.$state & 6) == 6) { +str += ",maximized"; +} else if ((this.$state & 2) != 0) { +str += ",maximized_horiz"; +} else if ((this.$state & 4) != 0) { +str += ",maximized_vert"; +}}return str; +}); +Clazz_defineMethod (c$, "setCursor", +function (cursorType) { +if (cursorType < 0 || cursorType > 13) { +throw new IllegalArgumentException ("illegal cursor type"); +}this.setCursor (java.awt.Cursor.getPredefinedCursor (cursorType)); +}, "~N"); +Clazz_defineMethod (c$, "getCursorType", +function () { +return (this.getCursor ().getType ()); +}); +c$.getFrames = Clazz_defineMethod (c$, "getFrames", +function () { +var allWindows = java.awt.Window.getWindows (); +var frameCount = 0; +for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) { +if (Clazz_instanceOf (w, java.awt.Frame)) { +frameCount++; +}} +var frames = new Array (frameCount); +var c = 0; +for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) { +if (Clazz_instanceOf (w, java.awt.Frame)) { +frames[c++] = w; +}} +return frames; +}); +Clazz_defineStatics (c$, +"DEFAULT_CURSOR", 0, +"CROSSHAIR_CURSOR", 1, +"TEXT_CURSOR", 2, +"WAIT_CURSOR", 3, +"SW_RESIZE_CURSOR", 4, +"SE_RESIZE_CURSOR", 5, +"NW_RESIZE_CURSOR", 6, +"NE_RESIZE_CURSOR", 7, +"N_RESIZE_CURSOR", 8, +"S_RESIZE_CURSOR", 9, +"W_RESIZE_CURSOR", 10, +"E_RESIZE_CURSOR", 11, +"HAND_CURSOR", 12, +"MOVE_CURSOR", 13, +"NORMAL", 0, +"ICONIFIED", 1, +"MAXIMIZED_HORIZ", 2, +"MAXIMIZED_VERT", 4, +"MAXIMIZED_BOTH", 6, +"$base", "frame", +"$nameCounter", 0); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.lang.IllegalStateException"], "java.awt.IllegalComponentStateException", null, function () { +c$ = Clazz_declareType (java.awt, "IllegalComponentStateException", IllegalStateException); +}); +Clazz_declarePackage ("javax.swing"); +c$ = Clazz_declareInterface (javax.swing, "SwingConstants"); +Clazz_defineStatics (c$, +"CENTER", 0, +"TOP", 1, +"LEFT", 2, +"BOTTOM", 3, +"RIGHT", 4, +"NORTH", 1, +"NORTH_EAST", 2, +"EAST", 3, +"SOUTH_EAST", 4, +"SOUTH", 5, +"SOUTH_WEST", 6, +"WEST", 7, +"NORTH_WEST", 8, +"HORIZONTAL", 0, +"VERTICAL", 1, +"LEADING", 10, +"TRAILING", 11, +"NEXT", 12, +"PREVIOUS", 13); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.Shape", "java.awt.geom.Rectangle2D"], "java.awt.Rectangle", ["java.awt.Dimension", "$.Point"], function () { +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.width = 0; +this.height = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "Rectangle", java.awt.geom.Rectangle2D, java.awt.Shape); +Clazz_makeConstructor (c$, +function () { +this.construct (0, 0, 0, 0); +}); +Clazz_makeConstructor (c$, +function (r) { +this.construct (r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_makeConstructor (c$, +function (x, y, width, height) { +Clazz_superConstructor (this, java.awt.Rectangle, []); +this.x = x; +this.y = y; +this.width = width; +this.height = height; +}, "~N,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (width, height) { +this.construct (0, 0, width, height); +}, "~N,~N"); +Clazz_makeConstructor (c$, +function (p, d) { +this.construct (p.x, p.y, d.width, d.height); +}, "java.awt.Point,java.awt.Dimension"); +Clazz_makeConstructor (c$, +function (p) { +this.construct (p.x, p.y, 0, 0); +}, "java.awt.Point"); +Clazz_makeConstructor (c$, +function (d) { +this.construct (0, 0, d.width, d.height); +}, "java.awt.Dimension"); +Clazz_overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_overrideMethod (c$, "getWidth", +function () { +return this.width; +}); +Clazz_overrideMethod (c$, "getHeight", +function () { +return this.height; +}); +Clazz_overrideMethod (c$, "getBounds", +function () { +return new java.awt.Rectangle (this.x, this.y, this.width, this.height); +}); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +return new java.awt.Rectangle (this.x, this.y, this.width, this.height); +}); +Clazz_defineMethod (c$, "setBounds", +function (r) { +this.reshape (r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "setBounds", +function (x, y, width, height) { +this.reshape (x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setRect", +function (x, y, width, height) { +var newx; +var newy; +var neww; +var newh; +if (x > 4.294967294E9) { +newx = 2147483647; +neww = -1; +} else { +newx = java.awt.Rectangle.clip (x, false); +if (width >= 0) width += x - newx; +neww = java.awt.Rectangle.clip (width, width >= 0); +}if (y > 4.294967294E9) { +newy = 2147483647; +newh = -1; +} else { +newy = java.awt.Rectangle.clip (y, false); +if (height >= 0) height += y - newy; +newh = java.awt.Rectangle.clip (height, height >= 0); +}this.reshape (newx, newy, neww, newh); +}, "~N,~N,~N,~N"); +c$.clip = Clazz_defineMethod (c$, "clip", + function (v, doceil) { +if (v <= -2147483648) { +return -2147483648; +}if (v >= 2147483647) { +return 2147483647; +}return Clazz_doubleToInt (doceil ? Math.ceil (v) : Math.floor (v)); +}, "~N,~B"); +Clazz_defineMethod (c$, "reshape", +function (x, y, width, height) { +this.x = x; +this.y = y; +this.width = width; +this.height = height; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getLocation", +function () { +return new java.awt.Point (this.x, this.y); +}); +Clazz_defineMethod (c$, "setLocation", +function (p) { +this.setLocation (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "setLocation", +function (x, y) { +this.move (x, y); +}, "~N,~N"); +Clazz_defineMethod (c$, "move", +function (x, y) { +this.x = x; +this.y = y; +}, "~N,~N"); +Clazz_defineMethod (c$, "translate", +function (dx, dy) { +var oldv = this.x; +var newv = oldv + dx; +if (dx < 0) { +if (newv > oldv) { +if (this.width >= 0) { +this.width += newv - -2147483648; +}newv = -2147483648; +}} else { +if (newv < oldv) { +if (this.width >= 0) { +this.width += newv - 2147483647; +if (this.width < 0) this.width = 2147483647; +}newv = 2147483647; +}}this.x = newv; +oldv = this.y; +newv = oldv + dy; +if (dy < 0) { +if (newv > oldv) { +if (this.height >= 0) { +this.height += newv - -2147483648; +}newv = -2147483648; +}} else { +if (newv < oldv) { +if (this.height >= 0) { +this.height += newv - 2147483647; +if (this.height < 0) this.height = 2147483647; +}newv = 2147483647; +}}this.y = newv; +}, "~N,~N"); +Clazz_defineMethod (c$, "getSize", +function () { +return new java.awt.Dimension (this.width, this.height); +}); +Clazz_defineMethod (c$, "setSize", +function (d) { +this.setSize (d.width, d.height); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "setSize", +function (width, height) { +this.resize (width, height); +}, "~N,~N"); +Clazz_defineMethod (c$, "resize", +function (width, height) { +this.width = width; +this.height = height; +}, "~N,~N"); +Clazz_defineMethod (c$, "contains", +function (p) { +return this.contains (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "contains", +function (x, y) { +return this.inside (x, y); +}, "~N,~N"); +Clazz_defineMethod (c$, "contains", +function (r) { +return this.contains (r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "contains", +function (X, Y, W, H) { +var w = this.width; +var h = this.height; +if ((w | h | W | H) < 0) { +return false; +}var x = this.x; +var y = this.y; +if (X < x || Y < y) { +return false; +}w += x; +W += X; +if (W <= X) { +if (w >= x || W > w) return false; +} else { +if (w >= x && W > w) return false; +}h += y; +H += Y; +if (H <= Y) { +if (h >= y || H > h) return false; +} else { +if (h >= y && H > h) return false; +}return true; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "inside", +function (X, Y) { +var w = this.width; +var h = this.height; +if ((w | h) < 0) { +return false; +}var x = this.x; +var y = this.y; +if (X < x || Y < y) { +return false; +}w += x; +h += y; +return ((w < x || w > X) && (h < y || h > Y)); +}, "~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (r) { +var tw = this.width; +var th = this.height; +var rw = r.width; +var rh = r.height; +if (rw <= 0 || rh <= 0 || tw <= 0 || th <= 0) { +return false; +}var tx = this.x; +var ty = this.y; +var rx = r.x; +var ry = r.y; +rw += rx; +rh += ry; +tw += tx; +th += ty; +return ((rw < rx || rw > tx) && (rh < ry || rh > ty) && (tw < tx || tw > rx) && (th < ty || th > ry)); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "intersection", +function (r) { +var tx1 = this.x; +var ty1 = this.y; +var rx1 = r.x; +var ry1 = r.y; +var tx2 = tx1; +tx2 += this.width; +var ty2 = ty1; +ty2 += this.height; +var rx2 = rx1; +rx2 += r.width; +var ry2 = ry1; +ry2 += r.height; +if (tx1 < rx1) tx1 = rx1; +if (ty1 < ry1) ty1 = ry1; +if (tx2 > rx2) tx2 = rx2; +if (ty2 > ry2) ty2 = ry2; +tx2 -= tx1; +ty2 -= ty1; +if (tx2 < -2147483648) tx2 = -2147483648; +if (ty2 < -2147483648) ty2 = -2147483648; +return new java.awt.Rectangle (tx1, ty1, tx2, ty2); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "union", +function (r) { +var tx2 = this.width; +var ty2 = this.height; +if ((tx2 | ty2) < 0) { +return new java.awt.Rectangle (r); +}var rx2 = r.width; +var ry2 = r.height; +if ((rx2 | ry2) < 0) { +return new java.awt.Rectangle (this); +}var tx1 = this.x; +var ty1 = this.y; +tx2 += tx1; +ty2 += ty1; +var rx1 = r.x; +var ry1 = r.y; +rx2 += rx1; +ry2 += ry1; +if (tx1 > rx1) tx1 = rx1; +if (ty1 > ry1) ty1 = ry1; +if (tx2 < rx2) tx2 = rx2; +if (ty2 < ry2) ty2 = ry2; +tx2 -= tx1; +ty2 -= ty1; +if (tx2 > 2147483647) tx2 = 2147483647; +if (ty2 > 2147483647) ty2 = 2147483647; +return new java.awt.Rectangle (tx1, ty1, tx2, ty2); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "add", +function (newx, newy) { +if ((this.width | this.height) < 0) { +this.x = newx; +this.y = newy; +this.width = this.height = 0; +return; +}var x1 = this.x; +var y1 = this.y; +var x2 = this.width; +var y2 = this.height; +x2 += x1; +y2 += y1; +if (x1 > newx) x1 = newx; +if (y1 > newy) y1 = newy; +if (x2 < newx) x2 = newx; +if (y2 < newy) y2 = newy; +x2 -= x1; +y2 -= y1; +if (x2 > 2147483647) x2 = 2147483647; +if (y2 > 2147483647) y2 = 2147483647; +this.reshape (x1, y1, x2, y2); +}, "~N,~N"); +Clazz_defineMethod (c$, "add", +function (pt) { +this.add (pt.x, pt.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "add", +function (r) { +var tx2 = this.width; +var ty2 = this.height; +if ((tx2 | ty2) < 0) { +this.reshape (r.x, r.y, r.width, r.height); +}var rx2 = r.width; +var ry2 = r.height; +if ((rx2 | ry2) < 0) { +return; +}var tx1 = this.x; +var ty1 = this.y; +tx2 += tx1; +ty2 += ty1; +var rx1 = r.x; +var ry1 = r.y; +rx2 += rx1; +ry2 += ry1; +if (tx1 > rx1) tx1 = rx1; +if (ty1 > ry1) ty1 = ry1; +if (tx2 < rx2) tx2 = rx2; +if (ty2 < ry2) ty2 = ry2; +tx2 -= tx1; +ty2 -= ty1; +if (tx2 > 2147483647) tx2 = 2147483647; +if (ty2 > 2147483647) ty2 = 2147483647; +this.reshape (tx1, ty1, tx2, ty2); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "grow", +function (h, v) { +var x0 = this.x; +var y0 = this.y; +var x1 = this.width; +var y1 = this.height; +x1 += x0; +y1 += y0; +x0 -= h; +y0 -= v; +x1 += h; +y1 += v; +if (x1 < x0) { +x1 -= x0; +if (x1 < -2147483648) x1 = -2147483648; +if (x0 < -2147483648) x0 = -2147483648; + else if (x0 > 2147483647) x0 = 2147483647; +} else { +if (x0 < -2147483648) x0 = -2147483648; + else if (x0 > 2147483647) x0 = 2147483647; +x1 -= x0; +if (x1 < -2147483648) x1 = -2147483648; + else if (x1 > 2147483647) x1 = 2147483647; +}if (y1 < y0) { +y1 -= y0; +if (y1 < -2147483648) y1 = -2147483648; +if (y0 < -2147483648) y0 = -2147483648; + else if (y0 > 2147483647) y0 = 2147483647; +} else { +if (y0 < -2147483648) y0 = -2147483648; + else if (y0 > 2147483647) y0 = 2147483647; +y1 -= y0; +if (y1 < -2147483648) y1 = -2147483648; + else if (y1 > 2147483647) y1 = 2147483647; +}this.reshape (x0, y0, x1, y1); +}, "~N,~N"); +Clazz_overrideMethod (c$, "isEmpty", +function () { +return (this.width <= 0) || (this.height <= 0); +}); +Clazz_defineMethod (c$, "outcode", +function (x, y) { +var out = 0; +if (this.width <= 0) { +out |= 5; +} else if (x < this.x) { +out |= 1; +} else if (x > this.x + this.width) { +out |= 4; +}if (this.height <= 0) { +out |= 10; +} else if (y < this.y) { +out |= 2; +} else if (y > this.y + this.height) { +out |= 8; +}return out; +}, "~N,~N"); +Clazz_overrideMethod (c$, "createIntersection", +function (r) { +if (Clazz_instanceOf (r, java.awt.Rectangle)) { +return this.intersection (r); +}var dest = new java.awt.geom.Rectangle2D.Double (); +java.awt.geom.Rectangle2D.intersect (this, r, dest); +return dest; +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "createUnion", +function (r) { +if (Clazz_instanceOf (r, java.awt.Rectangle)) { +return this.union (r); +}var dest = new java.awt.geom.Rectangle2D.Double (); +java.awt.geom.Rectangle2D.union (this, r, dest); +return dest; +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "equals", +function (obj) { +if (Clazz_instanceOf (obj, java.awt.Rectangle)) { +var r = obj; +return ((this.x == r.x) && (this.y == r.y) && (this.width == r.width) && (this.height == r.height)); +}return Clazz_superCall (this, java.awt.Rectangle, "equals", [obj]); +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + ",width=" + this.width + ",height=" + this.height + "]"; +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "Shape"); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.geom.RectangularShape"], "java.awt.geom.Rectangle2D", ["java.lang.Double", "java.awt.geom.RectIterator"], function () { +c$ = Clazz_declareType (java.awt.geom, "Rectangle2D", java.awt.geom.RectangularShape); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.Rectangle2D, []); +}); +Clazz_defineMethod (c$, "setRect", +function (r) { +this.setRect (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "intersectsLine", +function (x1, y1, x2, y2) { +var out1; +var out2; +if ((out2 = this.outcode (x2, y2)) == 0) { +return true; +}while ((out1 = this.outcode (x1, y1)) != 0) { +if ((out1 & out2) != 0) { +return false; +}if ((out1 & (5)) != 0) { +var x = this.getX (); +if ((out1 & 4) != 0) { +x += this.getWidth (); +}y1 = y1 + (x - x1) * (y2 - y1) / (x2 - x1); +x1 = x; +} else { +var y = this.getY (); +if ((out1 & 8) != 0) { +y += this.getHeight (); +}x1 = x1 + (y - y1) * (x2 - x1) / (y2 - y1); +y1 = y; +}} +return true; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersectsLine", +function (l) { +return this.intersectsLine (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 ()); +}, "java.awt.geom.Line2D"); +Clazz_defineMethod (c$, "outcode", +function (p) { +return this.outcode (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "setFrame", +function (x, y, w, h) { +this.setRect (x, y, w, h); +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +return this.clone (); +}); +Clazz_defineMethod (c$, "contains", +function (x, y) { +var x0 = this.getX (); +var y0 = this.getY (); +return (x >= x0 && y >= y0 && x < x0 + this.getWidth () && y < y0 + this.getHeight ()); +}, "~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (x, y, w, h) { +if (this.isEmpty () || w <= 0 || h <= 0) { +return false; +}var x0 = this.getX (); +var y0 = this.getY (); +return (x + w > x0 && y + h > y0 && x < x0 + this.getWidth () && y < y0 + this.getHeight ()); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "contains", +function (x, y, w, h) { +if (this.isEmpty () || w <= 0 || h <= 0) { +return false; +}var x0 = this.getX (); +var y0 = this.getY (); +return (x >= x0 && y >= y0 && (x + w) <= x0 + this.getWidth () && (y + h) <= y0 + this.getHeight ()); +}, "~N,~N,~N,~N"); +c$.intersect = Clazz_defineMethod (c$, "intersect", +function (src1, src2, dest) { +var x1 = Math.max (src1.getMinX (), src2.getMinX ()); +var y1 = Math.max (src1.getMinY (), src2.getMinY ()); +var x2 = Math.min (src1.getMaxX (), src2.getMaxX ()); +var y2 = Math.min (src1.getMaxY (), src2.getMaxY ()); +dest.setFrame (x1, y1, x2 - x1, y2 - y1); +}, "java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D"); +c$.union = Clazz_defineMethod (c$, "union", +function (src1, src2, dest) { +var x1 = Math.min (src1.getMinX (), src2.getMinX ()); +var y1 = Math.min (src1.getMinY (), src2.getMinY ()); +var x2 = Math.max (src1.getMaxX (), src2.getMaxX ()); +var y2 = Math.max (src1.getMaxY (), src2.getMaxY ()); +dest.setFrameFromDiagonal (x1, y1, x2, y2); +}, "java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D,java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "add", +function (newx, newy) { +var x1 = Math.min (this.getMinX (), newx); +var x2 = Math.max (this.getMaxX (), newx); +var y1 = Math.min (this.getMinY (), newy); +var y2 = Math.max (this.getMaxY (), newy); +this.setRect (x1, y1, x2 - x1, y2 - y1); +}, "~N,~N"); +Clazz_defineMethod (c$, "add", +function (pt) { +this.add (pt.getX (), pt.getY ()); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "add", +function (r) { +var x1 = Math.min (this.getMinX (), r.getMinX ()); +var x2 = Math.max (this.getMaxX (), r.getMaxX ()); +var y1 = Math.min (this.getMinY (), r.getMinY ()); +var y2 = Math.max (this.getMaxY (), r.getMaxY ()); +this.setRect (x1, y1, x2 - x1, y2 - y1); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "getPathIterator", +function (at) { +return new java.awt.geom.RectIterator (this, at); +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "getPathIterator", +function (at, flatness) { +return new java.awt.geom.RectIterator (this, at); +}, "java.awt.geom.AffineTransform,~N"); +Clazz_overrideMethod (c$, "hashCode", +function () { +var bits = java.lang.Double.doubleToLongBits (this.getX ()); +bits += java.lang.Double.doubleToLongBits (this.getY ()) * 37; +bits += java.lang.Double.doubleToLongBits (this.getWidth ()) * 43; +bits += java.lang.Double.doubleToLongBits (this.getHeight ()) * 47; +return ((bits) ^ ((bits >> 32))); +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (obj === this) { +return true; +}if (Clazz_instanceOf (obj, java.awt.geom.Rectangle2D)) { +var r2d = obj; +return ((this.getX () == r2d.getX ()) && (this.getY () == r2d.getY ()) && (this.getWidth () == r2d.getWidth ()) && (this.getHeight () == r2d.getHeight ())); +}return false; +}, "~O"); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.width = 0; +this.height = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Rectangle2D, "Float", java.awt.geom.Rectangle2D); +Clazz_makeConstructor (c$, +function (a, b, c, d) { +Clazz_superConstructor (this, java.awt.geom.Rectangle2D.Float, []); +{ +if (arguments.length == 0) +return; +}this.setRect (a, b, c, d); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_defineMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "getWidth", +function () { +return this.width; +}); +Clazz_defineMethod (c$, "getHeight", +function () { +return this.height; +}); +Clazz_overrideMethod (c$, "isEmpty", +function () { +return (this.width <= 0.0) || (this.height <= 0.0); +}); +Clazz_defineMethod (c$, "setRect", +function (a, b, c, d) { +this.x = a; +this.y = b; +this.width = c; +this.height = d; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setRect", +function (a, b, c, d) { +this.x = a; +this.y = b; +this.width = c; +this.height = d; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setRect", +function (a) { +this.x = a.getX (); +this.y = a.getY (); +this.width = a.getWidth (); +this.height = a.getHeight (); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "outcode", +function (a, b) { +var c = 0; +if (this.width <= 0) { +c |= 5; +} else if (a < this.x) { +c |= 1; +} else if (a > this.x + this.width) { +c |= 4; +}if (this.height <= 0) { +c |= 10; +} else if (b < this.y) { +c |= 2; +} else if (b > this.y + this.height) { +c |= 8; +}return c; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +return new java.awt.geom.Rectangle2D.Float (this.x, this.y, this.width, this.height); +}); +Clazz_overrideMethod (c$, "createIntersection", +function (a) { +var b; +if (Clazz_instanceOf (a, java.awt.geom.Rectangle2D.Float)) { +b = new java.awt.geom.Rectangle2D.Float (); +} else { +b = new java.awt.geom.Rectangle2D.Double (); +}java.awt.geom.Rectangle2D.intersect (this, a, b); +return b; +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "createUnion", +function (a) { +var b; +if (Clazz_instanceOf (a, java.awt.geom.Rectangle2D.Float)) { +b = new java.awt.geom.Rectangle2D.Float (); +} else { +b = new java.awt.geom.Rectangle2D.Double (); +}java.awt.geom.Rectangle2D.union (this, a, b); +return b; +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + ",w=" + this.width + ",h=" + this.height + "]"; +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.width = 0; +this.height = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Rectangle2D, "Double", java.awt.geom.Rectangle2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.Rectangle2D.Double, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d) { +Clazz_superConstructor (this, java.awt.geom.Rectangle2D.Double, []); +this.setRect (a, b, c, d); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_defineMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "getWidth", +function () { +return this.width; +}); +Clazz_defineMethod (c$, "getHeight", +function () { +return this.height; +}); +Clazz_overrideMethod (c$, "isEmpty", +function () { +return (this.width <= 0.0) || (this.height <= 0.0); +}); +Clazz_defineMethod (c$, "setRect", +function (a, b, c, d) { +this.x = a; +this.y = b; +this.width = c; +this.height = d; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setRect", +function (a) { +this.x = a.getX (); +this.y = a.getY (); +this.width = a.getWidth (); +this.height = a.getHeight (); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "outcode", +function (a, b) { +var c = 0; +if (this.width <= 0) { +c |= 5; +} else if (a < this.x) { +c |= 1; +} else if (a > this.x + this.width) { +c |= 4; +}if (this.height <= 0) { +c |= 10; +} else if (b < this.y) { +c |= 2; +} else if (b > this.y + this.height) { +c |= 8; +}return c; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +return new java.awt.geom.Rectangle2D.Double (this.x, this.y, this.width, this.height); +}); +Clazz_overrideMethod (c$, "createIntersection", +function (a) { +var b = new java.awt.geom.Rectangle2D.Double (); +java.awt.geom.Rectangle2D.intersect (this, a, b); +return b; +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "createUnion", +function (a) { +var b = new java.awt.geom.Rectangle2D.Double (); +java.awt.geom.Rectangle2D.union (this, a, b); +return b; +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[x=" + this.x + ",y=" + this.y + ",w=" + this.width + ",h=" + this.height + "]"; +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"OUT_LEFT", 1, +"OUT_TOP", 2, +"OUT_RIGHT", 4, +"OUT_BOTTOM", 8); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.Shape"], "java.awt.geom.RectangularShape", ["java.lang.InternalError", "java.awt.geom.FlatteningPathIterator"], function () { +c$ = Clazz_declareType (java.awt.geom, "RectangularShape", null, [java.awt.Shape, Cloneable]); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "getMinX", +function () { +return this.getX (); +}); +Clazz_defineMethod (c$, "getMinY", +function () { +return this.getY (); +}); +Clazz_defineMethod (c$, "getMaxX", +function () { +return this.getX () + this.getWidth (); +}); +Clazz_defineMethod (c$, "getMaxY", +function () { +return this.getY () + this.getHeight (); +}); +Clazz_defineMethod (c$, "getCenterX", +function () { +return this.getX () + this.getWidth () / 2.0; +}); +Clazz_defineMethod (c$, "getCenterY", +function () { +return this.getY () + this.getHeight () / 2.0; +}); +Clazz_defineMethod (c$, "getFrame", +function () { +return new java.awt.geom.Rectangle2D.Double (this.getX (), this.getY (), this.getWidth (), this.getHeight ()); +}); +Clazz_defineMethod (c$, "setFrame", +function (loc, size) { +this.setFrame (loc.getX (), loc.getY (), size.getWidth (), size.getHeight ()); +}, "java.awt.geom.Point2D,java.awt.geom.Dimension2D"); +Clazz_defineMethod (c$, "setFrame", +function (r) { +this.setFrame (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "setFrameFromDiagonal", +function (x1, y1, x2, y2) { +if (x2 < x1) { +var t = x1; +x1 = x2; +x2 = t; +}if (y2 < y1) { +var t = y1; +y1 = y2; +y2 = t; +}this.setFrame (x1, y1, x2 - x1, y2 - y1); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setFrameFromDiagonal", +function (p1, p2) { +this.setFrameFromDiagonal (p1.getX (), p1.getY (), p2.getX (), p2.getY ()); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "setFrameFromCenter", +function (centerX, centerY, cornerX, cornerY) { +var halfW = Math.abs (cornerX - centerX); +var halfH = Math.abs (cornerY - centerY); +this.setFrame (centerX - halfW, centerY - halfH, halfW * 2.0, halfH * 2.0); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setFrameFromCenter", +function (center, corner) { +this.setFrameFromCenter (center.getX (), center.getY (), corner.getX (), corner.getY ()); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "contains", +function (p) { +return this.contains (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +Clazz_overrideMethod (c$, "intersects", +function (r) { +return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "contains", +function (r) { +return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "getBounds", +function () { +var width = this.getWidth (); +var height = this.getHeight (); +if (width < 0 || height < 0) { +return new java.awt.Rectangle (); +}var x = this.getX (); +var y = this.getY (); +var x1 = Math.floor (x); +var y1 = Math.floor (y); +var x2 = Math.ceil (x + width); +var y2 = Math.ceil (y + height); +return new java.awt.Rectangle (Clazz_doubleToInt (x1), Clazz_doubleToInt (y1), Clazz_doubleToInt (x2 - x1), Clazz_doubleToInt (y2 - y1)); +}); +Clazz_overrideMethod (c$, "getPathIterator", +function (at, flatness) { +return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); +}, "java.awt.geom.AffineTransform,~N"); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.RectangularShape, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.FlatteningPathIterator", ["java.lang.IllegalArgumentException", "java.util.NoSuchElementException", "java.awt.geom.CubicCurve2D", "$.QuadCurve2D"], function () { +c$ = Clazz_decorateAsClass (function () { +this.src = null; +this.squareflat = 0; +this.limit = 0; +this.hold = null; +this.curx = 0; +this.cury = 0; +this.movx = 0; +this.movy = 0; +this.holdType = 0; +this.holdEnd = 0; +this.holdIndex = 0; +this.levels = null; +this.levelIndex = 0; +this.done = false; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "FlatteningPathIterator", null, java.awt.geom.PathIterator); +Clazz_prepareFields (c$, function () { +this.hold = Clazz_newDoubleArray (14, 0); +}); +Clazz_makeConstructor (c$, +function (src, flatness) { +this.construct (src, flatness, 10); +}, "java.awt.geom.PathIterator,~N"); +Clazz_makeConstructor (c$, +function (src, flatness, limit) { +if (flatness < 0.0) { +throw new IllegalArgumentException ("flatness must be >= 0"); +}if (limit < 0) { +throw new IllegalArgumentException ("limit must be >= 0"); +}this.src = src; +this.squareflat = flatness * flatness; +this.limit = limit; +this.levels = Clazz_newIntArray (limit + 1, 0); +this.next (false); +}, "java.awt.geom.PathIterator,~N,~N"); +Clazz_defineMethod (c$, "getFlatness", +function () { +return Math.sqrt (this.squareflat); +}); +Clazz_defineMethod (c$, "getRecursionLimit", +function () { +return this.limit; +}); +Clazz_defineMethod (c$, "getWindingRule", +function () { +return this.src.getWindingRule (); +}); +Clazz_defineMethod (c$, "isDone", +function () { +return this.done; +}); +Clazz_defineMethod (c$, "ensureHoldCapacity", +function (want) { +if (this.holdIndex - want < 0) { +var have = this.hold.length - this.holdIndex; +var newsize = this.hold.length + 24; +var newhold = Clazz_newDoubleArray (newsize, 0); +System.arraycopy (this.hold, this.holdIndex, newhold, this.holdIndex + 24, have); +this.hold = newhold; +this.holdIndex += 24; +this.holdEnd += 24; +}}, "~N"); +Clazz_defineMethod (c$, "next", +function () { +this.next (true); +}); +Clazz_defineMethod (c$, "next", + function (doNext) { +var level; +if (this.holdIndex >= this.holdEnd) { +if (doNext) { +this.src.next (); +}if (this.src.isDone ()) { +this.done = true; +return; +}this.holdType = this.src.currentSegment (this.hold); +this.levelIndex = 0; +this.levels[0] = 0; +}switch (this.holdType) { +case 0: +case 1: +this.curx = this.hold[0]; +this.cury = this.hold[1]; +if (this.holdType == 0) { +this.movx = this.curx; +this.movy = this.cury; +}this.holdIndex = 0; +this.holdEnd = 0; +break; +case 4: +this.curx = this.movx; +this.cury = this.movy; +this.holdIndex = 0; +this.holdEnd = 0; +break; +case 2: +if (this.holdIndex >= this.holdEnd) { +this.holdIndex = this.hold.length - 6; +this.holdEnd = this.hold.length - 2; +this.hold[this.holdIndex + 0] = this.curx; +this.hold[this.holdIndex + 1] = this.cury; +this.hold[this.holdIndex + 2] = this.hold[0]; +this.hold[this.holdIndex + 3] = this.hold[1]; +this.hold[this.holdIndex + 4] = this.curx = this.hold[2]; +this.hold[this.holdIndex + 5] = this.cury = this.hold[3]; +}level = this.levels[this.levelIndex]; +while (level < this.limit) { +if (java.awt.geom.QuadCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) { +break; +}this.ensureHoldCapacity (4); +java.awt.geom.QuadCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 4, this.hold, this.holdIndex); +this.holdIndex -= 4; +level++; +this.levels[this.levelIndex] = level; +this.levelIndex++; +this.levels[this.levelIndex] = level; +} +this.holdIndex += 4; +this.levelIndex--; +break; +case 3: +if (this.holdIndex >= this.holdEnd) { +this.holdIndex = this.hold.length - 8; +this.holdEnd = this.hold.length - 2; +this.hold[this.holdIndex + 0] = this.curx; +this.hold[this.holdIndex + 1] = this.cury; +this.hold[this.holdIndex + 2] = this.hold[0]; +this.hold[this.holdIndex + 3] = this.hold[1]; +this.hold[this.holdIndex + 4] = this.hold[2]; +this.hold[this.holdIndex + 5] = this.hold[3]; +this.hold[this.holdIndex + 6] = this.curx = this.hold[4]; +this.hold[this.holdIndex + 7] = this.cury = this.hold[5]; +}level = this.levels[this.levelIndex]; +while (level < this.limit) { +if (java.awt.geom.CubicCurve2D.getFlatnessSq (this.hold, this.holdIndex) < this.squareflat) { +break; +}this.ensureHoldCapacity (6); +java.awt.geom.CubicCurve2D.subdivide (this.hold, this.holdIndex, this.hold, this.holdIndex - 6, this.hold, this.holdIndex); +this.holdIndex -= 6; +level++; +this.levels[this.levelIndex] = level; +this.levelIndex++; +this.levels[this.levelIndex] = level; +} +this.holdIndex += 6; +this.levelIndex--; +break; +} +}, "~B"); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("flattening iterator out of bounds"); +}var type = this.holdType; +if (type != 4) { +coords[0] = this.hold[this.holdIndex + 0]; +coords[1] = this.hold[this.holdIndex + 1]; +if (type != 0) { +type = 1; +}}return type; +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("flattening iterator out of bounds"); +}var type = this.holdType; +if (type != 4) { +coords[0] = this.hold[this.holdIndex + 0]; +coords[1] = this.hold[this.holdIndex + 1]; +if (type != 0) { +type = 1; +}}return type; +}, "~A"); +Clazz_defineStatics (c$, +"GROW_SIZE", 24); +}); +Clazz_declarePackage ("java.awt.geom"); +c$ = Clazz_declareInterface (java.awt.geom, "PathIterator"); +Clazz_defineStatics (c$, +"WIND_EVEN_ODD", 0, +"WIND_NON_ZERO", 1, +"SEG_MOVETO", 0, +"SEG_LINETO", 1, +"SEG_QUADTO", 2, +"SEG_CUBICTO", 3, +"SEG_CLOSE", 4); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.Shape"], "java.awt.geom.CubicCurve2D", ["java.lang.InternalError", "java.util.Arrays", "java.awt.geom.FlatteningPathIterator", "$.Line2D", "$.Point2D", "$.QuadCurve2D", "$.Rectangle2D", "jssun.awt.geom.Curve", "swingjs.api.Interface"], function () { +c$ = Clazz_declareType (java.awt.geom, "CubicCurve2D", null, [java.awt.Shape, Cloneable]); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setCurve", +function (coords, offset) { +this.setCurve (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); +}, "~A,~N"); +Clazz_defineMethod (c$, "setCurve", +function (p1, cp1, cp2, p2) { +this.setCurve (p1.getX (), p1.getY (), cp1.getX (), cp1.getY (), cp2.getX (), cp2.getY (), p2.getX (), p2.getY ()); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D,java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "setCurve", +function (pts, offset) { +this.setCurve (pts[offset + 0].getX (), pts[offset + 0].getY (), pts[offset + 1].getX (), pts[offset + 1].getY (), pts[offset + 2].getX (), pts[offset + 2].getY (), pts[offset + 3].getX (), pts[offset + 3].getY ()); +}, "~A,~N"); +Clazz_defineMethod (c$, "setCurve", +function (c) { +this.setCurve (c.getX1 (), c.getY1 (), c.getCtrlX1 (), c.getCtrlY1 (), c.getCtrlX2 (), c.getCtrlY2 (), c.getX2 (), c.getY2 ()); +}, "java.awt.geom.CubicCurve2D"); +c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", +function (x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2) { +return Math.max (java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, ctrlx1, ctrly1), java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, ctrlx2, ctrly2)); +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", +function (x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2) { +return Math.sqrt (java.awt.geom.CubicCurve2D.getFlatnessSq (x1, y1, ctrlx1, ctrly1, ctrlx2, ctrly2, x2, y2)); +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", +function (coords, offset) { +return java.awt.geom.CubicCurve2D.getFlatnessSq (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); +}, "~A,~N"); +c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", +function (coords, offset) { +return java.awt.geom.CubicCurve2D.getFlatness (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5], coords[offset + 6], coords[offset + 7]); +}, "~A,~N"); +Clazz_defineMethod (c$, "getFlatnessSq", +function () { +return java.awt.geom.CubicCurve2D.getFlatnessSq (this.getX1 (), this.getY1 (), this.getCtrlX1 (), this.getCtrlY1 (), this.getCtrlX2 (), this.getCtrlY2 (), this.getX2 (), this.getY2 ()); +}); +Clazz_defineMethod (c$, "getFlatness", +function () { +return java.awt.geom.CubicCurve2D.getFlatness (this.getX1 (), this.getY1 (), this.getCtrlX1 (), this.getCtrlY1 (), this.getCtrlX2 (), this.getCtrlY2 (), this.getX2 (), this.getY2 ()); +}); +Clazz_defineMethod (c$, "subdivide", +function (left, right) { +java.awt.geom.CubicCurve2D.subdivide (this, left, right); +}, "java.awt.geom.CubicCurve2D,java.awt.geom.CubicCurve2D"); +c$.subdivide = Clazz_defineMethod (c$, "subdivide", +function (src, left, right) { +var x1 = src.getX1 (); +var y1 = src.getY1 (); +var ctrlx1 = src.getCtrlX1 (); +var ctrly1 = src.getCtrlY1 (); +var ctrlx2 = src.getCtrlX2 (); +var ctrly2 = src.getCtrlY2 (); +var x2 = src.getX2 (); +var y2 = src.getY2 (); +var centerx = (ctrlx1 + ctrlx2) / 2.0; +var centery = (ctrly1 + ctrly2) / 2.0; +ctrlx1 = (x1 + ctrlx1) / 2.0; +ctrly1 = (y1 + ctrly1) / 2.0; +ctrlx2 = (x2 + ctrlx2) / 2.0; +ctrly2 = (y2 + ctrly2) / 2.0; +var ctrlx12 = (ctrlx1 + centerx) / 2.0; +var ctrly12 = (ctrly1 + centery) / 2.0; +var ctrlx21 = (ctrlx2 + centerx) / 2.0; +var ctrly21 = (ctrly2 + centery) / 2.0; +centerx = (ctrlx12 + ctrlx21) / 2.0; +centery = (ctrly12 + ctrly21) / 2.0; +if (left != null) { +left.setCurve (x1, y1, ctrlx1, ctrly1, ctrlx12, ctrly12, centerx, centery); +}if (right != null) { +right.setCurve (centerx, centery, ctrlx21, ctrly21, ctrlx2, ctrly2, x2, y2); +}}, "java.awt.geom.CubicCurve2D,java.awt.geom.CubicCurve2D,java.awt.geom.CubicCurve2D"); +c$.subdivide = Clazz_defineMethod (c$, "subdivide", +function (src, srcoff, left, leftoff, right, rightoff) { +var x1 = src[srcoff + 0]; +var y1 = src[srcoff + 1]; +var ctrlx1 = src[srcoff + 2]; +var ctrly1 = src[srcoff + 3]; +var ctrlx2 = src[srcoff + 4]; +var ctrly2 = src[srcoff + 5]; +var x2 = src[srcoff + 6]; +var y2 = src[srcoff + 7]; +if (left != null) { +left[leftoff + 0] = x1; +left[leftoff + 1] = y1; +}if (right != null) { +right[rightoff + 6] = x2; +right[rightoff + 7] = y2; +}x1 = (x1 + ctrlx1) / 2.0; +y1 = (y1 + ctrly1) / 2.0; +x2 = (x2 + ctrlx2) / 2.0; +y2 = (y2 + ctrly2) / 2.0; +var centerx = (ctrlx1 + ctrlx2) / 2.0; +var centery = (ctrly1 + ctrly2) / 2.0; +ctrlx1 = (x1 + centerx) / 2.0; +ctrly1 = (y1 + centery) / 2.0; +ctrlx2 = (x2 + centerx) / 2.0; +ctrly2 = (y2 + centery) / 2.0; +centerx = (ctrlx1 + ctrlx2) / 2.0; +centery = (ctrly1 + ctrly2) / 2.0; +if (left != null) { +left[leftoff + 2] = x1; +left[leftoff + 3] = y1; +left[leftoff + 4] = ctrlx1; +left[leftoff + 5] = ctrly1; +left[leftoff + 6] = centerx; +left[leftoff + 7] = centery; +}if (right != null) { +right[rightoff + 0] = centerx; +right[rightoff + 1] = centery; +right[rightoff + 2] = ctrlx2; +right[rightoff + 3] = ctrly2; +right[rightoff + 4] = x2; +right[rightoff + 5] = y2; +}}, "~A,~N,~A,~N,~A,~N"); +c$.solveCubic = Clazz_defineMethod (c$, "solveCubic", +function (eqn) { +return java.awt.geom.CubicCurve2D.solveCubic (eqn, eqn); +}, "~A"); +c$.solveCubic = Clazz_defineMethod (c$, "solveCubic", +function (eqn, res) { +var d = eqn[3]; +if (d == 0.0) { +return java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res); +}var a = eqn[2] / d; +var b = eqn[1] / d; +var c = eqn[0] / d; +var roots = 0; +var Q = (a * a - 3.0 * b) / 9.0; +var R = (2.0 * a * a * a - 9.0 * a * b + 27.0 * c) / 54.0; +var R2 = R * R; +var Q3 = Q * Q * Q; +a = a / 3.0; +if (R2 < Q3) { +var theta = Math.acos (R / Math.sqrt (Q3)); +Q = -2.0 * Math.sqrt (Q); +if (res === eqn) { +eqn = Clazz_newDoubleArray (4, 0); +System.arraycopy (res, 0, eqn, 0, 4); +}res[roots++] = Q * Math.cos (theta / 3.0) - a; +res[roots++] = Q * Math.cos ((theta + 6.283185307179586) / 3.0) - a; +res[roots++] = Q * Math.cos ((theta - 6.283185307179586) / 3.0) - a; +java.awt.geom.CubicCurve2D.fixRoots (res, eqn); +} else { +var neg = (R < 0.0); +var S = Math.sqrt (R2 - Q3); +if (neg) { +R = -R; +}var A = Math.pow (R + S, 0.3333333333333333); +if (!neg) { +A = -A; +}var B = (A == 0.0) ? 0.0 : (Q / A); +res[roots++] = (A + B) - a; +}return roots; +}, "~A,~A"); +c$.fixRoots = Clazz_defineMethod (c$, "fixRoots", + function (res, eqn) { +var EPSILON = 1E-5; +for (var i = 0; i < 3; i++) { +var t = res[i]; +if (Math.abs (t) < 1.0E-5) { +res[i] = java.awt.geom.CubicCurve2D.findZero (t, 0, eqn); +} else if (Math.abs (t - 1) < 1.0E-5) { +res[i] = java.awt.geom.CubicCurve2D.findZero (t, 1, eqn); +}} +}, "~A,~A"); +c$.solveEqn = Clazz_defineMethod (c$, "solveEqn", + function (eqn, order, t) { +var v = eqn[order]; +while (--order >= 0) { +v = v * t + eqn[order]; +} +return v; +}, "~A,~N,~N"); +c$.findZero = Clazz_defineMethod (c$, "findZero", + function (t, target, eqn) { +var slopeqn = Clazz_newDoubleArray (-1, [eqn[1], 2 * eqn[2], 3 * eqn[3]]); +var slope; +var origdelta = 0; +var origt = t; +while (true) { +slope = java.awt.geom.CubicCurve2D.solveEqn (slopeqn, 2, t); +if (slope == 0) { +return t; +}var y = java.awt.geom.CubicCurve2D.solveEqn (eqn, 3, t); +if (y == 0) { +return t; +}var delta = -(y / slope); +if (origdelta == 0) { +origdelta = delta; +}if (t < target) { +if (delta < 0) return t; +} else if (t > target) { +if (delta > 0) return t; +} else { +return (delta > 0 ? (target + 4.9E-324) : (target - 4.9E-324)); +}var newt = t + delta; +if (t == newt) { +return t; +}if (delta * origdelta < 0) { +var tag = (origt < t ? java.awt.geom.CubicCurve2D.getTag (target, origt, t) : java.awt.geom.CubicCurve2D.getTag (target, t, origt)); +if (tag != 0) { +return (origt + t) / 2; +}t = target; +} else { +t = newt; +}} +}, "~N,~N,~A"); +Clazz_defineMethod (c$, "contains", +function (x, y) { +if (!(x * 0.0 + y * 0.0 == 0.0)) { +return false; +}var x1 = this.getX1 (); +var y1 = this.getY1 (); +var x2 = this.getX2 (); +var y2 = this.getY2 (); +var crossings = (jssun.awt.geom.Curve.pointCrossingsForLine (x, y, x1, y1, x2, y2) + jssun.awt.geom.Curve.pointCrossingsForCubic (x, y, x1, y1, this.getCtrlX1 (), this.getCtrlY1 (), this.getCtrlX2 (), this.getCtrlY2 (), x2, y2, 0)); +return ((crossings & 1) == 1); +}, "~N,~N"); +Clazz_defineMethod (c$, "contains", +function (p) { +return this.contains (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +c$.fillEqn = Clazz_defineMethod (c$, "fillEqn", + function (eqn, val, c1, cp1, cp2, c2) { +eqn[0] = c1 - val; +eqn[1] = (cp1 - c1) * 3.0; +eqn[2] = (cp2 - cp1 - cp1 + c1) * 3.0; +eqn[3] = c2 + (cp1 - cp2) * 3.0 - c1; +return; +}, "~A,~N,~N,~N,~N,~N"); +c$.evalCubic = Clazz_defineMethod (c$, "evalCubic", + function (vals, num, include0, include1, inflect, c1, cp1, cp2, c2) { +var j = 0; +for (var i = 0; i < num; i++) { +var t = vals[i]; +if ((include0 ? t >= 0 : t > 0) && (include1 ? t <= 1 : t < 1) && (inflect == null || inflect[1] + (2 * inflect[2] + 3 * inflect[3] * t) * t != 0)) { +var u = 1 - t; +vals[j++] = c1 * u * u * u + 3 * cp1 * t * u * u + 3 * cp2 * t * t * u + c2 * t * t * t; +}} +return j; +}, "~A,~N,~B,~B,~A,~N,~N,~N,~N"); +c$.getTag = Clazz_defineMethod (c$, "getTag", + function (coord, low, high) { +if (coord <= low) { +return (coord < low ? -2 : -1); +}if (coord >= high) { +return (coord > high ? 2 : 1); +}return 0; +}, "~N,~N,~N"); +c$.inwards = Clazz_defineMethod (c$, "inwards", + function (pttag, opt1tag, opt2tag) { +switch (pttag) { +case -2: +case 2: +default: +return false; +case -1: +return (opt1tag >= 0 || opt2tag >= 0); +case 0: +return true; +case 1: +return (opt1tag <= 0 || opt2tag <= 0); +} +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (x, y, w, h) { +if (w <= 0 || h <= 0) { +return false; +}var x1 = this.getX1 (); +var y1 = this.getY1 (); +var x1tag = java.awt.geom.CubicCurve2D.getTag (x1, x, x + w); +var y1tag = java.awt.geom.CubicCurve2D.getTag (y1, y, y + h); +if (x1tag == 0 && y1tag == 0) { +return true; +}var x2 = this.getX2 (); +var y2 = this.getY2 (); +var x2tag = java.awt.geom.CubicCurve2D.getTag (x2, x, x + w); +var y2tag = java.awt.geom.CubicCurve2D.getTag (y2, y, y + h); +if (x2tag == 0 && y2tag == 0) { +return true; +}var ctrlx1 = this.getCtrlX1 (); +var ctrly1 = this.getCtrlY1 (); +var ctrlx2 = this.getCtrlX2 (); +var ctrly2 = this.getCtrlY2 (); +var ctrlx1tag = java.awt.geom.CubicCurve2D.getTag (ctrlx1, x, x + w); +var ctrly1tag = java.awt.geom.CubicCurve2D.getTag (ctrly1, y, y + h); +var ctrlx2tag = java.awt.geom.CubicCurve2D.getTag (ctrlx2, x, x + w); +var ctrly2tag = java.awt.geom.CubicCurve2D.getTag (ctrly2, y, y + h); +if (x1tag < 0 && x2tag < 0 && ctrlx1tag < 0 && ctrlx2tag < 0) { +return false; +}if (y1tag < 0 && y2tag < 0 && ctrly1tag < 0 && ctrly2tag < 0) { +return false; +}if (x1tag > 0 && x2tag > 0 && ctrlx1tag > 0 && ctrlx2tag > 0) { +return false; +}if (y1tag > 0 && y2tag > 0 && ctrly1tag > 0 && ctrly2tag > 0) { +return false; +}if (java.awt.geom.CubicCurve2D.inwards (x1tag, x2tag, ctrlx1tag) && java.awt.geom.CubicCurve2D.inwards (y1tag, y2tag, ctrly1tag)) { +return true; +}if (java.awt.geom.CubicCurve2D.inwards (x2tag, x1tag, ctrlx2tag) && java.awt.geom.CubicCurve2D.inwards (y2tag, y1tag, ctrly2tag)) { +return true; +}var xoverlap = (x1tag * x2tag <= 0); +var yoverlap = (y1tag * y2tag <= 0); +if (x1tag == 0 && x2tag == 0 && yoverlap) { +return true; +}if (y1tag == 0 && y2tag == 0 && xoverlap) { +return true; +}var eqn = Clazz_newDoubleArray (4, 0); +var res = Clazz_newDoubleArray (4, 0); +if (!yoverlap) { +java.awt.geom.CubicCurve2D.fillEqn (eqn, (y1tag < 0 ? y : y + h), y1, ctrly1, ctrly2, y2); +var num = java.awt.geom.CubicCurve2D.solveCubic (eqn, res); +num = java.awt.geom.CubicCurve2D.evalCubic (res, num, true, true, null, x1, ctrlx1, ctrlx2, x2); +return (num == 2 && java.awt.geom.CubicCurve2D.getTag (res[0], x, x + w) * java.awt.geom.CubicCurve2D.getTag (res[1], x, x + w) <= 0); +}if (!xoverlap) { +java.awt.geom.CubicCurve2D.fillEqn (eqn, (x1tag < 0 ? x : x + w), x1, ctrlx1, ctrlx2, x2); +var num = java.awt.geom.CubicCurve2D.solveCubic (eqn, res); +num = java.awt.geom.CubicCurve2D.evalCubic (res, num, true, true, null, y1, ctrly1, ctrly2, y2); +return (num == 2 && java.awt.geom.CubicCurve2D.getTag (res[0], y, y + h) * java.awt.geom.CubicCurve2D.getTag (res[1], y, y + h) <= 0); +}var dx = x2 - x1; +var dy = y2 - y1; +var k = y2 * x1 - x2 * y1; +var c1tag; +var c2tag; +if (y1tag == 0) { +c1tag = x1tag; +} else { +c1tag = java.awt.geom.CubicCurve2D.getTag ((k + dx * (y1tag < 0 ? y : y + h)) / dy, x, x + w); +}if (y2tag == 0) { +c2tag = x2tag; +} else { +c2tag = java.awt.geom.CubicCurve2D.getTag ((k + dx * (y2tag < 0 ? y : y + h)) / dy, x, x + w); +}if (c1tag * c2tag <= 0) { +return true; +}c1tag = ((c1tag * x1tag <= 0) ? y1tag : y2tag); +java.awt.geom.CubicCurve2D.fillEqn (eqn, (c2tag < 0 ? x : x + w), x1, ctrlx1, ctrlx2, x2); +var num = java.awt.geom.CubicCurve2D.solveCubic (eqn, res); +num = java.awt.geom.CubicCurve2D.evalCubic (res, num, true, true, null, y1, ctrly1, ctrly2, y2); +var tags = Clazz_newIntArray (num + 1, 0); +for (var i = 0; i < num; i++) { +tags[i] = java.awt.geom.CubicCurve2D.getTag (res[i], y, y + h); +} +tags[num] = c1tag; +java.util.Arrays.sort (tags); +return ((num >= 1 && tags[0] * tags[1] <= 0) || (num >= 3 && tags[2] * tags[3] <= 0)); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (r) { +return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "contains", +function (x, y, w, h) { +if (w <= 0 || h <= 0) { +return false; +}if (!(this.contains (x, y) && this.contains (x + w, y) && this.contains (x + w, y + h) && this.contains (x, y + h))) { +return false; +}var rect = new java.awt.geom.Rectangle2D.Double (x, y, w, h); +return !rect.intersectsLine (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "contains", +function (r) { +return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "getBounds", +function () { +return this.getBounds2D ().getBounds (); +}); +Clazz_defineMethod (c$, "getPathIterator", +function (at) { +return (swingjs.api.Interface.getInstance ("java.awt.geom.CubicInterator", false)).set (this, at); +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "getPathIterator", +function (at, flatness) { +return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); +}, "java.awt.geom.AffineTransform,~N"); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.CubicCurve2D, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x1 = 0; +this.y1 = 0; +this.ctrlx1 = 0; +this.ctrly1 = 0; +this.ctrlx2 = 0; +this.ctrly2 = 0; +this.x2 = 0; +this.y2 = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.CubicCurve2D, "Float", java.awt.geom.CubicCurve2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Float, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d, e, f, g, h) { +Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Float, []); +this.setCurve (a, b, c, d, e, f, g, h); +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getX1", +function () { +return this.x1; +}); +Clazz_overrideMethod (c$, "getY1", +function () { +return this.y1; +}); +Clazz_overrideMethod (c$, "getP1", +function () { +return new java.awt.geom.Point2D.Float (this.x1, this.y1); +}); +Clazz_overrideMethod (c$, "getCtrlX1", +function () { +return this.ctrlx1; +}); +Clazz_overrideMethod (c$, "getCtrlY1", +function () { +return this.ctrly1; +}); +Clazz_overrideMethod (c$, "getCtrlP1", +function () { +return new java.awt.geom.Point2D.Float (this.ctrlx1, this.ctrly1); +}); +Clazz_overrideMethod (c$, "getCtrlX2", +function () { +return this.ctrlx2; +}); +Clazz_overrideMethod (c$, "getCtrlY2", +function () { +return this.ctrly2; +}); +Clazz_overrideMethod (c$, "getCtrlP2", +function () { +return new java.awt.geom.Point2D.Float (this.ctrlx2, this.ctrly2); +}); +Clazz_overrideMethod (c$, "getX2", +function () { +return this.x2; +}); +Clazz_overrideMethod (c$, "getY2", +function () { +return this.y2; +}); +Clazz_overrideMethod (c$, "getP2", +function () { +return new java.awt.geom.Point2D.Float (this.x2, this.y2); +}); +Clazz_defineMethod (c$, "setCurve", +function (a, b, c, d, e, f, g, h) { +this.x1 = a; +this.y1 = b; +this.ctrlx1 = c; +this.ctrly1 = d; +this.ctrlx2 = e; +this.ctrly2 = f; +this.x2 = g; +this.y2 = h; +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setCurve", +function (a, b, c, d, e, f, g, h) { +this.x1 = a; +this.y1 = b; +this.ctrlx1 = c; +this.ctrly1 = d; +this.ctrlx2 = e; +this.ctrly2 = f; +this.x2 = g; +this.y2 = h; +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a = Math.min (Math.min (this.x1, this.x2), Math.min (this.ctrlx1, this.ctrlx2)); +var b = Math.min (Math.min (this.y1, this.y2), Math.min (this.ctrly1, this.ctrly2)); +var c = Math.max (Math.max (this.x1, this.x2), Math.max (this.ctrlx1, this.ctrlx2)); +var d = Math.max (Math.max (this.y1, this.y2), Math.max (this.ctrly1, this.ctrly2)); +return new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b); +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x1 = 0; +this.y1 = 0; +this.ctrlx1 = 0; +this.ctrly1 = 0; +this.ctrlx2 = 0; +this.ctrly2 = 0; +this.x2 = 0; +this.y2 = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.CubicCurve2D, "Double", java.awt.geom.CubicCurve2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Double, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d, e, f, g, h) { +Clazz_superConstructor (this, java.awt.geom.CubicCurve2D.Double, []); +this.setCurve (a, b, c, d, e, f, g, h); +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getX1", +function () { +return this.x1; +}); +Clazz_overrideMethod (c$, "getY1", +function () { +return this.y1; +}); +Clazz_overrideMethod (c$, "getP1", +function () { +return new java.awt.geom.Point2D.Double (this.x1, this.y1); +}); +Clazz_overrideMethod (c$, "getCtrlX1", +function () { +return this.ctrlx1; +}); +Clazz_overrideMethod (c$, "getCtrlY1", +function () { +return this.ctrly1; +}); +Clazz_overrideMethod (c$, "getCtrlP1", +function () { +return new java.awt.geom.Point2D.Double (this.ctrlx1, this.ctrly1); +}); +Clazz_overrideMethod (c$, "getCtrlX2", +function () { +return this.ctrlx2; +}); +Clazz_overrideMethod (c$, "getCtrlY2", +function () { +return this.ctrly2; +}); +Clazz_overrideMethod (c$, "getCtrlP2", +function () { +return new java.awt.geom.Point2D.Double (this.ctrlx2, this.ctrly2); +}); +Clazz_overrideMethod (c$, "getX2", +function () { +return this.x2; +}); +Clazz_overrideMethod (c$, "getY2", +function () { +return this.y2; +}); +Clazz_overrideMethod (c$, "getP2", +function () { +return new java.awt.geom.Point2D.Double (this.x2, this.y2); +}); +Clazz_defineMethod (c$, "setCurve", +function (a, b, c, d, e, f, g, h) { +this.x1 = a; +this.y1 = b; +this.ctrlx1 = c; +this.ctrly1 = d; +this.ctrlx2 = e; +this.ctrly2 = f; +this.x2 = g; +this.y2 = h; +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a = Math.min (Math.min (this.x1, this.x2), Math.min (this.ctrlx1, this.ctrlx2)); +var b = Math.min (Math.min (this.y1, this.y2), Math.min (this.ctrly1, this.ctrly2)); +var c = Math.max (Math.max (this.x1, this.x2), Math.max (this.ctrlx1, this.ctrlx2)); +var d = Math.max (Math.max (this.y1, this.y2), Math.max (this.ctrly1, this.ctrly2)); +return new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b); +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"BELOW", -2, +"LOWEDGE", -1, +"INSIDE", 0, +"HIGHEDGE", 1, +"ABOVE", 2); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.CubicIterator", ["java.util.NoSuchElementException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.cubic = null; +this.affine = null; +this.index = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "CubicIterator", null, java.awt.geom.PathIterator); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_makeConstructor (c$, +function (q, at) { +this.set (q, at); +}, "java.awt.geom.CubicCurve2D,java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "set", +function (q, at) { +this.cubic = q; +this.affine = at; +return this; +}, "java.awt.geom.CubicCurve2D,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getWindingRule", +function () { +return 1; +}); +Clazz_overrideMethod (c$, "isDone", +function () { +return (this.index > 1); +}); +Clazz_overrideMethod (c$, "next", +function () { +this.index++; +}); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("cubic iterator iterator out of bounds"); +}var type; +if (this.index == 0) { +coords[0] = this.cubic.getX1 (); +coords[1] = this.cubic.getY1 (); +type = 0; +} else { +coords[0] = this.cubic.getCtrlX1 (); +coords[1] = this.cubic.getCtrlY1 (); +coords[2] = this.cubic.getCtrlX2 (); +coords[3] = this.cubic.getCtrlY2 (); +coords[4] = this.cubic.getX2 (); +coords[5] = this.cubic.getY2 (); +type = 3; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 3); +}return type; +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("cubic iterator iterator out of bounds"); +}var type; +if (this.index == 0) { +coords[0] = this.cubic.getX1 (); +coords[1] = this.cubic.getY1 (); +type = 0; +} else { +coords[0] = this.cubic.getCtrlX1 (); +coords[1] = this.cubic.getCtrlY1 (); +coords[2] = this.cubic.getCtrlX2 (); +coords[3] = this.cubic.getCtrlY2 (); +coords[4] = this.cubic.getX2 (); +coords[5] = this.cubic.getY2 (); +type = 3; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 3); +}return type; +}, "~A"); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.Shape"], "java.awt.geom.Line2D", ["java.lang.InternalError", "java.awt.geom.LineIterator", "$.Point2D", "$.Rectangle2D"], function () { +c$ = Clazz_declareType (java.awt.geom, "Line2D", null, [java.awt.Shape, Cloneable]); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setLine", +function (p1, p2) { +this.setLine (p1.getX (), p1.getY (), p2.getX (), p2.getY ()); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "setLine", +function (l) { +this.setLine (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 ()); +}, "java.awt.geom.Line2D"); +c$.relativeCCW = Clazz_defineMethod (c$, "relativeCCW", +function (x1, y1, x2, y2, px, py) { +x2 -= x1; +y2 -= y1; +px -= x1; +py -= y1; +var ccw = px * y2 - py * x2; +if (ccw == 0.0) { +ccw = px * x2 + py * y2; +if (ccw > 0.0) { +px -= x2; +py -= y2; +ccw = px * x2 + py * y2; +if (ccw < 0.0) { +ccw = 0.0; +}}}return (ccw < 0.0) ? -1 : ((ccw > 0.0) ? 1 : 0); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "relativeCCW", +function (px, py) { +return java.awt.geom.Line2D.relativeCCW (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); +}, "~N,~N"); +Clazz_defineMethod (c$, "relativeCCW", +function (p) { +return java.awt.geom.Line2D.relativeCCW (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +c$.linesIntersect = Clazz_defineMethod (c$, "linesIntersect", +function (x1, y1, x2, y2, x3, y3, x4, y4) { +return ((java.awt.geom.Line2D.relativeCCW (x1, y1, x2, y2, x3, y3) * java.awt.geom.Line2D.relativeCCW (x1, y1, x2, y2, x4, y4) <= 0) && (java.awt.geom.Line2D.relativeCCW (x3, y3, x4, y4, x1, y1) * java.awt.geom.Line2D.relativeCCW (x3, y3, x4, y4, x2, y2) <= 0)); +}, "~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersectsLine", +function (x1, y1, x2, y2) { +return java.awt.geom.Line2D.linesIntersect (x1, y1, x2, y2, this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersectsLine", +function (l) { +return java.awt.geom.Line2D.linesIntersect (l.getX1 (), l.getY1 (), l.getX2 (), l.getY2 (), this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); +}, "java.awt.geom.Line2D"); +c$.ptSegDistSq = Clazz_defineMethod (c$, "ptSegDistSq", +function (x1, y1, x2, y2, px, py) { +x2 -= x1; +y2 -= y1; +px -= x1; +py -= y1; +var dotprod = px * x2 + py * y2; +var projlenSq; +if (dotprod <= 0.0) { +projlenSq = 0.0; +} else { +px = x2 - px; +py = y2 - py; +dotprod = px * x2 + py * y2; +if (dotprod <= 0.0) { +projlenSq = 0.0; +} else { +projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2); +}}var lenSq = px * px + py * py - projlenSq; +if (lenSq < 0) { +lenSq = 0; +}return lenSq; +}, "~N,~N,~N,~N,~N,~N"); +c$.ptSegDist = Clazz_defineMethod (c$, "ptSegDist", +function (x1, y1, x2, y2, px, py) { +return Math.sqrt (java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, px, py)); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "ptSegDistSq", +function (px, py) { +return java.awt.geom.Line2D.ptSegDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); +}, "~N,~N"); +Clazz_defineMethod (c$, "ptSegDistSq", +function (pt) { +return java.awt.geom.Line2D.ptSegDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "ptSegDist", +function (px, py) { +return java.awt.geom.Line2D.ptSegDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); +}, "~N,~N"); +Clazz_defineMethod (c$, "ptSegDist", +function (pt) { +return java.awt.geom.Line2D.ptSegDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); +}, "java.awt.geom.Point2D"); +c$.ptLineDistSq = Clazz_defineMethod (c$, "ptLineDistSq", +function (x1, y1, x2, y2, px, py) { +x2 -= x1; +y2 -= y1; +px -= x1; +py -= y1; +var dotprod = px * x2 + py * y2; +var projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2); +var lenSq = px * px + py * py - projlenSq; +if (lenSq < 0) { +lenSq = 0; +}return lenSq; +}, "~N,~N,~N,~N,~N,~N"); +c$.ptLineDist = Clazz_defineMethod (c$, "ptLineDist", +function (x1, y1, x2, y2, px, py) { +return Math.sqrt (java.awt.geom.Line2D.ptLineDistSq (x1, y1, x2, y2, px, py)); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "ptLineDistSq", +function (px, py) { +return java.awt.geom.Line2D.ptLineDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); +}, "~N,~N"); +Clazz_defineMethod (c$, "ptLineDistSq", +function (pt) { +return java.awt.geom.Line2D.ptLineDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "ptLineDist", +function (px, py) { +return java.awt.geom.Line2D.ptLineDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), px, py); +}, "~N,~N"); +Clazz_defineMethod (c$, "ptLineDist", +function (pt) { +return java.awt.geom.Line2D.ptLineDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), pt.getX (), pt.getY ()); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "contains", +function (x, y) { +return false; +}, "~N,~N"); +Clazz_defineMethod (c$, "contains", +function (p) { +return false; +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "intersects", +function (x, y, w, h) { +return this.intersects ( new java.awt.geom.Rectangle2D.Double (x, y, w, h)); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (r) { +return r.intersectsLine (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "contains", +function (x, y, w, h) { +return false; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "contains", +function (r) { +return false; +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "getBounds", +function () { +return this.getBounds2D ().getBounds (); +}); +Clazz_defineMethod (c$, "getPathIterator", +function (at) { +return new java.awt.geom.LineIterator (this, at); +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "getPathIterator", +function (at, flatness) { +return new java.awt.geom.LineIterator (this, at); +}, "java.awt.geom.AffineTransform,~N"); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.Line2D, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x1 = 0; +this.y1 = 0; +this.x2 = 0; +this.y2 = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Line2D, "Float", java.awt.geom.Line2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.Line2D.Float, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d) { +Clazz_superConstructor (this, java.awt.geom.Line2D.Float, []); +this.setLine (a, b, c, d); +}, "~N,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Line2D.Float, []); +this.setLine (a, b); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_overrideMethod (c$, "getX1", +function () { +return this.x1; +}); +Clazz_overrideMethod (c$, "getY1", +function () { +return this.y1; +}); +Clazz_overrideMethod (c$, "getP1", +function () { +return new java.awt.geom.Point2D.Float (this.x1, this.y1); +}); +Clazz_overrideMethod (c$, "getX2", +function () { +return this.x2; +}); +Clazz_overrideMethod (c$, "getY2", +function () { +return this.y2; +}); +Clazz_overrideMethod (c$, "getP2", +function () { +return new java.awt.geom.Point2D.Float (this.x2, this.y2); +}); +Clazz_defineMethod (c$, "setLine", +function (a, b, c, d) { +this.x1 = a; +this.y1 = b; +this.x2 = c; +this.y2 = d; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setLine", +function (a, b, c, d) { +this.x1 = a; +this.y1 = b; +this.x2 = c; +this.y2 = d; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a; +var b; +var c; +var d; +if (this.x1 < this.x2) { +a = this.x1; +c = this.x2 - this.x1; +} else { +a = this.x2; +c = this.x1 - this.x2; +}if (this.y1 < this.y2) { +b = this.y1; +d = this.y2 - this.y1; +} else { +b = this.y2; +d = this.y1 - this.y2; +}return new java.awt.geom.Rectangle2D.Float (a, b, c, d); +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x1 = 0; +this.y1 = 0; +this.x2 = 0; +this.y2 = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Line2D, "Double", java.awt.geom.Line2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.Line2D.Double, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d) { +Clazz_superConstructor (this, java.awt.geom.Line2D.Double, []); +this.setLine (a, b, c, d); +}, "~N,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Line2D.Double, []); +this.setLine (a, b); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_overrideMethod (c$, "getX1", +function () { +return this.x1; +}); +Clazz_overrideMethod (c$, "getY1", +function () { +return this.y1; +}); +Clazz_overrideMethod (c$, "getP1", +function () { +return new java.awt.geom.Point2D.Double (this.x1, this.y1); +}); +Clazz_overrideMethod (c$, "getX2", +function () { +return this.x2; +}); +Clazz_overrideMethod (c$, "getY2", +function () { +return this.y2; +}); +Clazz_overrideMethod (c$, "getP2", +function () { +return new java.awt.geom.Point2D.Double (this.x2, this.y2); +}); +Clazz_defineMethod (c$, "setLine", +function (a, b, c, d) { +this.x1 = a; +this.y1 = b; +this.x2 = c; +this.y2 = d; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a; +var b; +var c; +var d; +if (this.x1 < this.x2) { +a = this.x1; +c = this.x2 - this.x1; +} else { +a = this.x2; +c = this.x1 - this.x2; +}if (this.y1 < this.y2) { +b = this.y1; +d = this.y2 - this.y1; +} else { +b = this.y2; +d = this.y1 - this.y2; +}return new java.awt.geom.Rectangle2D.Double (a, b, c, d); +}); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.LineIterator", ["java.util.NoSuchElementException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.line = null; +this.affine = null; +this.index = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "LineIterator", null, java.awt.geom.PathIterator); +Clazz_makeConstructor (c$, +function (l, at) { +this.line = l; +this.affine = at; +}, "java.awt.geom.Line2D,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getWindingRule", +function () { +return 1; +}); +Clazz_overrideMethod (c$, "isDone", +function () { +return (this.index > 1); +}); +Clazz_overrideMethod (c$, "next", +function () { +this.index++; +}); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("line iterator out of bounds"); +}var type; +if (this.index == 0) { +coords[0] = this.line.getX1 (); +coords[1] = this.line.getY1 (); +type = 0; +} else { +coords[0] = this.line.getX2 (); +coords[1] = this.line.getY2 (); +type = 1; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, 1); +}return type; +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("line iterator out of bounds"); +}var type; +if (this.index == 0) { +coords[0] = this.line.getX1 (); +coords[1] = this.line.getY1 (); +type = 0; +} else { +coords[0] = this.line.getX2 (); +coords[1] = this.line.getY2 (); +type = 1; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, 1); +}return type; +}, "~A"); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.Shape"], "java.awt.geom.QuadCurve2D", ["java.lang.InternalError", "java.awt.geom.FlatteningPathIterator", "$.Line2D", "$.Point2D", "$.QuadIterator", "$.Rectangle2D"], function () { +c$ = Clazz_declareType (java.awt.geom, "QuadCurve2D", null, [java.awt.Shape, Cloneable]); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setCurve", +function (coords, offset) { +this.setCurve (coords[offset + 0], coords[offset + 1], coords[offset + 2], coords[offset + 3], coords[offset + 4], coords[offset + 5]); +}, "~A,~N"); +Clazz_defineMethod (c$, "setCurve", +function (p1, cp, p2) { +this.setCurve (p1.getX (), p1.getY (), cp.getX (), cp.getY (), p2.getX (), p2.getY ()); +}, "java.awt.geom.Point2D,java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "setCurve", +function (pts, offset) { +this.setCurve (pts[offset + 0].getX (), pts[offset + 0].getY (), pts[offset + 1].getX (), pts[offset + 1].getY (), pts[offset + 2].getX (), pts[offset + 2].getY ()); +}, "~A,~N"); +Clazz_defineMethod (c$, "setCurve", +function (c) { +this.setCurve (c.getX1 (), c.getY1 (), c.getCtrlX (), c.getCtrlY (), c.getX2 (), c.getY2 ()); +}, "java.awt.geom.QuadCurve2D"); +c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", +function (x1, y1, ctrlx, ctrly, x2, y2) { +return java.awt.geom.Line2D.ptSegDistSq (x1, y1, x2, y2, ctrlx, ctrly); +}, "~N,~N,~N,~N,~N,~N"); +c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", +function (x1, y1, ctrlx, ctrly, x2, y2) { +return java.awt.geom.Line2D.ptSegDist (x1, y1, x2, y2, ctrlx, ctrly); +}, "~N,~N,~N,~N,~N,~N"); +c$.getFlatnessSq = Clazz_defineMethod (c$, "getFlatnessSq", +function (coords, offset) { +return java.awt.geom.Line2D.ptSegDistSq (coords[offset + 0], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); +}, "~A,~N"); +c$.getFlatness = Clazz_defineMethod (c$, "getFlatness", +function (coords, offset) { +return java.awt.geom.Line2D.ptSegDist (coords[offset + 0], coords[offset + 1], coords[offset + 4], coords[offset + 5], coords[offset + 2], coords[offset + 3]); +}, "~A,~N"); +Clazz_defineMethod (c$, "getFlatnessSq", +function () { +return java.awt.geom.Line2D.ptSegDistSq (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), this.getCtrlX (), this.getCtrlY ()); +}); +Clazz_defineMethod (c$, "getFlatness", +function () { +return java.awt.geom.Line2D.ptSegDist (this.getX1 (), this.getY1 (), this.getX2 (), this.getY2 (), this.getCtrlX (), this.getCtrlY ()); +}); +Clazz_defineMethod (c$, "subdivide", +function (left, right) { +java.awt.geom.QuadCurve2D.subdivide (this, left, right); +}, "java.awt.geom.QuadCurve2D,java.awt.geom.QuadCurve2D"); +c$.subdivide = Clazz_defineMethod (c$, "subdivide", +function (src, left, right) { +var x1 = src.getX1 (); +var y1 = src.getY1 (); +var ctrlx = src.getCtrlX (); +var ctrly = src.getCtrlY (); +var x2 = src.getX2 (); +var y2 = src.getY2 (); +var ctrlx1 = (x1 + ctrlx) / 2.0; +var ctrly1 = (y1 + ctrly) / 2.0; +var ctrlx2 = (x2 + ctrlx) / 2.0; +var ctrly2 = (y2 + ctrly) / 2.0; +ctrlx = (ctrlx1 + ctrlx2) / 2.0; +ctrly = (ctrly1 + ctrly2) / 2.0; +if (left != null) { +left.setCurve (x1, y1, ctrlx1, ctrly1, ctrlx, ctrly); +}if (right != null) { +right.setCurve (ctrlx, ctrly, ctrlx2, ctrly2, x2, y2); +}}, "java.awt.geom.QuadCurve2D,java.awt.geom.QuadCurve2D,java.awt.geom.QuadCurve2D"); +c$.subdivide = Clazz_defineMethod (c$, "subdivide", +function (src, srcoff, left, leftoff, right, rightoff) { +var x1 = src[srcoff + 0]; +var y1 = src[srcoff + 1]; +var ctrlx = src[srcoff + 2]; +var ctrly = src[srcoff + 3]; +var x2 = src[srcoff + 4]; +var y2 = src[srcoff + 5]; +if (left != null) { +left[leftoff + 0] = x1; +left[leftoff + 1] = y1; +}if (right != null) { +right[rightoff + 4] = x2; +right[rightoff + 5] = y2; +}x1 = (x1 + ctrlx) / 2.0; +y1 = (y1 + ctrly) / 2.0; +x2 = (x2 + ctrlx) / 2.0; +y2 = (y2 + ctrly) / 2.0; +ctrlx = (x1 + x2) / 2.0; +ctrly = (y1 + y2) / 2.0; +if (left != null) { +left[leftoff + 2] = x1; +left[leftoff + 3] = y1; +left[leftoff + 4] = ctrlx; +left[leftoff + 5] = ctrly; +}if (right != null) { +right[rightoff + 0] = ctrlx; +right[rightoff + 1] = ctrly; +right[rightoff + 2] = x2; +right[rightoff + 3] = y2; +}}, "~A,~N,~A,~N,~A,~N"); +c$.solveQuadratic = Clazz_defineMethod (c$, "solveQuadratic", +function (eqn) { +return java.awt.geom.QuadCurve2D.solveQuadratic (eqn, eqn); +}, "~A"); +c$.solveQuadratic = Clazz_defineMethod (c$, "solveQuadratic", +function (eqn, res) { +var a = eqn[2]; +var b = eqn[1]; +var c = eqn[0]; +var roots = 0; +if (a == 0.0) { +if (b == 0.0) { +return -1; +}res[roots++] = -c / b; +} else { +var d = b * b - 4.0 * a * c; +if (d < 0.0) { +return 0; +}d = Math.sqrt (d); +if (b < 0.0) { +d = -d; +}var q = (b + d) / -2.0; +res[roots++] = q / a; +if (q != 0.0) { +res[roots++] = c / q; +}}return roots; +}, "~A,~A"); +Clazz_defineMethod (c$, "contains", +function (x, y) { +var x1 = this.getX1 (); +var y1 = this.getY1 (); +var xc = this.getCtrlX (); +var yc = this.getCtrlY (); +var x2 = this.getX2 (); +var y2 = this.getY2 (); +var kx = x1 - 2 * xc + x2; +var ky = y1 - 2 * yc + y2; +var dx = x - x1; +var dy = y - y1; +var dxl = x2 - x1; +var dyl = y2 - y1; +var t0 = (dx * ky - dy * kx) / (dxl * ky - dyl * kx); +if (t0 < 0 || t0 > 1 || t0 != t0) { +return false; +}var xb = kx * t0 * t0 + 2 * (xc - x1) * t0 + x1; +var yb = ky * t0 * t0 + 2 * (yc - y1) * t0 + y1; +var xl = dxl * t0 + x1; +var yl = dyl * t0 + y1; +return (x >= xb && x < xl) || (x >= xl && x < xb) || (y >= yb && y < yl) || (y >= yl && y < yb); +}, "~N,~N"); +Clazz_defineMethod (c$, "contains", +function (p) { +return this.contains (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +c$.fillEqn = Clazz_defineMethod (c$, "fillEqn", + function (eqn, val, c1, cp, c2) { +eqn[0] = c1 - val; +eqn[1] = cp + cp - c1 - c1; +eqn[2] = c1 - cp - cp + c2; +return; +}, "~A,~N,~N,~N,~N"); +c$.evalQuadratic = Clazz_defineMethod (c$, "evalQuadratic", + function (vals, num, include0, include1, inflect, c1, ctrl, c2) { +var j = 0; +for (var i = 0; i < num; i++) { +var t = vals[i]; +if ((include0 ? t >= 0 : t > 0) && (include1 ? t <= 1 : t < 1) && (inflect == null || inflect[1] + 2 * inflect[2] * t != 0)) { +var u = 1 - t; +vals[j++] = c1 * u * u + 2 * ctrl * t * u + c2 * t * t; +}} +return j; +}, "~A,~N,~B,~B,~A,~N,~N,~N"); +c$.getTag = Clazz_defineMethod (c$, "getTag", + function (coord, low, high) { +if (coord <= low) { +return (coord < low ? -2 : -1); +}if (coord >= high) { +return (coord > high ? 2 : 1); +}return 0; +}, "~N,~N,~N"); +c$.inwards = Clazz_defineMethod (c$, "inwards", + function (pttag, opt1tag, opt2tag) { +switch (pttag) { +case -2: +case 2: +default: +return false; +case -1: +return (opt1tag >= 0 || opt2tag >= 0); +case 0: +return true; +case 1: +return (opt1tag <= 0 || opt2tag <= 0); +} +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (x, y, w, h) { +if (w <= 0 || h <= 0) { +return false; +}var x1 = this.getX1 (); +var y1 = this.getY1 (); +var x1tag = java.awt.geom.QuadCurve2D.getTag (x1, x, x + w); +var y1tag = java.awt.geom.QuadCurve2D.getTag (y1, y, y + h); +if (x1tag == 0 && y1tag == 0) { +return true; +}var x2 = this.getX2 (); +var y2 = this.getY2 (); +var x2tag = java.awt.geom.QuadCurve2D.getTag (x2, x, x + w); +var y2tag = java.awt.geom.QuadCurve2D.getTag (y2, y, y + h); +if (x2tag == 0 && y2tag == 0) { +return true; +}var ctrlx = this.getCtrlX (); +var ctrly = this.getCtrlY (); +var ctrlxtag = java.awt.geom.QuadCurve2D.getTag (ctrlx, x, x + w); +var ctrlytag = java.awt.geom.QuadCurve2D.getTag (ctrly, y, y + h); +if (x1tag < 0 && x2tag < 0 && ctrlxtag < 0) { +return false; +}if (y1tag < 0 && y2tag < 0 && ctrlytag < 0) { +return false; +}if (x1tag > 0 && x2tag > 0 && ctrlxtag > 0) { +return false; +}if (y1tag > 0 && y2tag > 0 && ctrlytag > 0) { +return false; +}if (java.awt.geom.QuadCurve2D.inwards (x1tag, x2tag, ctrlxtag) && java.awt.geom.QuadCurve2D.inwards (y1tag, y2tag, ctrlytag)) { +return true; +}if (java.awt.geom.QuadCurve2D.inwards (x2tag, x1tag, ctrlxtag) && java.awt.geom.QuadCurve2D.inwards (y2tag, y1tag, ctrlytag)) { +return true; +}var xoverlap = (x1tag * x2tag <= 0); +var yoverlap = (y1tag * y2tag <= 0); +if (x1tag == 0 && x2tag == 0 && yoverlap) { +return true; +}if (y1tag == 0 && y2tag == 0 && xoverlap) { +return true; +}var eqn = Clazz_newDoubleArray (3, 0); +var res = Clazz_newDoubleArray (3, 0); +if (!yoverlap) { +java.awt.geom.QuadCurve2D.fillEqn (eqn, (y1tag < 0 ? y : y + h), y1, ctrly, y2); +return (java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res) == 2 && java.awt.geom.QuadCurve2D.evalQuadratic (res, 2, true, true, null, x1, ctrlx, x2) == 2 && java.awt.geom.QuadCurve2D.getTag (res[0], x, x + w) * java.awt.geom.QuadCurve2D.getTag (res[1], x, x + w) <= 0); +}if (!xoverlap) { +java.awt.geom.QuadCurve2D.fillEqn (eqn, (x1tag < 0 ? x : x + w), x1, ctrlx, x2); +return (java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res) == 2 && java.awt.geom.QuadCurve2D.evalQuadratic (res, 2, true, true, null, y1, ctrly, y2) == 2 && java.awt.geom.QuadCurve2D.getTag (res[0], y, y + h) * java.awt.geom.QuadCurve2D.getTag (res[1], y, y + h) <= 0); +}var dx = x2 - x1; +var dy = y2 - y1; +var k = y2 * x1 - x2 * y1; +var c1tag; +var c2tag; +if (y1tag == 0) { +c1tag = x1tag; +} else { +c1tag = java.awt.geom.QuadCurve2D.getTag ((k + dx * (y1tag < 0 ? y : y + h)) / dy, x, x + w); +}if (y2tag == 0) { +c2tag = x2tag; +} else { +c2tag = java.awt.geom.QuadCurve2D.getTag ((k + dx * (y2tag < 0 ? y : y + h)) / dy, x, x + w); +}if (c1tag * c2tag <= 0) { +return true; +}c1tag = ((c1tag * x1tag <= 0) ? y1tag : y2tag); +java.awt.geom.QuadCurve2D.fillEqn (eqn, (c2tag < 0 ? x : x + w), x1, ctrlx, x2); +var num = java.awt.geom.QuadCurve2D.solveQuadratic (eqn, res); +java.awt.geom.QuadCurve2D.evalQuadratic (res, num, true, true, null, y1, ctrly, y2); +c2tag = java.awt.geom.QuadCurve2D.getTag (res[0], y, y + h); +return (c1tag * c2tag <= 0); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (r) { +return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "contains", +function (x, y, w, h) { +if (w <= 0 || h <= 0) { +return false; +}return (this.contains (x, y) && this.contains (x + w, y) && this.contains (x + w, y + h) && this.contains (x, y + h)); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "contains", +function (r) { +return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "getBounds", +function () { +return this.getBounds2D ().getBounds (); +}); +Clazz_defineMethod (c$, "getPathIterator", +function (at) { +return new java.awt.geom.QuadIterator (this, at); +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "getPathIterator", +function (at, flatness) { +return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); +}, "java.awt.geom.AffineTransform,~N"); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.QuadCurve2D, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x1 = 0; +this.y1 = 0; +this.ctrlx = 0; +this.ctrly = 0; +this.x2 = 0; +this.y2 = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.QuadCurve2D, "Float", java.awt.geom.QuadCurve2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Float, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d, e, f) { +Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Float, []); +this.setCurve (a, b, c, d, e, f); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getX1", +function () { +return this.x1; +}); +Clazz_overrideMethod (c$, "getY1", +function () { +return this.y1; +}); +Clazz_overrideMethod (c$, "getP1", +function () { +return new java.awt.geom.Point2D.Float (this.x1, this.y1); +}); +Clazz_overrideMethod (c$, "getCtrlX", +function () { +return this.ctrlx; +}); +Clazz_overrideMethod (c$, "getCtrlY", +function () { +return this.ctrly; +}); +Clazz_overrideMethod (c$, "getCtrlPt", +function () { +return new java.awt.geom.Point2D.Float (this.ctrlx, this.ctrly); +}); +Clazz_overrideMethod (c$, "getX2", +function () { +return this.x2; +}); +Clazz_overrideMethod (c$, "getY2", +function () { +return this.y2; +}); +Clazz_overrideMethod (c$, "getP2", +function () { +return new java.awt.geom.Point2D.Float (this.x2, this.y2); +}); +Clazz_defineMethod (c$, "setCurve", +function (a, b, c, d, e, f) { +this.x1 = a; +this.y1 = b; +this.ctrlx = c; +this.ctrly = d; +this.x2 = e; +this.y2 = f; +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setCurve", +function (a, b, c, d, e, f) { +this.x1 = a; +this.y1 = b; +this.ctrlx = c; +this.ctrly = d; +this.x2 = e; +this.y2 = f; +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a = Math.min (Math.min (this.x1, this.x2), this.ctrlx); +var b = Math.min (Math.min (this.y1, this.y2), this.ctrly); +var c = Math.max (Math.max (this.x1, this.x2), this.ctrlx); +var d = Math.max (Math.max (this.y1, this.y2), this.ctrly); +return new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b); +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x1 = 0; +this.y1 = 0; +this.ctrlx = 0; +this.ctrly = 0; +this.x2 = 0; +this.y2 = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.QuadCurve2D, "Double", java.awt.geom.QuadCurve2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Double, []); +}); +Clazz_makeConstructor (c$, +function (a, b, c, d, e, f) { +Clazz_superConstructor (this, java.awt.geom.QuadCurve2D.Double, []); +this.setCurve (a, b, c, d, e, f); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getX1", +function () { +return this.x1; +}); +Clazz_overrideMethod (c$, "getY1", +function () { +return this.y1; +}); +Clazz_overrideMethod (c$, "getP1", +function () { +return new java.awt.geom.Point2D.Double (this.x1, this.y1); +}); +Clazz_overrideMethod (c$, "getCtrlX", +function () { +return this.ctrlx; +}); +Clazz_overrideMethod (c$, "getCtrlY", +function () { +return this.ctrly; +}); +Clazz_overrideMethod (c$, "getCtrlPt", +function () { +return new java.awt.geom.Point2D.Double (this.ctrlx, this.ctrly); +}); +Clazz_overrideMethod (c$, "getX2", +function () { +return this.x2; +}); +Clazz_overrideMethod (c$, "getY2", +function () { +return this.y2; +}); +Clazz_overrideMethod (c$, "getP2", +function () { +return new java.awt.geom.Point2D.Double (this.x2, this.y2); +}); +Clazz_defineMethod (c$, "setCurve", +function (a, b, c, d, e, f) { +this.x1 = a; +this.y1 = b; +this.ctrlx = c; +this.ctrly = d; +this.x2 = e; +this.y2 = f; +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a = Math.min (Math.min (this.x1, this.x2), this.ctrlx); +var b = Math.min (Math.min (this.y1, this.y2), this.ctrly); +var c = Math.max (Math.max (this.x1, this.x2), this.ctrlx); +var d = Math.max (Math.max (this.y1, this.y2), this.ctrly); +return new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b); +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"BELOW", -2, +"LOWEDGE", -1, +"INSIDE", 0, +"HIGHEDGE", 1, +"ABOVE", 2); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.QuadIterator", ["java.util.NoSuchElementException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.quad = null; +this.affine = null; +this.index = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "QuadIterator", null, java.awt.geom.PathIterator); +Clazz_makeConstructor (c$, +function (q, at) { +this.quad = q; +this.affine = at; +}, "java.awt.geom.QuadCurve2D,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getWindingRule", +function () { +return 1; +}); +Clazz_overrideMethod (c$, "isDone", +function () { +return (this.index > 1); +}); +Clazz_overrideMethod (c$, "next", +function () { +this.index++; +}); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("quad iterator iterator out of bounds"); +}var type; +if (this.index == 0) { +coords[0] = this.quad.getX1 (); +coords[1] = this.quad.getY1 (); +type = 0; +} else { +coords[0] = this.quad.getCtrlX (); +coords[1] = this.quad.getCtrlY (); +coords[2] = this.quad.getX2 (); +coords[3] = this.quad.getY2 (); +type = 2; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 2); +}return type; +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("quad iterator iterator out of bounds"); +}var type; +if (this.index == 0) { +coords[0] = this.quad.getX1 (); +coords[1] = this.quad.getY1 (); +type = 0; +} else { +coords[0] = this.quad.getCtrlX (); +coords[1] = this.quad.getCtrlY (); +coords[2] = this.quad.getX2 (); +coords[3] = this.quad.getY2 (); +type = 2; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, this.index == 0 ? 1 : 2); +}return type; +}, "~A"); +}); +Clazz_declarePackage ("jssun.awt.geom"); +Clazz_load (null, "jssun.awt.geom.Curve", ["java.lang.Double", "$.InternalError", "java.awt.geom.IllegalPathStateException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.direction = 0; +Clazz_instantialize (this, arguments); +}, jssun.awt.geom, "Curve"); +c$.insertMove = Clazz_defineMethod (c$, "insertMove", +function (curves, x, y) { +curves.add ( new jssun.awt.geom.Order0 (x, y)); +}, "java.util.Vector,~N,~N"); +c$.insertLine = Clazz_defineMethod (c$, "insertLine", +function (curves, x0, y0, x1, y1) { +if (y0 < y1) { +curves.add ( new jssun.awt.geom.Order1 (x0, y0, x1, y1, 1)); +} else if (y0 > y1) { +curves.add ( new jssun.awt.geom.Order1 (x1, y1, x0, y0, -1)); +} else { +}}, "java.util.Vector,~N,~N,~N,~N"); +c$.insertQuad = Clazz_defineMethod (c$, "insertQuad", +function (curves, x0, y0, coords) { +var y1 = coords[3]; +if (y0 > y1) { +jssun.awt.geom.Order2.insert (curves, coords, coords[2], y1, coords[0], coords[1], x0, y0, -1); +} else if (y0 == y1 && y0 == coords[1]) { +return; +} else { +jssun.awt.geom.Order2.insert (curves, coords, x0, y0, coords[0], coords[1], coords[2], y1, 1); +}}, "java.util.Vector,~N,~N,~A"); +c$.insertCubic = Clazz_defineMethod (c$, "insertCubic", +function (curves, x0, y0, coords) { +var y1 = coords[5]; +if (y0 > y1) { +jssun.awt.geom.Order3.insert (curves, coords, coords[4], y1, coords[2], coords[3], coords[0], coords[1], x0, y0, -1); +} else if (y0 == y1 && y0 == coords[1] && y0 == coords[3]) { +return; +} else { +jssun.awt.geom.Order3.insert (curves, coords, x0, y0, coords[0], coords[1], coords[2], coords[3], coords[4], y1, 1); +}}, "java.util.Vector,~N,~N,~A"); +c$.pointCrossingsForPath = Clazz_defineMethod (c$, "pointCrossingsForPath", +function (pi, px, py) { +if (pi.isDone ()) { +return 0; +}var coords = Clazz_newDoubleArray (6, 0); +if (pi.currentSegment (coords) != 0) { +throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); +}pi.next (); +var movx = coords[0]; +var movy = coords[1]; +var curx = movx; +var cury = movy; +var endx; +var endy; +var crossings = 0; +while (!pi.isDone ()) { +switch (pi.currentSegment (coords)) { +case 0: +if (cury != movy) { +crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy); +}movx = curx = coords[0]; +movy = cury = coords[1]; +break; +case 1: +endx = coords[0]; +endy = coords[1]; +crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, endx, endy); +curx = endx; +cury = endy; +break; +case 2: +endx = coords[2]; +endy = coords[3]; +crossings += jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, curx, cury, coords[0], coords[1], endx, endy, 0); +curx = endx; +cury = endy; +break; +case 3: +endx = coords[4]; +endy = coords[5]; +crossings += jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0); +curx = endx; +cury = endy; +break; +case 4: +if (cury != movy) { +crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy); +}curx = movx; +cury = movy; +break; +} +pi.next (); +} +if (cury != movy) { +crossings += jssun.awt.geom.Curve.pointCrossingsForLine (px, py, curx, cury, movx, movy); +}return crossings; +}, "java.awt.geom.PathIterator,~N,~N"); +c$.pointCrossingsForLine = Clazz_defineMethod (c$, "pointCrossingsForLine", +function (px, py, x0, y0, x1, y1) { +if (py < y0 && py < y1) return 0; +if (py >= y0 && py >= y1) return 0; +if (px >= x0 && px >= x1) return 0; +if (px < x0 && px < x1) return (y0 < y1) ? 1 : -1; +var xintercept = x0 + (py - y0) * (x1 - x0) / (y1 - y0); +if (px >= xintercept) return 0; +return (y0 < y1) ? 1 : -1; +}, "~N,~N,~N,~N,~N,~N"); +c$.pointCrossingsForQuad = Clazz_defineMethod (c$, "pointCrossingsForQuad", +function (px, py, x0, y0, xc, yc, x1, y1, level) { +if (py < y0 && py < yc && py < y1) return 0; +if (py >= y0 && py >= yc && py >= y1) return 0; +if (px >= x0 && px >= xc && px >= x1) return 0; +if (px < x0 && px < xc && px < x1) { +if (py >= y0) { +if (py < y1) return 1; +} else { +if (py >= y1) return -1; +}return 0; +}if (level > 52) return jssun.awt.geom.Curve.pointCrossingsForLine (px, py, x0, y0, x1, y1); +var x0c = (x0 + xc) / 2; +var y0c = (y0 + yc) / 2; +var xc1 = (xc + x1) / 2; +var yc1 = (yc + y1) / 2; +xc = (x0c + xc1) / 2; +yc = (y0c + yc1) / 2; +if (Double.isNaN (xc) || Double.isNaN (yc)) { +return 0; +}return (jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, x0, y0, x0c, y0c, xc, yc, level + 1) + jssun.awt.geom.Curve.pointCrossingsForQuad (px, py, xc, yc, xc1, yc1, x1, y1, level + 1)); +}, "~N,~N,~N,~N,~N,~N,~N,~N,~N"); +c$.pointCrossingsForCubic = Clazz_defineMethod (c$, "pointCrossingsForCubic", +function (px, py, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) { +if (py < y0 && py < yc0 && py < yc1 && py < y1) return 0; +if (py >= y0 && py >= yc0 && py >= yc1 && py >= y1) return 0; +if (px >= x0 && px >= xc0 && px >= xc1 && px >= x1) return 0; +if (px < x0 && px < xc0 && px < xc1 && px < x1) { +if (py >= y0) { +if (py < y1) return 1; +} else { +if (py >= y1) return -1; +}return 0; +}if (level > 52) return jssun.awt.geom.Curve.pointCrossingsForLine (px, py, x0, y0, x1, y1); +var xmid = (xc0 + xc1) / 2; +var ymid = (yc0 + yc1) / 2; +xc0 = (x0 + xc0) / 2; +yc0 = (y0 + yc0) / 2; +xc1 = (xc1 + x1) / 2; +yc1 = (yc1 + y1) / 2; +var xc0m = (xc0 + xmid) / 2; +var yc0m = (yc0 + ymid) / 2; +var xmc1 = (xmid + xc1) / 2; +var ymc1 = (ymid + yc1) / 2; +xmid = (xc0m + xmc1) / 2; +ymid = (yc0m + ymc1) / 2; +if (Double.isNaN (xmid) || Double.isNaN (ymid)) { +return 0; +}return (jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1) + jssun.awt.geom.Curve.pointCrossingsForCubic (px, py, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1)); +}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); +c$.rectCrossingsForPath = Clazz_defineMethod (c$, "rectCrossingsForPath", +function (pi, rxmin, rymin, rxmax, rymax) { +if (rxmax <= rxmin || rymax <= rymin) { +return 0; +}if (pi.isDone ()) { +return 0; +}var coords = Clazz_newDoubleArray (6, 0); +if (pi.currentSegment (coords) != 0) { +throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); +}pi.next (); +var curx; +var cury; +var movx; +var movy; +var endx; +var endy; +curx = movx = coords[0]; +cury = movy = coords[1]; +var crossings = 0; +while (crossings != -2147483648 && !pi.isDone ()) { +switch (pi.currentSegment (coords)) { +case 0: +if (curx != movx || cury != movy) { +crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); +}movx = curx = coords[0]; +movy = cury = coords[1]; +break; +case 1: +endx = coords[0]; +endy = coords[1]; +crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, endx, endy); +curx = endx; +cury = endy; +break; +case 2: +endx = coords[2]; +endy = coords[3]; +crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], endx, endy, 0); +curx = endx; +cury = endy; +break; +case 3: +endx = coords[4]; +endy = coords[5]; +crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, curx, cury, coords[0], coords[1], coords[2], coords[3], endx, endy, 0); +curx = endx; +cury = endy; +break; +case 4: +if (curx != movx || cury != movy) { +crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); +}curx = movx; +cury = movy; +break; +} +pi.next (); +} +if (crossings != -2147483648 && (curx != movx || cury != movy)) { +crossings = jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, curx, cury, movx, movy); +}return crossings; +}, "java.awt.geom.PathIterator,~N,~N,~N,~N"); +c$.rectCrossingsForLine = Clazz_defineMethod (c$, "rectCrossingsForLine", +function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1) { +if (y0 >= rymax && y1 >= rymax) return crossings; +if (y0 <= rymin && y1 <= rymin) return crossings; +if (x0 <= rxmin && x1 <= rxmin) return crossings; +if (x0 >= rxmax && x1 >= rxmax) { +if (y0 < y1) { +if (y0 <= rymin) crossings++; +if (y1 >= rymax) crossings++; +} else if (y1 < y0) { +if (y1 <= rymin) crossings--; +if (y0 >= rymax) crossings--; +}return crossings; +}if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) { +return -2147483648; +}var xi0 = x0; +if (y0 < rymin) { +xi0 += ((rymin - y0) * (x1 - x0) / (y1 - y0)); +} else if (y0 > rymax) { +xi0 += ((rymax - y0) * (x1 - x0) / (y1 - y0)); +}var xi1 = x1; +if (y1 < rymin) { +xi1 += ((rymin - y1) * (x0 - x1) / (y0 - y1)); +} else if (y1 > rymax) { +xi1 += ((rymax - y1) * (x0 - x1) / (y0 - y1)); +}if (xi0 <= rxmin && xi1 <= rxmin) return crossings; +if (xi0 >= rxmax && xi1 >= rxmax) { +if (y0 < y1) { +if (y0 <= rymin) crossings++; +if (y1 >= rymax) crossings++; +} else if (y1 < y0) { +if (y1 <= rymin) crossings--; +if (y0 >= rymax) crossings--; +}return crossings; +}return -2147483648; +}, "~N,~N,~N,~N,~N,~N,~N,~N,~N"); +c$.rectCrossingsForQuad = Clazz_defineMethod (c$, "rectCrossingsForQuad", +function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc, yc, x1, y1, level) { +if (y0 >= rymax && yc >= rymax && y1 >= rymax) return crossings; +if (y0 <= rymin && yc <= rymin && y1 <= rymin) return crossings; +if (x0 <= rxmin && xc <= rxmin && x1 <= rxmin) return crossings; +if (x0 >= rxmax && xc >= rxmax && x1 >= rxmax) { +if (y0 < y1) { +if (y0 <= rymin && y1 > rymin) crossings++; +if (y0 < rymax && y1 >= rymax) crossings++; +} else if (y1 < y0) { +if (y1 <= rymin && y0 > rymin) crossings--; +if (y1 < rymax && y0 >= rymax) crossings--; +}return crossings; +}if ((x0 < rxmax && x0 > rxmin && y0 < rymax && y0 > rymin) || (x1 < rxmax && x1 > rxmin && y1 < rymax && y1 > rymin)) { +return -2147483648; +}if (level > 52) { +return jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1); +}var x0c = (x0 + xc) / 2; +var y0c = (y0 + yc) / 2; +var xc1 = (xc + x1) / 2; +var yc1 = (yc + y1) / 2; +xc = (x0c + xc1) / 2; +yc = (y0c + yc1) / 2; +if (Double.isNaN (xc) || Double.isNaN (yc)) { +return 0; +}crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x0c, y0c, xc, yc, level + 1); +if (crossings != -2147483648) { +crossings = jssun.awt.geom.Curve.rectCrossingsForQuad (crossings, rxmin, rymin, rxmax, rymax, xc, yc, xc1, yc1, x1, y1, level + 1); +}return crossings; +}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); +c$.rectCrossingsForCubic = Clazz_defineMethod (c$, "rectCrossingsForCubic", +function (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc1, yc1, x1, y1, level) { +if (y0 >= rymax && yc0 >= rymax && yc1 >= rymax && y1 >= rymax) { +return crossings; +}if (y0 <= rymin && yc0 <= rymin && yc1 <= rymin && y1 <= rymin) { +return crossings; +}if (x0 <= rxmin && xc0 <= rxmin && xc1 <= rxmin && x1 <= rxmin) { +return crossings; +}if (x0 >= rxmax && xc0 >= rxmax && xc1 >= rxmax && x1 >= rxmax) { +if (y0 < y1) { +if (y0 <= rymin && y1 > rymin) crossings++; +if (y0 < rymax && y1 >= rymax) crossings++; +} else if (y1 < y0) { +if (y1 <= rymin && y0 > rymin) crossings--; +if (y1 < rymax && y0 >= rymax) crossings--; +}return crossings; +}if ((x0 > rxmin && x0 < rxmax && y0 > rymin && y0 < rymax) || (x1 > rxmin && x1 < rxmax && y1 > rymin && y1 < rymax)) { +return -2147483648; +}if (level > 52) { +return jssun.awt.geom.Curve.rectCrossingsForLine (crossings, rxmin, rymin, rxmax, rymax, x0, y0, x1, y1); +}var xmid = (xc0 + xc1) / 2; +var ymid = (yc0 + yc1) / 2; +xc0 = (x0 + xc0) / 2; +yc0 = (y0 + yc0) / 2; +xc1 = (xc1 + x1) / 2; +yc1 = (yc1 + y1) / 2; +var xc0m = (xc0 + xmid) / 2; +var yc0m = (yc0 + ymid) / 2; +var xmc1 = (xmid + xc1) / 2; +var ymc1 = (ymid + yc1) / 2; +xmid = (xc0m + xmc1) / 2; +ymid = (yc0m + ymc1) / 2; +if (Double.isNaN (xmid) || Double.isNaN (ymid)) { +return 0; +}crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, x0, y0, xc0, yc0, xc0m, yc0m, xmid, ymid, level + 1); +if (crossings != -2147483648) { +crossings = jssun.awt.geom.Curve.rectCrossingsForCubic (crossings, rxmin, rymin, rxmax, rymax, xmid, ymid, xmc1, ymc1, xc1, yc1, x1, y1, level + 1); +}return crossings; +}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (direction) { +this.direction = direction; +}, "~N"); +Clazz_defineMethod (c$, "getDirection", +function () { +return this.direction; +}); +Clazz_defineMethod (c$, "getWithDirection", +function (direction) { +return (this.direction == direction ? this : this.getReversedCurve ()); +}, "~N"); +c$.round = Clazz_defineMethod (c$, "round", +function (v) { +return v; +}, "~N"); +c$.orderof = Clazz_defineMethod (c$, "orderof", +function (x1, x2) { +if (x1 < x2) { +return -1; +}if (x1 > x2) { +return 1; +}return 0; +}, "~N,~N"); +c$.signeddiffbits = Clazz_defineMethod (c$, "signeddiffbits", +function (y1, y2) { +return (Double.doubleToLongBits (y1) - Double.doubleToLongBits (y2)); +}, "~N,~N"); +c$.diffbits = Clazz_defineMethod (c$, "diffbits", +function (y1, y2) { +return Math.abs (Double.doubleToLongBits (y1) - Double.doubleToLongBits (y2)); +}, "~N,~N"); +c$.prev = Clazz_defineMethod (c$, "prev", +function (v) { +return Double.longBitsToDouble (Double.doubleToLongBits (v) - 1); +}, "~N"); +c$.next = Clazz_defineMethod (c$, "next", +function (v) { +return Double.longBitsToDouble (Double.doubleToLongBits (v) + 1); +}, "~N"); +Clazz_overrideMethod (c$, "toString", +function () { +return ("Curve[" + this.getOrder () + ", " + ("(" + jssun.awt.geom.Curve.round (this.getX0 ()) + ", " + jssun.awt.geom.Curve.round (this.getY0 ()) + "), ") + this.controlPointString () + ("(" + jssun.awt.geom.Curve.round (this.getX1 ()) + ", " + jssun.awt.geom.Curve.round (this.getY1 ()) + "), ") + (this.direction == 1 ? "D" : "U") + "]"); +}); +Clazz_defineMethod (c$, "controlPointString", +function () { +return ""; +}); +Clazz_defineMethod (c$, "crossingsFor", +function (x, y) { +if (y >= this.getYTop () && y < this.getYBot ()) { +if (x < this.getXMax () && (x < this.getXMin () || x < this.XforY (y))) { +return 1; +}}return 0; +}, "~N,~N"); +Clazz_defineMethod (c$, "accumulateCrossings", +function (c) { +var xhi = c.getXHi (); +if (this.getXMin () >= xhi) { +return false; +}var xlo = c.getXLo (); +var ylo = c.getYLo (); +var yhi = c.getYHi (); +var y0 = this.getYTop (); +var y1 = this.getYBot (); +var tstart; +var ystart; +var tend; +var yend; +if (y0 < ylo) { +if (y1 <= ylo) { +return false; +}ystart = ylo; +tstart = this.TforY (ylo); +} else { +if (y0 >= yhi) { +return false; +}ystart = y0; +tstart = 0; +}if (y1 > yhi) { +yend = yhi; +tend = this.TforY (yhi); +} else { +yend = y1; +tend = 1; +}var hitLo = false; +var hitHi = false; +while (true) { +var x = this.XforT (tstart); +if (x < xhi) { +if (hitHi || x > xlo) { +return true; +}hitLo = true; +} else { +if (hitLo) { +return true; +}hitHi = true; +}if (tstart >= tend) { +break; +}tstart = this.nextVertical (tstart, tend); +} +if (hitLo) { +c.record (ystart, yend, this.direction); +}return false; +}, "jssun.awt.geom.Crossings"); +Clazz_defineMethod (c$, "getSubCurve", +function (ystart, yend) { +return this.getSubCurve (ystart, yend, this.direction); +}, "~N,~N"); +Clazz_defineMethod (c$, "compareTo", +function (that, yrange) { +var y0 = yrange[0]; +var y1 = yrange[1]; +y1 = Math.min (Math.min (y1, this.getYBot ()), that.getYBot ()); +if (y1 <= yrange[0]) { +System.err.println ("this == " + this); +System.err.println ("that == " + that); +System.out.println ("target range = " + yrange[0] + "=>" + yrange[1]); +throw new InternalError ("backstepping from " + yrange[0] + " to " + y1); +}yrange[1] = y1; +if (this.getXMax () <= that.getXMin ()) { +if (this.getXMin () == that.getXMax ()) { +return 0; +}return -1; +}if (this.getXMin () >= that.getXMax ()) { +return 1; +}var s0 = this.TforY (y0); +var ys0 = this.YforT (s0); +if (ys0 < y0) { +s0 = this.refineTforY (s0, ys0, y0); +ys0 = this.YforT (s0); +}var s1 = this.TforY (y1); +if (this.YforT (s1) < y0) { +s1 = this.refineTforY (s1, this.YforT (s1), y0); +}var t0 = that.TforY (y0); +var yt0 = that.YforT (t0); +if (yt0 < y0) { +t0 = that.refineTforY (t0, yt0, y0); +yt0 = that.YforT (t0); +}var t1 = that.TforY (y1); +if (that.YforT (t1) < y0) { +t1 = that.refineTforY (t1, that.YforT (t1), y0); +}var xs0 = this.XforT (s0); +var xt0 = that.XforT (t0); +var scale = Math.max (Math.abs (y0), Math.abs (y1)); +var ymin = Math.max (scale * 1E-14, 1E-300); +if (this.fairlyClose (xs0, xt0)) { +var bump = ymin; +var maxbump = Math.min (ymin * 1E13, (y1 - y0) * .1); +var y = y0 + bump; +while (y <= y1) { +if (this.fairlyClose (this.XforY (y), that.XforY (y))) { +if ((bump *= 2) > maxbump) { +bump = maxbump; +}} else { +y -= bump; +while (true) { +bump /= 2; +var newy = y + bump; +if (newy <= y) { +break; +}if (this.fairlyClose (this.XforY (newy), that.XforY (newy))) { +y = newy; +}} +break; +}y += bump; +} +if (y > y0) { +if (y < y1) { +yrange[1] = y; +}return 0; +}}if (ymin <= 0) { +System.out.println ("ymin = " + ymin); +}while (s0 < s1 && t0 < t1) { +var sh = this.nextVertical (s0, s1); +var xsh = this.XforT (sh); +var ysh = this.YforT (sh); +var th = that.nextVertical (t0, t1); +var xth = that.XforT (th); +var yth = that.YforT (th); +try { +if (this.findIntersect (that, yrange, ymin, 0, 0, s0, xs0, ys0, sh, xsh, ysh, t0, xt0, yt0, th, xth, yth)) { +break; +}} catch (t) { +System.err.println ("Error: " + t); +System.err.println ("y range was " + yrange[0] + "=>" + yrange[1]); +System.err.println ("s y range is " + ys0 + "=>" + ysh); +System.err.println ("t y range is " + yt0 + "=>" + yth); +System.err.println ("ymin is " + ymin); +return 0; +} +if (ysh < yth) { +if (ysh > yrange[0]) { +if (ysh < yrange[1]) { +yrange[1] = ysh; +}break; +}s0 = sh; +xs0 = xsh; +ys0 = ysh; +} else { +if (yth > yrange[0]) { +if (yth < yrange[1]) { +yrange[1] = yth; +}break; +}t0 = th; +xt0 = xth; +yt0 = yth; +}} +var ymid = (yrange[0] + yrange[1]) / 2; +return jssun.awt.geom.Curve.orderof (this.XforY (ymid), that.XforY (ymid)); +}, "jssun.awt.geom.Curve,~A"); +Clazz_defineMethod (c$, "findIntersect", +function (that, yrange, ymin, slevel, tlevel, s0, xs0, ys0, s1, xs1, ys1, t0, xt0, yt0, t1, xt1, yt1) { +if (ys0 > yt1 || yt0 > ys1) { +return false; +}if (Math.min (xs0, xs1) > Math.max (xt0, xt1) || Math.max (xs0, xs1) < Math.min (xt0, xt1)) { +return false; +}if (s1 - s0 > 0.001) { +var s = (s0 + s1) / 2; +var xs = this.XforT (s); +var ys = this.YforT (s); +if (s == s0 || s == s1) { +System.out.println ("s0 = " + s0); +System.out.println ("s1 = " + s1); +throw new InternalError ("no s progress!"); +}if (t1 - t0 > 0.001) { +var t = (t0 + t1) / 2; +var xt = that.XforT (t); +var yt = that.YforT (t); +if (t == t0 || t == t1) { +System.out.println ("t0 = " + t0); +System.out.println ("t1 = " + t1); +throw new InternalError ("no t progress!"); +}if (ys >= yt0 && yt >= ys0) { +if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s0, xs0, ys0, s, xs, ys, t0, xt0, yt0, t, xt, yt)) { +return true; +}}if (ys >= yt) { +if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s0, xs0, ys0, s, xs, ys, t, xt, yt, t1, xt1, yt1)) { +return true; +}}if (yt >= ys) { +if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s, xs, ys, s1, xs1, ys1, t0, xt0, yt0, t, xt, yt)) { +return true; +}}if (ys1 >= yt && yt1 >= ys) { +if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel + 1, s, xs, ys, s1, xs1, ys1, t, xt, yt, t1, xt1, yt1)) { +return true; +}}} else { +if (ys >= yt0) { +if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel, s0, xs0, ys0, s, xs, ys, t0, xt0, yt0, t1, xt1, yt1)) { +return true; +}}if (yt1 >= ys) { +if (this.findIntersect (that, yrange, ymin, slevel + 1, tlevel, s, xs, ys, s1, xs1, ys1, t0, xt0, yt0, t1, xt1, yt1)) { +return true; +}}}} else if (t1 - t0 > 0.001) { +var t = (t0 + t1) / 2; +var xt = that.XforT (t); +var yt = that.YforT (t); +if (t == t0 || t == t1) { +System.out.println ("t0 = " + t0); +System.out.println ("t1 = " + t1); +throw new InternalError ("no t progress!"); +}if (yt >= ys0) { +if (this.findIntersect (that, yrange, ymin, slevel, tlevel + 1, s0, xs0, ys0, s1, xs1, ys1, t0, xt0, yt0, t, xt, yt)) { +return true; +}}if (ys1 >= yt) { +if (this.findIntersect (that, yrange, ymin, slevel, tlevel + 1, s0, xs0, ys0, s1, xs1, ys1, t, xt, yt, t1, xt1, yt1)) { +return true; +}}} else { +var xlk = xs1 - xs0; +var ylk = ys1 - ys0; +var xnm = xt1 - xt0; +var ynm = yt1 - yt0; +var xmk = xt0 - xs0; +var ymk = yt0 - ys0; +var det = xnm * ylk - ynm * xlk; +if (det != 0) { +var detinv = 1 / det; +var s = (xnm * ymk - ynm * xmk) * detinv; +var t = (xlk * ymk - ylk * xmk) * detinv; +if (s >= 0 && s <= 1 && t >= 0 && t <= 1) { +s = s0 + s * (s1 - s0); +t = t0 + t * (t1 - t0); +if (s < 0 || s > 1 || t < 0 || t > 1) { +System.out.println ("Uh oh!"); +}var y = (this.YforT (s) + that.YforT (t)) / 2; +if (y <= yrange[1] && y > yrange[0]) { +yrange[1] = y; +return true; +}}}}return false; +}, "jssun.awt.geom.Curve,~A,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "refineTforY", +function (t0, yt0, y0) { +var t1 = 1; +while (true) { +var th = (t0 + t1) / 2; +if (th == t0 || th == t1) { +return t1; +}var y = this.YforT (th); +if (y < y0) { +t0 = th; +yt0 = y; +} else if (y > y0) { +t1 = th; +} else { +return t1; +}} +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "fairlyClose", +function (v1, v2) { +return (Math.abs (v1 - v2) < Math.max (Math.abs (v1), Math.abs (v2)) * 1E-10); +}, "~N,~N"); +Clazz_defineStatics (c$, +"INCREASING", 1, +"DECREASING", -1, +"RECT_INTERSECTS", 0x80000000, +"TMIN", 1E-3); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.lang.RuntimeException"], "java.awt.geom.IllegalPathStateException", null, function () { +c$ = Clazz_declareType (java.awt.geom, "IllegalPathStateException", RuntimeException); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.IllegalPathStateException, []); +}); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.geom.PathIterator"], "java.awt.geom.RectIterator", ["java.util.NoSuchElementException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.w = 0; +this.h = 0; +this.affine = null; +this.index = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "RectIterator", null, java.awt.geom.PathIterator); +Clazz_makeConstructor (c$, +function (r, at) { +this.x = r.getX (); +this.y = r.getY (); +this.w = r.getWidth (); +this.h = r.getHeight (); +this.affine = at; +if (this.w < 0 || this.h < 0) { +this.index = 6; +}}, "java.awt.geom.Rectangle2D,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getWindingRule", +function () { +return 1; +}); +Clazz_overrideMethod (c$, "isDone", +function () { +return this.index > 5; +}); +Clazz_overrideMethod (c$, "next", +function () { +this.index++; +}); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("rect iterator out of bounds"); +}if (this.index == 5) { +return 4; +}coords[0] = this.x; +coords[1] = this.y; +if (this.index == 1 || this.index == 2) { +coords[0] += this.w; +}if (this.index == 2 || this.index == 3) { +coords[1] += this.h; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, 1); +}return (this.index == 0 ? 0 : 1); +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (coords) { +if (this.isDone ()) { +throw new java.util.NoSuchElementException ("rect iterator out of bounds"); +}if (this.index == 5) { +return 4; +}coords[0] = this.x; +coords[1] = this.y; +if (this.index == 1 || this.index == 2) { +coords[0] += this.w; +}if (this.index == 2 || this.index == 3) { +coords[1] += this.h; +}if (this.affine != null) { +this.affine.transform (coords, 0, coords, 0, 1); +}return (this.index == 0 ? 0 : 1); +}, "~A"); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.AWTEvent"], "java.awt.event.ActionEvent", ["java.awt.event.KeyEvent"], function () { +c$ = Clazz_decorateAsClass (function () { +this.actionCommand = null; +this.when = 0; +this.modifiers = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "ActionEvent", java.awt.AWTEvent); +Clazz_makeConstructor (c$, +function (source, id, command) { +this.construct (source, id, command, 0); +}, "~O,~N,~S"); +Clazz_makeConstructor (c$, +function (source, id, command, modifiers) { +this.construct (source, id, command, 0, modifiers); +}, "~O,~N,~S,~N"); +Clazz_makeConstructor (c$, +function (source, id, command, when, modifiers) { +Clazz_superConstructor (this, java.awt.event.ActionEvent, [source, id]); +this.actionCommand = command; +this.when = when; +this.modifiers = modifiers; +}, "~O,~N,~S,~N,~N"); +Clazz_defineMethod (c$, "getActionCommand", +function () { +return this.actionCommand; +}); +Clazz_defineMethod (c$, "getWhen", +function () { +return this.when; +}); +Clazz_defineMethod (c$, "getModifiers", +function () { +return this.modifiers; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 1001: +typeStr = "ACTION_PERFORMED"; +break; +default: +typeStr = "unknown type"; +} +return typeStr + ",cmd=" + this.actionCommand + ",when=" + this.when + ",modifiers=" + java.awt.event.KeyEvent.getKeyModifiersText (this.modifiers); +}); +Clazz_defineStatics (c$, +"SHIFT_MASK", 1, +"CTRL_MASK", 2, +"META_MASK", 4, +"ALT_MASK", 8, +"ACTION_FIRST", 1001, +"ACTION_LAST", 1001, +"ACTION_PERFORMED", 1001); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.InputEvent"], "java.awt.event.KeyEvent", ["java.lang.IllegalArgumentException", "$.StringBuilder", "java.awt.Toolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.isProxyActive = false; +this.keyCode = 0; +this.keyChar = '\0'; +this.keyLocation = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "KeyEvent", java.awt.event.InputEvent); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, keyCode, keyChar, keyLocation) { +Clazz_superConstructor (this, java.awt.event.KeyEvent, [source, id, when, modifiers]); +if (id == 400) { +if (keyChar == '\uffff') { +throw new IllegalArgumentException ("invalid keyChar"); +}if (keyCode != 0) { +throw new IllegalArgumentException ("invalid keyCode"); +}if (keyLocation != 0) { +throw new IllegalArgumentException ("invalid keyLocation"); +}}this.keyCode = keyCode; +this.keyChar = keyChar; +if ((keyLocation < 0) || (keyLocation > 4)) { +throw new IllegalArgumentException ("invalid keyLocation"); +}this.keyLocation = keyLocation; +if ((this.getModifiers () != 0) && (this.getModifiersEx () == 0)) { +this.setNewModifiers (); +} else if ((this.getModifiers () == 0) && (this.getModifiersEx () != 0)) { +this.setOldModifiers (); +}}, "java.awt.Component,~N,~N,~N,~N,~S,~N"); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, keyCode, keyChar) { +this.construct (source, id, when, modifiers, keyCode, keyChar, 0); +}, "java.awt.Component,~N,~N,~N,~N,~S"); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, keyCode) { +this.construct (source, id, when, modifiers, keyCode, String.fromCharCode (keyCode)); +}, "java.awt.Component,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getKeyCode", +function () { +return this.keyCode; +}); +Clazz_defineMethod (c$, "setKeyCode", +function (keyCode) { +this.keyCode = keyCode; +}, "~N"); +Clazz_defineMethod (c$, "getKeyChar", +function () { +return this.keyChar; +}); +Clazz_defineMethod (c$, "setKeyChar", +function (keyChar) { +this.keyChar = keyChar; +}, "~S"); +Clazz_defineMethod (c$, "setModifiers", +function (modifiers) { +this.modifiers = modifiers; +if ((this.getModifiers () != 0) && (this.getModifiersEx () == 0)) { +this.setNewModifiers (); +} else if ((this.getModifiers () == 0) && (this.getModifiersEx () != 0)) { +this.setOldModifiers (); +}}, "~N"); +Clazz_defineMethod (c$, "getKeyLocation", +function () { +return this.keyLocation; +}); +c$.getKeyText = Clazz_defineMethod (c$, "getKeyText", +function (keyCode) { +if (keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90) { +return String.valueOf (String.fromCharCode (keyCode)); +}switch (keyCode) { +case 10: +return java.awt.Toolkit.getProperty ("AWT.enter", "Enter"); +case 8: +return java.awt.Toolkit.getProperty ("AWT.backSpace", "Backspace"); +case 9: +return java.awt.Toolkit.getProperty ("AWT.tab", "Tab"); +case 3: +return java.awt.Toolkit.getProperty ("AWT.cancel", "Cancel"); +case 12: +return java.awt.Toolkit.getProperty ("AWT.clear", "Clear"); +case 65312: +return java.awt.Toolkit.getProperty ("AWT.compose", "Compose"); +case 19: +return java.awt.Toolkit.getProperty ("AWT.pause", "Pause"); +case 20: +return java.awt.Toolkit.getProperty ("AWT.capsLock", "Caps Lock"); +case 27: +return java.awt.Toolkit.getProperty ("AWT.escape", "Escape"); +case 32: +return java.awt.Toolkit.getProperty ("AWT.space", "Space"); +case 33: +return java.awt.Toolkit.getProperty ("AWT.pgup", "Page Up"); +case 34: +return java.awt.Toolkit.getProperty ("AWT.pgdn", "Page Down"); +case 35: +return java.awt.Toolkit.getProperty ("AWT.end", "End"); +case 36: +return java.awt.Toolkit.getProperty ("AWT.home", "Home"); +case 37: +return java.awt.Toolkit.getProperty ("AWT.left", "Left"); +case 38: +return java.awt.Toolkit.getProperty ("AWT.up", "Up"); +case 39: +return java.awt.Toolkit.getProperty ("AWT.right", "Right"); +case 40: +return java.awt.Toolkit.getProperty ("AWT.down", "Down"); +case 65368: +return java.awt.Toolkit.getProperty ("AWT.begin", "Begin"); +case 16: +return java.awt.Toolkit.getProperty ("AWT.shift", "Shift"); +case 17: +return java.awt.Toolkit.getProperty ("AWT.control", "Control"); +case 18: +return java.awt.Toolkit.getProperty ("AWT.alt", "Alt"); +case 157: +return java.awt.Toolkit.getProperty ("AWT.meta", "Meta"); +case 65406: +return java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph"); +case 44: +return java.awt.Toolkit.getProperty ("AWT.comma", "Comma"); +case 46: +return java.awt.Toolkit.getProperty ("AWT.period", "Period"); +case 47: +return java.awt.Toolkit.getProperty ("AWT.slash", "Slash"); +case 59: +return java.awt.Toolkit.getProperty ("AWT.semicolon", "Semicolon"); +case 61: +return java.awt.Toolkit.getProperty ("AWT.equals", "Equals"); +case 91: +return java.awt.Toolkit.getProperty ("AWT.openBracket", "Open Bracket"); +case 92: +return java.awt.Toolkit.getProperty ("AWT.backSlash", "Back Slash"); +case 93: +return java.awt.Toolkit.getProperty ("AWT.closeBracket", "Close Bracket"); +case 106: +return java.awt.Toolkit.getProperty ("AWT.multiply", "NumPad *"); +case 107: +return java.awt.Toolkit.getProperty ("AWT.add", "NumPad +"); +case 108: +return java.awt.Toolkit.getProperty ("AWT.separator", "NumPad ,"); +case 109: +return java.awt.Toolkit.getProperty ("AWT.subtract", "NumPad -"); +case 110: +return java.awt.Toolkit.getProperty ("AWT.decimal", "NumPad ."); +case 111: +return java.awt.Toolkit.getProperty ("AWT.divide", "NumPad /"); +case 127: +return java.awt.Toolkit.getProperty ("AWT.delete", "Delete"); +case 144: +return java.awt.Toolkit.getProperty ("AWT.numLock", "Num Lock"); +case 145: +return java.awt.Toolkit.getProperty ("AWT.scrollLock", "Scroll Lock"); +case 524: +return java.awt.Toolkit.getProperty ("AWT.windows", "Windows"); +case 525: +return java.awt.Toolkit.getProperty ("AWT.context", "Context Menu"); +case 112: +return java.awt.Toolkit.getProperty ("AWT.f1", "F1"); +case 113: +return java.awt.Toolkit.getProperty ("AWT.f2", "F2"); +case 114: +return java.awt.Toolkit.getProperty ("AWT.f3", "F3"); +case 115: +return java.awt.Toolkit.getProperty ("AWT.f4", "F4"); +case 116: +return java.awt.Toolkit.getProperty ("AWT.f5", "F5"); +case 117: +return java.awt.Toolkit.getProperty ("AWT.f6", "F6"); +case 118: +return java.awt.Toolkit.getProperty ("AWT.f7", "F7"); +case 119: +return java.awt.Toolkit.getProperty ("AWT.f8", "F8"); +case 120: +return java.awt.Toolkit.getProperty ("AWT.f9", "F9"); +case 121: +return java.awt.Toolkit.getProperty ("AWT.f10", "F10"); +case 122: +return java.awt.Toolkit.getProperty ("AWT.f11", "F11"); +case 123: +return java.awt.Toolkit.getProperty ("AWT.f12", "F12"); +case 61440: +return java.awt.Toolkit.getProperty ("AWT.f13", "F13"); +case 61441: +return java.awt.Toolkit.getProperty ("AWT.f14", "F14"); +case 61442: +return java.awt.Toolkit.getProperty ("AWT.f15", "F15"); +case 61443: +return java.awt.Toolkit.getProperty ("AWT.f16", "F16"); +case 61444: +return java.awt.Toolkit.getProperty ("AWT.f17", "F17"); +case 61445: +return java.awt.Toolkit.getProperty ("AWT.f18", "F18"); +case 61446: +return java.awt.Toolkit.getProperty ("AWT.f19", "F19"); +case 61447: +return java.awt.Toolkit.getProperty ("AWT.f20", "F20"); +case 61448: +return java.awt.Toolkit.getProperty ("AWT.f21", "F21"); +case 61449: +return java.awt.Toolkit.getProperty ("AWT.f22", "F22"); +case 61450: +return java.awt.Toolkit.getProperty ("AWT.f23", "F23"); +case 61451: +return java.awt.Toolkit.getProperty ("AWT.f24", "F24"); +case 154: +return java.awt.Toolkit.getProperty ("AWT.printScreen", "Print Screen"); +case 155: +return java.awt.Toolkit.getProperty ("AWT.insert", "Insert"); +case 156: +return java.awt.Toolkit.getProperty ("AWT.help", "Help"); +case 192: +return java.awt.Toolkit.getProperty ("AWT.backQuote", "Back Quote"); +case 222: +return java.awt.Toolkit.getProperty ("AWT.quote", "Quote"); +case 224: +return java.awt.Toolkit.getProperty ("AWT.up", "Up"); +case 225: +return java.awt.Toolkit.getProperty ("AWT.down", "Down"); +case 226: +return java.awt.Toolkit.getProperty ("AWT.left", "Left"); +case 227: +return java.awt.Toolkit.getProperty ("AWT.right", "Right"); +case 128: +return java.awt.Toolkit.getProperty ("AWT.deadGrave", "Dead Grave"); +case 129: +return java.awt.Toolkit.getProperty ("AWT.deadAcute", "Dead Acute"); +case 130: +return java.awt.Toolkit.getProperty ("AWT.deadCircumflex", "Dead Circumflex"); +case 131: +return java.awt.Toolkit.getProperty ("AWT.deadTilde", "Dead Tilde"); +case 132: +return java.awt.Toolkit.getProperty ("AWT.deadMacron", "Dead Macron"); +case 133: +return java.awt.Toolkit.getProperty ("AWT.deadBreve", "Dead Breve"); +case 134: +return java.awt.Toolkit.getProperty ("AWT.deadAboveDot", "Dead Above Dot"); +case 135: +return java.awt.Toolkit.getProperty ("AWT.deadDiaeresis", "Dead Diaeresis"); +case 136: +return java.awt.Toolkit.getProperty ("AWT.deadAboveRing", "Dead Above Ring"); +case 137: +return java.awt.Toolkit.getProperty ("AWT.deadDoubleAcute", "Dead Double Acute"); +case 138: +return java.awt.Toolkit.getProperty ("AWT.deadCaron", "Dead Caron"); +case 139: +return java.awt.Toolkit.getProperty ("AWT.deadCedilla", "Dead Cedilla"); +case 140: +return java.awt.Toolkit.getProperty ("AWT.deadOgonek", "Dead Ogonek"); +case 141: +return java.awt.Toolkit.getProperty ("AWT.deadIota", "Dead Iota"); +case 142: +return java.awt.Toolkit.getProperty ("AWT.deadVoicedSound", "Dead Voiced Sound"); +case 143: +return java.awt.Toolkit.getProperty ("AWT.deadSemivoicedSound", "Dead Semivoiced Sound"); +case 150: +return java.awt.Toolkit.getProperty ("AWT.ampersand", "Ampersand"); +case 151: +return java.awt.Toolkit.getProperty ("AWT.asterisk", "Asterisk"); +case 152: +return java.awt.Toolkit.getProperty ("AWT.quoteDbl", "Double Quote"); +case 153: +return java.awt.Toolkit.getProperty ("AWT.Less", "Less"); +case 160: +return java.awt.Toolkit.getProperty ("AWT.greater", "Greater"); +case 161: +return java.awt.Toolkit.getProperty ("AWT.braceLeft", "Left Brace"); +case 162: +return java.awt.Toolkit.getProperty ("AWT.braceRight", "Right Brace"); +case 512: +return java.awt.Toolkit.getProperty ("AWT.at", "At"); +case 513: +return java.awt.Toolkit.getProperty ("AWT.colon", "Colon"); +case 514: +return java.awt.Toolkit.getProperty ("AWT.circumflex", "Circumflex"); +case 515: +return java.awt.Toolkit.getProperty ("AWT.dollar", "Dollar"); +case 516: +return java.awt.Toolkit.getProperty ("AWT.euro", "Euro"); +case 517: +return java.awt.Toolkit.getProperty ("AWT.exclamationMark", "Exclamation Mark"); +case 518: +return java.awt.Toolkit.getProperty ("AWT.invertedExclamationMark", "Inverted Exclamation Mark"); +case 519: +return java.awt.Toolkit.getProperty ("AWT.leftParenthesis", "Left Parenthesis"); +case 520: +return java.awt.Toolkit.getProperty ("AWT.numberSign", "Number Sign"); +case 45: +return java.awt.Toolkit.getProperty ("AWT.minus", "Minus"); +case 521: +return java.awt.Toolkit.getProperty ("AWT.plus", "Plus"); +case 522: +return java.awt.Toolkit.getProperty ("AWT.rightParenthesis", "Right Parenthesis"); +case 523: +return java.awt.Toolkit.getProperty ("AWT.underscore", "Underscore"); +case 24: +return java.awt.Toolkit.getProperty ("AWT.final", "Final"); +case 28: +return java.awt.Toolkit.getProperty ("AWT.convert", "Convert"); +case 29: +return java.awt.Toolkit.getProperty ("AWT.noconvert", "No Convert"); +case 30: +return java.awt.Toolkit.getProperty ("AWT.accept", "Accept"); +case 31: +return java.awt.Toolkit.getProperty ("AWT.modechange", "Mode Change"); +case 21: +return java.awt.Toolkit.getProperty ("AWT.kana", "Kana"); +case 25: +return java.awt.Toolkit.getProperty ("AWT.kanji", "Kanji"); +case 240: +return java.awt.Toolkit.getProperty ("AWT.alphanumeric", "Alphanumeric"); +case 241: +return java.awt.Toolkit.getProperty ("AWT.katakana", "Katakana"); +case 242: +return java.awt.Toolkit.getProperty ("AWT.hiragana", "Hiragana"); +case 243: +return java.awt.Toolkit.getProperty ("AWT.fullWidth", "Full-Width"); +case 244: +return java.awt.Toolkit.getProperty ("AWT.halfWidth", "Half-Width"); +case 245: +return java.awt.Toolkit.getProperty ("AWT.romanCharacters", "Roman Characters"); +case 256: +return java.awt.Toolkit.getProperty ("AWT.allCandidates", "All Candidates"); +case 257: +return java.awt.Toolkit.getProperty ("AWT.previousCandidate", "Previous Candidate"); +case 258: +return java.awt.Toolkit.getProperty ("AWT.codeInput", "Code Input"); +case 259: +return java.awt.Toolkit.getProperty ("AWT.japaneseKatakana", "Japanese Katakana"); +case 260: +return java.awt.Toolkit.getProperty ("AWT.japaneseHiragana", "Japanese Hiragana"); +case 261: +return java.awt.Toolkit.getProperty ("AWT.japaneseRoman", "Japanese Roman"); +case 262: +return java.awt.Toolkit.getProperty ("AWT.kanaLock", "Kana Lock"); +case 263: +return java.awt.Toolkit.getProperty ("AWT.inputMethodOnOff", "Input Method On/Off"); +case 65481: +return java.awt.Toolkit.getProperty ("AWT.again", "Again"); +case 65483: +return java.awt.Toolkit.getProperty ("AWT.undo", "Undo"); +case 65485: +return java.awt.Toolkit.getProperty ("AWT.copy", "Copy"); +case 65487: +return java.awt.Toolkit.getProperty ("AWT.paste", "Paste"); +case 65489: +return java.awt.Toolkit.getProperty ("AWT.cut", "Cut"); +case 65488: +return java.awt.Toolkit.getProperty ("AWT.find", "Find"); +case 65482: +return java.awt.Toolkit.getProperty ("AWT.props", "Props"); +case 65480: +return java.awt.Toolkit.getProperty ("AWT.stop", "Stop"); +} +if (keyCode >= 96 && keyCode <= 105) { +var numpad = java.awt.Toolkit.getProperty ("AWT.numpad", "NumPad"); +var c = String.fromCharCode (keyCode - 96 + 48); +return numpad + "-" + c; +}var unknown = java.awt.Toolkit.getProperty ("AWT.unknown", "Unknown"); +return unknown + " keyCode: 0x" + Integer.toString (keyCode, 16); +}, "~N"); +c$.getKeyModifiersText = Clazz_defineMethod (c$, "getKeyModifiersText", +function (modifiers) { +var buf = new StringBuilder (); +if ((modifiers & 4) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.meta", "Meta")); +buf.append ("+"); +}if ((modifiers & 2) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.control", "Ctrl")); +buf.append ("+"); +}if ((modifiers & 8) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.alt", "Alt")); +buf.append ("+"); +}if ((modifiers & 1) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.shift", "Shift")); +buf.append ("+"); +}if ((modifiers & 32) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph")); +buf.append ("+"); +}if ((modifiers & 16) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button1", "Button1")); +buf.append ("+"); +}if (buf.length () > 0) { +buf.setLength (buf.length () - 1); +}return buf.toString (); +}, "~N"); +Clazz_defineMethod (c$, "isActionKey", +function () { +switch (this.keyCode) { +case 36: +case 35: +case 33: +case 34: +case 38: +case 40: +case 37: +case 39: +case 65368: +case 226: +case 224: +case 227: +case 225: +case 112: +case 113: +case 114: +case 115: +case 116: +case 117: +case 118: +case 119: +case 120: +case 121: +case 122: +case 123: +case 61440: +case 61441: +case 61442: +case 61443: +case 61444: +case 61445: +case 61446: +case 61447: +case 61448: +case 61449: +case 61450: +case 61451: +case 154: +case 145: +case 20: +case 144: +case 19: +case 155: +case 24: +case 28: +case 29: +case 30: +case 31: +case 21: +case 25: +case 240: +case 241: +case 242: +case 243: +case 244: +case 245: +case 256: +case 257: +case 258: +case 259: +case 260: +case 261: +case 262: +case 263: +case 65481: +case 65483: +case 65485: +case 65487: +case 65489: +case 65488: +case 65482: +case 65480: +case 156: +case 524: +case 525: +return true; +} +return false; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var str = new StringBuilder (100); +switch (this.id) { +case 401: +str.append ("KEY_PRESSED"); +break; +case 402: +str.append ("KEY_RELEASED"); +break; +case 400: +str.append ("KEY_TYPED"); +break; +default: +str.append ("unknown type"); +break; +} +str.append (",keyCode=").append ("" + this.keyCode); +str.append (",keyText=").append (java.awt.event.KeyEvent.getKeyText (this.keyCode)); +str.append (",keyChar="); +switch (this.keyChar) { +case '\b': +str.append (java.awt.event.KeyEvent.getKeyText (8)); +break; +case '\t': +str.append (java.awt.event.KeyEvent.getKeyText (9)); +break; +case '\n': +str.append (java.awt.event.KeyEvent.getKeyText (10)); +break; +case '\u0018': +str.append (java.awt.event.KeyEvent.getKeyText (3)); +break; +case '\u001b': +str.append (java.awt.event.KeyEvent.getKeyText (27)); +break; +case '\u007f': +str.append (java.awt.event.KeyEvent.getKeyText (127)); +break; +case '\uffff': +str.append (java.awt.Toolkit.getProperty ("AWT.undefined", "Undefined")); +str.append (" keyChar"); +break; +default: +str.append ("'").append (this.keyChar).append ("'"); +break; +} +if (this.getModifiers () != 0) { +str.append (",modifiers=").append (java.awt.event.KeyEvent.getKeyModifiersText (this.modifiers)); +}if (this.getModifiersEx () != 0) { +str.append (",extModifiers=").append (java.awt.event.InputEvent.getModifiersExText (this.modifiers)); +}str.append (",keyLocation="); +switch (this.keyLocation) { +case 0: +str.append ("KEY_LOCATION_UNKNOWN"); +break; +case 1: +str.append ("KEY_LOCATION_STANDARD"); +break; +case 2: +str.append ("KEY_LOCATION_LEFT"); +break; +case 3: +str.append ("KEY_LOCATION_RIGHT"); +break; +case 4: +str.append ("KEY_LOCATION_NUMPAD"); +break; +default: +str.append ("KEY_LOCATION_UNKNOWN"); +break; +} +return str.toString (); +}); +Clazz_defineMethod (c$, "setNewModifiers", + function () { +if ((this.modifiers & 1) != 0) { +this.modifiers |= 64; +}if ((this.modifiers & 8) != 0) { +this.modifiers |= 512; +}if ((this.modifiers & 2) != 0) { +this.modifiers |= 128; +}if ((this.modifiers & 4) != 0) { +this.modifiers |= 256; +}if ((this.modifiers & 32) != 0) { +this.modifiers |= 8192; +}if ((this.modifiers & 16) != 0) { +this.modifiers |= 1024; +}}); +Clazz_defineMethod (c$, "setOldModifiers", + function () { +if ((this.modifiers & 64) != 0) { +this.modifiers |= 1; +}if ((this.modifiers & 512) != 0) { +this.modifiers |= 8; +}if ((this.modifiers & 128) != 0) { +this.modifiers |= 2; +}if ((this.modifiers & 256) != 0) { +this.modifiers |= 4; +}if ((this.modifiers & 8192) != 0) { +this.modifiers |= 32; +}if ((this.modifiers & 1024) != 0) { +this.modifiers |= 16; +}}); +Clazz_defineStatics (c$, +"KEY_FIRST", 400, +"KEY_LAST", 402, +"KEY_TYPED", 400, +"KEY_PRESSED", 401, +"KEY_RELEASED", 402, +"VK_ENTER", '\n', +"VK_BACK_SPACE", '\b', +"VK_TAB", '\t', +"VK_CANCEL", 0x03, +"VK_CLEAR", 0x0C, +"VK_SHIFT", 0x10, +"VK_CONTROL", 0x11, +"VK_ALT", 0x12, +"VK_PAUSE", 0x13, +"VK_CAPS_LOCK", 0x14, +"VK_ESCAPE", 0x1B, +"VK_SPACE", 0x20, +"VK_PAGE_UP", 0x21, +"VK_PAGE_DOWN", 0x22, +"VK_END", 0x23, +"VK_HOME", 0x24, +"VK_LEFT", 0x25, +"VK_UP", 0x26, +"VK_RIGHT", 0x27, +"VK_DOWN", 0x28, +"VK_COMMA", 0x2C, +"VK_MINUS", 0x2D, +"VK_PERIOD", 0x2E, +"VK_SLASH", 0x2F, +"VK_0", 0x30, +"VK_1", 0x31, +"VK_2", 0x32, +"VK_3", 0x33, +"VK_4", 0x34, +"VK_5", 0x35, +"VK_6", 0x36, +"VK_7", 0x37, +"VK_8", 0x38, +"VK_9", 0x39, +"VK_SEMICOLON", 0x3B, +"VK_EQUALS", 0x3D, +"VK_A", 0x41, +"VK_B", 0x42, +"VK_C", 0x43, +"VK_D", 0x44, +"VK_E", 0x45, +"VK_F", 0x46, +"VK_G", 0x47, +"VK_H", 0x48, +"VK_I", 0x49, +"VK_J", 0x4A, +"VK_K", 0x4B, +"VK_L", 0x4C, +"VK_M", 0x4D, +"VK_N", 0x4E, +"VK_O", 0x4F, +"VK_P", 0x50, +"VK_Q", 0x51, +"VK_R", 0x52, +"VK_S", 0x53, +"VK_T", 0x54, +"VK_U", 0x55, +"VK_V", 0x56, +"VK_W", 0x57, +"VK_X", 0x58, +"VK_Y", 0x59, +"VK_Z", 0x5A, +"VK_OPEN_BRACKET", 0x5B, +"VK_BACK_SLASH", 0x5C, +"VK_CLOSE_BRACKET", 0x5D, +"VK_NUMPAD0", 0x60, +"VK_NUMPAD1", 0x61, +"VK_NUMPAD2", 0x62, +"VK_NUMPAD3", 0x63, +"VK_NUMPAD4", 0x64, +"VK_NUMPAD5", 0x65, +"VK_NUMPAD6", 0x66, +"VK_NUMPAD7", 0x67, +"VK_NUMPAD8", 0x68, +"VK_NUMPAD9", 0x69, +"VK_MULTIPLY", 0x6A, +"VK_ADD", 0x6B, +"VK_SEPARATER", 0x6C, +"VK_SEPARATOR", 108, +"VK_SUBTRACT", 0x6D, +"VK_DECIMAL", 0x6E, +"VK_DIVIDE", 0x6F, +"VK_DELETE", 0x7F, +"VK_NUM_LOCK", 0x90, +"VK_SCROLL_LOCK", 0x91, +"VK_F1", 0x70, +"VK_F2", 0x71, +"VK_F3", 0x72, +"VK_F4", 0x73, +"VK_F5", 0x74, +"VK_F6", 0x75, +"VK_F7", 0x76, +"VK_F8", 0x77, +"VK_F9", 0x78, +"VK_F10", 0x79, +"VK_F11", 0x7A, +"VK_F12", 0x7B, +"VK_F13", 0xF000, +"VK_F14", 0xF001, +"VK_F15", 0xF002, +"VK_F16", 0xF003, +"VK_F17", 0xF004, +"VK_F18", 0xF005, +"VK_F19", 0xF006, +"VK_F20", 0xF007, +"VK_F21", 0xF008, +"VK_F22", 0xF009, +"VK_F23", 0xF00A, +"VK_F24", 0xF00B, +"VK_PRINTSCREEN", 0x9A, +"VK_INSERT", 0x9B, +"VK_HELP", 0x9C, +"VK_META", 0x9D, +"VK_BACK_QUOTE", 0xC0, +"VK_QUOTE", 0xDE, +"VK_KP_UP", 0xE0, +"VK_KP_DOWN", 0xE1, +"VK_KP_LEFT", 0xE2, +"VK_KP_RIGHT", 0xE3, +"VK_DEAD_GRAVE", 0x80, +"VK_DEAD_ACUTE", 0x81, +"VK_DEAD_CIRCUMFLEX", 0x82, +"VK_DEAD_TILDE", 0x83, +"VK_DEAD_MACRON", 0x84, +"VK_DEAD_BREVE", 0x85, +"VK_DEAD_ABOVEDOT", 0x86, +"VK_DEAD_DIAERESIS", 0x87, +"VK_DEAD_ABOVERING", 0x88, +"VK_DEAD_DOUBLEACUTE", 0x89, +"VK_DEAD_CARON", 0x8a, +"VK_DEAD_CEDILLA", 0x8b, +"VK_DEAD_OGONEK", 0x8c, +"VK_DEAD_IOTA", 0x8d, +"VK_DEAD_VOICED_SOUND", 0x8e, +"VK_DEAD_SEMIVOICED_SOUND", 0x8f, +"VK_AMPERSAND", 0x96, +"VK_ASTERISK", 0x97, +"VK_QUOTEDBL", 0x98, +"VK_LESS", 0x99, +"VK_GREATER", 0xa0, +"VK_BRACELEFT", 0xa1, +"VK_BRACERIGHT", 0xa2, +"VK_AT", 0x0200, +"VK_COLON", 0x0201, +"VK_CIRCUMFLEX", 0x0202, +"VK_DOLLAR", 0x0203, +"VK_EURO_SIGN", 0x0204, +"VK_EXCLAMATION_MARK", 0x0205, +"VK_INVERTED_EXCLAMATION_MARK", 0x0206, +"VK_LEFT_PARENTHESIS", 0x0207, +"VK_NUMBER_SIGN", 0x0208, +"VK_PLUS", 0x0209, +"VK_RIGHT_PARENTHESIS", 0x020A, +"VK_UNDERSCORE", 0x020B, +"VK_WINDOWS", 0x020C, +"VK_CONTEXT_MENU", 0x020D, +"VK_FINAL", 0x0018, +"VK_CONVERT", 0x001C, +"VK_NONCONVERT", 0x001D, +"VK_ACCEPT", 0x001E, +"VK_MODECHANGE", 0x001F, +"VK_KANA", 0x0015, +"VK_KANJI", 0x0019, +"VK_ALPHANUMERIC", 0x00F0, +"VK_KATAKANA", 0x00F1, +"VK_HIRAGANA", 0x00F2, +"VK_FULL_WIDTH", 0x00F3, +"VK_HALF_WIDTH", 0x00F4, +"VK_ROMAN_CHARACTERS", 0x00F5, +"VK_ALL_CANDIDATES", 0x0100, +"VK_PREVIOUS_CANDIDATE", 0x0101, +"VK_CODE_INPUT", 0x0102, +"VK_JAPANESE_KATAKANA", 0x0103, +"VK_JAPANESE_HIRAGANA", 0x0104, +"VK_JAPANESE_ROMAN", 0x0105, +"VK_KANA_LOCK", 0x0106, +"VK_INPUT_METHOD_ON_OFF", 0x0107, +"VK_CUT", 0xFFD1, +"VK_COPY", 0xFFCD, +"VK_PASTE", 0xFFCF, +"VK_UNDO", 0xFFCB, +"VK_AGAIN", 0xFFC9, +"VK_FIND", 0xFFD0, +"VK_PROPS", 0xFFCA, +"VK_STOP", 0xFFC8, +"VK_COMPOSE", 0xFF20, +"VK_ALT_GRAPH", 0xFF7E, +"VK_BEGIN", 0xFF58, +"VK_UNDEFINED", 0x0, +"CHAR_UNDEFINED", String.fromCharCode (0xFFFF), +"KEY_LOCATION_UNKNOWN", 0, +"KEY_LOCATION_STANDARD", 1, +"KEY_LOCATION_LEFT", 2, +"KEY_LOCATION_RIGHT", 3, +"KEY_LOCATION_NUMPAD", 4); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.MouseEvent"], "java.awt.event.MouseWheelEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.scrollType = 0; +this.scrollAmount = 0; +this.wheelRotation = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "MouseWheelEvent", java.awt.event.MouseEvent); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, clickCount, popupTrigger, scrollType, scrollAmount, wheelRotation) { +this.construct (source, id, when, modifiers, x, y, 0, 0, clickCount, popupTrigger, scrollType, scrollAmount, wheelRotation); +}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B,~N,~N,~N"); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, scrollType, scrollAmount, wheelRotation) { +Clazz_superConstructor (this, java.awt.event.MouseWheelEvent, [source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, 0]); +this.scrollType = scrollType; +this.scrollAmount = scrollAmount; +this.wheelRotation = wheelRotation; +}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~N,~N,~B,~N,~N,~N"); +Clazz_defineMethod (c$, "getScrollType", +function () { +return this.scrollType; +}); +Clazz_defineMethod (c$, "getScrollAmount", +function () { +return this.scrollAmount; +}); +Clazz_defineMethod (c$, "getWheelRotation", +function () { +return this.wheelRotation; +}); +Clazz_defineMethod (c$, "getUnitsToScroll", +function () { +return this.scrollAmount * this.wheelRotation; +}); +Clazz_defineMethod (c$, "paramString", +function () { +var scrollTypeStr = null; +if (this.getScrollType () == 0) { +scrollTypeStr = "WHEEL_UNIT_SCROLL"; +} else if (this.getScrollType () == 1) { +scrollTypeStr = "WHEEL_BLOCK_SCROLL"; +} else { +scrollTypeStr = "unknown scroll type"; +}return Clazz_superCall (this, java.awt.event.MouseWheelEvent, "paramString", []) + ",scrollType=" + scrollTypeStr + ",scrollAmount=" + this.getScrollAmount () + ",wheelRotation=" + this.getWheelRotation (); +}); +Clazz_defineStatics (c$, +"WHEEL_UNIT_SCROLL", 0, +"WHEEL_BLOCK_SCROLL", 1); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.Action", "$.ArrayTable"], "javax.swing.AbstractAction", ["java.lang.Boolean", "javax.swing.event.SwingPropertyChangeSupport"], function () { +c$ = Clazz_decorateAsClass (function () { +this.enabled = true; +this.arrayTable = null; +this.changeSupport = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "AbstractAction", null, [javax.swing.Action, Cloneable]); +c$.shouldReconfigure = Clazz_defineMethod (c$, "shouldReconfigure", +function (e) { +if (e.getPropertyName () == null) { +javax.swing.AbstractAction.RECONFIGURE_ON_NULL = new Boolean (false); +}return false; +}, "java.beans.PropertyChangeEvent"); +c$.setEnabledFromAction = Clazz_defineMethod (c$, "setEnabledFromAction", +function (c, a) { +c.setEnabled ((a != null) ? a.isEnabled () : true); +}, "javax.swing.JComponent,javax.swing.Action"); +c$.setToolTipTextFromAction = Clazz_defineMethod (c$, "setToolTipTextFromAction", +function (c, a) { +c.setToolTipText (a != null ? a.getValue ("ShortDescription") : null); +}, "javax.swing.JComponent,javax.swing.Action"); +c$.hasSelectedKey = Clazz_defineMethod (c$, "hasSelectedKey", +function (a) { +return (a != null && a.getValue ("SwingSelectedKey") != null); +}, "javax.swing.Action"); +c$.isSelected = Clazz_defineMethod (c$, "isSelected", +function (a) { +return Boolean.TRUE.equals (a.getValue ("SwingSelectedKey")); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_makeConstructor (c$, +function (name) { +this.putValue ("Name", name); +}, "~S"); +Clazz_makeConstructor (c$, +function (name, icon) { +this.construct (name); +this.putValue ("SmallIcon", icon); +}, "~S,javax.swing.Icon"); +Clazz_defineMethod (c$, "getValue", +function (key) { +if (key === "enabled") { +return this.enabled; +}if (this.arrayTable == null) { +return null; +}return this.arrayTable.get (key); +}, "~S"); +Clazz_overrideMethod (c$, "putValue", +function (key, newValue) { +var oldValue = null; +if (key === "enabled") { +if (newValue == null || !(Clazz_instanceOf (newValue, Boolean))) { +newValue = new Boolean (false); +}oldValue = new Boolean (this.enabled); +this.enabled = (newValue).booleanValue (); +} else { +if (this.arrayTable == null) { +this.arrayTable = new javax.swing.ArrayTable (); +}if (this.arrayTable.containsKey (key)) oldValue = this.arrayTable.get (key); +if (newValue == null) { +this.arrayTable.remove (key); +} else { +this.arrayTable.put (key, newValue); +}}this.firePropertyChange (key, oldValue, newValue); +}, "~S,~O"); +Clazz_defineMethod (c$, "isEnabled", +function () { +return this.enabled; +}); +Clazz_overrideMethod (c$, "setEnabled", +function (newValue) { +var oldValue = this.enabled; +if (oldValue != newValue) { +this.enabled = newValue; +this.firePropertyChange ("enabled", Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); +}}, "~B"); +Clazz_defineMethod (c$, "getKeys", +function () { +if (this.arrayTable == null) { +return null; +}var keys = new Array (this.arrayTable.size ()); +this.arrayTable.getKeys (keys); +return keys; +}); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +if (this.changeSupport == null || (oldValue != null && newValue != null && oldValue.equals (newValue))) { +return; +}this.changeSupport.firePropertyChange (propertyName, oldValue, newValue); +}, "~S,~O,~O"); +Clazz_overrideMethod (c$, "addPropertyChangeListener", +function (listener) { +if (this.changeSupport == null) { +this.changeSupport = new javax.swing.event.SwingPropertyChangeSupport (this); +}this.changeSupport.addPropertyChangeListener (listener); +}, "java.beans.PropertyChangeListener"); +Clazz_overrideMethod (c$, "removePropertyChangeListener", +function (listener) { +if (this.changeSupport == null) { +return; +}this.changeSupport.removePropertyChangeListener (listener); +}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +if (this.changeSupport == null) { +return new Array (0); +}return this.changeSupport.getPropertyChangeListeners (); +}); +Clazz_defineMethod (c$, "clone", +function () { +var newAction = Clazz_superCall (this, javax.swing.AbstractAction, "clone", []); +{ +if (this.arrayTable != null) { +newAction.arrayTable = this.arrayTable.clone (); +}}return newAction; +}); +Clazz_defineStatics (c$, +"RECONFIGURE_ON_NULL", null); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.ItemSelectable", "java.awt.event.ActionListener", "$.ItemListener", "javax.swing.ActionPropertyChangeListener", "$.JComponent", "$.SwingConstants", "javax.swing.event.ChangeListener"], "javax.swing.AbstractButton", ["java.lang.Boolean", "$.IllegalArgumentException", "java.awt.event.ActionEvent", "$.ItemEvent", "javax.swing.AbstractAction", "$.DefaultButtonModel", "$.OverlayLayout", "$.SwingUtilities", "$.UIManager", "javax.swing.event.ChangeEvent", "javax.swing.plaf.UIResource"], function () { +c$ = Clazz_decorateAsClass (function () { +this.model = null; +this.text = ""; +this.margin = null; +this.defaultMargin = null; +this.defaultIcon = null; +this.pressedIcon = null; +this.disabledIcon = null; +this.selectedIcon = null; +this.disabledSelectedIcon = null; +this.rolloverIcon = null; +this.rolloverSelectedIcon = null; +this.$paintBorder = true; +this.paintFocus = true; +this.rolloverEnabled = false; +this.contentAreaFilled = true; +this.verticalAlignment = 0; +this.horizontalAlignment = 0; +this.verticalTextPosition = 0; +this.horizontalTextPosition = 11; +this.iconTextGap = 4; +this.mnemonic = 0; +this.mnemonicIndex = -1; +this.multiClickThreshhold = 0; +this.borderPaintedSet = false; +this.rolloverEnabledSet = false; +this.iconTextGapSet = false; +this.contentAreaFilledSet = false; +this.$setLayout = false; +this.defaultCapable = true; +this.handler = null; +this.changeListener = null; +this.actionListener = null; +this.itemListener = null; +this.changeEvent = null; +this.hideActionText = false; +this.$action = null; +this.actionPropertyChangeListener = null; +if (!Clazz_isClassDefined ("javax.swing.AbstractButton.ButtonChangeListener")) { +javax.swing.AbstractButton.$AbstractButton$ButtonChangeListener$ (); +} +if (!Clazz_isClassDefined ("javax.swing.AbstractButton.Handler")) { +javax.swing.AbstractButton.$AbstractButton$Handler$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "AbstractButton", javax.swing.JComponent, [java.awt.ItemSelectable, javax.swing.SwingConstants]); +Clazz_defineMethod (c$, "setHideActionText", +function (hideActionText) { +if (hideActionText != this.hideActionText) { +this.hideActionText = hideActionText; +if (this.getAction () != null) { +this.setTextFromAction (this.getAction (), false); +}this.firePropertyChangeBool ("hideActionText", !hideActionText, hideActionText); +}}, "~B"); +Clazz_defineMethod (c$, "getHideActionText", +function () { +return this.hideActionText; +}); +Clazz_defineMethod (c$, "getText", +function () { +return this.text; +}); +Clazz_defineMethod (c$, "setText", +function (text) { +var oldValue = this.text; +this.text = text; +this.firePropertyChangeObject ("text", oldValue, text); +this.updateDisplayedMnemonicIndex (text, this.getMnemonic ()); +if (text == null || oldValue == null || !text.equals (oldValue)) { +this.revalidate (); +this.repaint (); +}}, "~S"); +Clazz_defineMethod (c$, "isSelected", +function () { +return this.model.isSelected (); +}); +Clazz_defineMethod (c$, "setSelected", +function (b) { +this.model.setSelected (b); +}, "~B"); +Clazz_defineMethod (c$, "doClick", +function () { +this.doClick (68); +}); +Clazz_defineMethod (c$, "doClick", +function (pressTime) { +}, "~N"); +Clazz_defineMethod (c$, "setMargin", +function (m) { +if (Clazz_instanceOf (m, javax.swing.plaf.UIResource)) { +this.defaultMargin = m; +} else if (Clazz_instanceOf (this.margin, javax.swing.plaf.UIResource)) { +this.defaultMargin = this.margin; +}if (m == null && this.defaultMargin != null) { +m = this.defaultMargin; +}var old = this.margin; +this.margin = m; +this.firePropertyChangeObject ("margin", old, m); +if (old == null || !old.equals (m)) { +this.revalidate (); +this.repaint (); +}}, "java.awt.Insets"); +Clazz_defineMethod (c$, "getMargin", +function () { +return (this.margin == null) ? null : this.margin.clone (); +}); +Clazz_defineMethod (c$, "getIcon", +function () { +return this.defaultIcon; +}); +Clazz_defineMethod (c$, "setIcon", +function (defaultIcon) { +var oldValue = this.defaultIcon; +this.defaultIcon = defaultIcon; +if (defaultIcon !== oldValue && (Clazz_instanceOf (this.disabledIcon, javax.swing.plaf.UIResource))) { +this.disabledIcon = null; +}this.firePropertyChangeObject ("icon", oldValue, defaultIcon); +if (defaultIcon !== oldValue) { +if (defaultIcon == null || oldValue == null || defaultIcon.getIconWidth () != oldValue.getIconWidth () || defaultIcon.getIconHeight () != oldValue.getIconHeight ()) { +this.revalidate (); +}this.repaint (); +}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getPressedIcon", +function () { +return this.pressedIcon; +}); +Clazz_defineMethod (c$, "setPressedIcon", +function (pressedIcon) { +var oldValue = this.pressedIcon; +this.pressedIcon = pressedIcon; +this.firePropertyChangeObject ("pressedIcon", oldValue, pressedIcon); +if (pressedIcon !== oldValue) { +if (this.getModel ().isPressed ()) { +this.repaint (); +}}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getSelectedIcon", +function () { +return this.selectedIcon; +}); +Clazz_defineMethod (c$, "setSelectedIcon", +function (selectedIcon) { +var oldValue = this.selectedIcon; +this.selectedIcon = selectedIcon; +if (selectedIcon !== oldValue && Clazz_instanceOf (this.disabledSelectedIcon, javax.swing.plaf.UIResource)) { +this.disabledSelectedIcon = null; +}this.firePropertyChangeObject ("selectedIcon", oldValue, selectedIcon); +if (selectedIcon !== oldValue) { +if (this.isSelected ()) { +this.repaint (); +}}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getRolloverIcon", +function () { +return this.rolloverIcon; +}); +Clazz_defineMethod (c$, "setRolloverIcon", +function (rolloverIcon) { +var oldValue = this.rolloverIcon; +this.rolloverIcon = rolloverIcon; +this.firePropertyChangeObject ("rolloverIcon", oldValue, rolloverIcon); +this.setRolloverEnabled (true); +if (rolloverIcon !== oldValue) { +this.repaint (); +}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getRolloverSelectedIcon", +function () { +return this.rolloverSelectedIcon; +}); +Clazz_defineMethod (c$, "setRolloverSelectedIcon", +function (rolloverSelectedIcon) { +var oldValue = this.rolloverSelectedIcon; +this.rolloverSelectedIcon = rolloverSelectedIcon; +this.firePropertyChangeObject ("rolloverSelectedIcon", oldValue, rolloverSelectedIcon); +this.setRolloverEnabled (true); +if (rolloverSelectedIcon !== oldValue) { +if (this.isSelected ()) { +this.repaint (); +}}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getDisabledIcon", +function () { +if (this.disabledIcon == null) { +this.disabledIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledIcon (this, this.getIcon ()); +if (this.disabledIcon != null) { +this.firePropertyChangeObject ("disabledIcon", null, this.disabledIcon); +}}return this.disabledIcon; +}); +Clazz_defineMethod (c$, "setDisabledIcon", +function (disabledIcon) { +var oldValue = this.disabledIcon; +this.disabledIcon = disabledIcon; +this.firePropertyChangeObject ("disabledIcon", oldValue, disabledIcon); +if (disabledIcon !== oldValue) { +if (!this.isEnabled ()) { +this.repaint (); +}}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getDisabledSelectedIcon", +function () { +if (this.disabledSelectedIcon == null) { +if (this.selectedIcon != null) { +this.disabledSelectedIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledSelectedIcon (this, this.getSelectedIcon ()); +} else { +return this.getDisabledIcon (); +}}return this.disabledSelectedIcon; +}); +Clazz_defineMethod (c$, "setDisabledSelectedIcon", +function (disabledSelectedIcon) { +var oldValue = this.disabledSelectedIcon; +this.disabledSelectedIcon = disabledSelectedIcon; +this.firePropertyChangeObject ("disabledSelectedIcon", oldValue, disabledSelectedIcon); +if (disabledSelectedIcon !== oldValue) { +if (disabledSelectedIcon == null || oldValue == null || disabledSelectedIcon.getIconWidth () != oldValue.getIconWidth () || disabledSelectedIcon.getIconHeight () != oldValue.getIconHeight ()) { +this.revalidate (); +}if (!this.isEnabled () && this.isSelected ()) { +this.repaint (); +}}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getVerticalAlignment", +function () { +return this.verticalAlignment; +}); +Clazz_defineMethod (c$, "setVerticalAlignment", +function (alignment) { +if (alignment == this.verticalAlignment) return; +var oldValue = this.verticalAlignment; +this.verticalAlignment = this.checkVerticalKey (alignment, "verticalAlignment"); +this.firePropertyChangeInt ("verticalAlignment", oldValue, this.verticalAlignment); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getHorizontalAlignment", +function () { +return this.horizontalAlignment; +}); +Clazz_defineMethod (c$, "setHorizontalAlignment", +function (alignment) { +if (alignment == this.horizontalAlignment) return; +var oldValue = this.horizontalAlignment; +this.horizontalAlignment = this.checkHorizontalKey (alignment, "horizontalAlignment"); +this.firePropertyChangeInt ("horizontalAlignment", oldValue, this.horizontalAlignment); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getVerticalTextPosition", +function () { +return this.verticalTextPosition; +}); +Clazz_defineMethod (c$, "setVerticalTextPosition", +function (textPosition) { +if (textPosition == this.verticalTextPosition) return; +var oldValue = this.verticalTextPosition; +this.verticalTextPosition = this.checkVerticalKey (textPosition, "verticalTextPosition"); +this.firePropertyChangeInt ("verticalTextPosition", oldValue, this.verticalTextPosition); +this.revalidate (); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getHorizontalTextPosition", +function () { +return this.horizontalTextPosition; +}); +Clazz_defineMethod (c$, "setHorizontalTextPosition", +function (textPosition) { +if (textPosition == this.horizontalTextPosition) return; +var oldValue = this.horizontalTextPosition; +this.horizontalTextPosition = this.checkHorizontalKey (textPosition, "horizontalTextPosition"); +this.firePropertyChangeInt ("horizontalTextPosition", oldValue, this.horizontalTextPosition); +this.revalidate (); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getIconTextGap", +function () { +return this.iconTextGap; +}); +Clazz_defineMethod (c$, "setIconTextGap", +function (iconTextGap) { +var oldValue = this.iconTextGap; +this.iconTextGap = iconTextGap; +this.iconTextGapSet = true; +this.firePropertyChangeInt ("iconTextGap", oldValue, iconTextGap); +if (iconTextGap != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~N"); +Clazz_defineMethod (c$, "checkHorizontalKey", +function (key, exception) { +if ((key == 2) || (key == 0) || (key == 4) || (key == 10) || (key == 11)) { +return key; +} else { +throw new IllegalArgumentException (exception); +}}, "~N,~S"); +Clazz_defineMethod (c$, "checkVerticalKey", +function (key, exception) { +if ((key == 1) || (key == 0) || (key == 3)) { +return key; +} else { +throw new IllegalArgumentException (exception); +}}, "~N,~S"); +Clazz_defineMethod (c$, "removeNotify", +function () { +Clazz_superCall (this, javax.swing.AbstractButton, "removeNotify", []); +if (this.isRolloverEnabled ()) { +this.getModel ().setRollover (false); +}}); +Clazz_defineMethod (c$, "setActionCommand", +function (actionCommand) { +this.getModel ().setActionCommand (actionCommand); +}, "~S"); +Clazz_defineMethod (c$, "getActionCommand", +function () { +var ac = this.getModel ().getActionCommand (); +if (ac == null) { +ac = this.getText (); +}return ac; +}); +Clazz_defineMethod (c$, "setAction", +function (a) { +var oldValue = this.getAction (); +if (this.$action == null || !this.$action.equals (a)) { +this.$action = a; +if (oldValue != null) { +this.removeActionListener (oldValue); +oldValue.removePropertyChangeListener (this.actionPropertyChangeListener); +this.actionPropertyChangeListener = null; +}this.configurePropertiesFromAction (this.$action); +if (this.$action != null) { +if (!this.isListener (java.awt.event.ActionListener, this.$action)) { +this.addActionListener (this.$action); +}this.actionPropertyChangeListener = this.createActionPropertyChangeListener (this.$action); +this.$action.addPropertyChangeListener (this.actionPropertyChangeListener); +}this.firePropertyChangeObject ("action", oldValue, this.$action); +}}, "javax.swing.Action"); +Clazz_defineMethod (c$, "isListener", + function (c, a) { +var isListener = false; +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === c && listeners[i + 1] === a) { +isListener = true; +}} +return isListener; +}, "Class,java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "getAction", +function () { +return this.$action; +}); +Clazz_defineMethod (c$, "configurePropertiesFromAction", +function (a) { +this.setMnemonicFromAction (a); +this.setTextFromAction (a, false); +javax.swing.AbstractAction.setToolTipTextFromAction (this, a); +this.setIconFromAction (a); +this.setActionCommandFromAction (a); +javax.swing.AbstractAction.setEnabledFromAction (this, a); +if (javax.swing.AbstractAction.hasSelectedKey (a) && this.shouldUpdateSelectedStateFromAction ()) { +this.setSelectedFromAction (a); +}this.setDisplayedMnemonicIndexFromAction (a, false); +}, "javax.swing.Action"); +Clazz_overrideMethod (c$, "clientPropertyChanged", +function (key, oldValue, newValue) { +if (key === "hideActionText") { +var current = (Clazz_instanceOf (newValue, Boolean)) ? newValue : false; +if (this.getHideActionText () != current) { +this.setHideActionText (current); +}}}, "~O,~O,~O"); +Clazz_defineMethod (c$, "shouldUpdateSelectedStateFromAction", +function () { +return false; +}); +Clazz_defineMethod (c$, "actionPropertyChanged", +function (action, propertyName) { +if (propertyName === "Name") { +this.setTextFromAction (action, true); +} else if (propertyName === "enabled") { +javax.swing.AbstractAction.setEnabledFromAction (this, action); +} else if (propertyName === "ShortDescription") { +javax.swing.AbstractAction.setToolTipTextFromAction (this, action); +} else if (propertyName === "SmallIcon") { +this.smallIconChanged (action); +} else if (propertyName === "MnemonicKey") { +this.setMnemonicFromAction (action); +} else if (propertyName === "ActionCommandKey") { +this.setActionCommandFromAction (action); +} else if (propertyName === "SwingSelectedKey" && javax.swing.AbstractAction.hasSelectedKey (action) && this.shouldUpdateSelectedStateFromAction ()) { +this.setSelectedFromAction (action); +} else if (propertyName === "SwingDisplayedMnemonicIndexKey") { +this.setDisplayedMnemonicIndexFromAction (action, true); +} else if (propertyName === "SwingLargeIconKey") { +this.largeIconChanged (action); +}}, "javax.swing.Action,~S"); +Clazz_defineMethod (c$, "setDisplayedMnemonicIndexFromAction", + function (a, fromPropertyChange) { +var iValue = (a == null) ? null : a.getValue ("SwingDisplayedMnemonicIndexKey"); +if (fromPropertyChange || iValue != null) { +var value; +if (iValue == null) { +value = -1; +} else { +value = (iValue).intValue (); +var text = this.getText (); +if (text == null || value >= text.length) { +value = -1; +}}this.setDisplayedMnemonicIndex (value); +}}, "javax.swing.Action,~B"); +Clazz_defineMethod (c$, "setMnemonicFromAction", + function (a) { +var n = (a == null) ? null : a.getValue ("MnemonicKey"); +this.setMnemonic ((n == null) ? '\0' : n); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "setTextFromAction", + function (a, propertyChange) { +var hideText = this.getHideActionText (); +if (!propertyChange) { +this.setText ((a != null && !hideText) ? a.getValue ("Name") : null); +} else if (!hideText) { +this.setText (a.getValue ("Name")); +}}, "javax.swing.Action,~B"); +Clazz_defineMethod (c$, "setIconFromAction", +function (a) { +var icon = null; +if (a != null) { +icon = a.getValue ("SwingLargeIconKey"); +if (icon == null) { +icon = a.getValue ("SmallIcon"); +}}this.setIcon (icon); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "smallIconChanged", +function (a) { +if (a.getValue ("SwingLargeIconKey") == null) { +this.setIconFromAction (a); +}}, "javax.swing.Action"); +Clazz_defineMethod (c$, "largeIconChanged", +function (a) { +this.setIconFromAction (a); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "setActionCommandFromAction", + function (a) { +this.setActionCommand ((a != null) ? a.getValue ("ActionCommandKey") : null); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "setSelectedFromAction", + function (a) { +var selected = false; +if (a != null) { +selected = javax.swing.AbstractAction.isSelected (a); +}if (selected != this.isSelected ()) { +this.setSelected (selected); +if (!selected && this.isSelected ()) { +if (Clazz_instanceOf (this.getModel (), javax.swing.DefaultButtonModel)) { +var group = (this.getModel ()).getGroup (); +if (group != null) { +group.clearSelection (); +}}}}}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createActionPropertyChangeListener", +function (a) { +return this.createActionPropertyChangeListener0 (a); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createActionPropertyChangeListener0", +function (a) { +return new javax.swing.AbstractButton.ButtonActionPropertyChangeListener (this, a); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "isBorderPainted", +function () { +return this.$paintBorder; +}); +Clazz_defineMethod (c$, "setBorderPainted", +function (b) { +var oldValue = this.$paintBorder; +this.$paintBorder = b; +this.borderPaintedSet = true; +this.firePropertyChangeBool ("borderPainted", oldValue, this.$paintBorder); +if (b != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "paintBorder", +function (g) { +if (this.isBorderPainted ()) { +Clazz_superCall (this, javax.swing.AbstractButton, "paintBorder", [g]); +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "isFocusPainted", +function () { +return this.paintFocus; +}); +Clazz_defineMethod (c$, "setFocusPainted", +function (b) { +var oldValue = this.paintFocus; +this.paintFocus = b; +this.firePropertyChangeBool ("focusPainted", oldValue, this.paintFocus); +if (b != oldValue && this.isFocusOwner ()) { +this.revalidate (); +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "isContentAreaFilled", +function () { +return this.contentAreaFilled; +}); +Clazz_defineMethod (c$, "setContentAreaFilled", +function (b) { +var oldValue = this.contentAreaFilled; +this.contentAreaFilled = b; +this.contentAreaFilledSet = true; +this.firePropertyChangeBool ("contentAreaFilled", oldValue, this.contentAreaFilled); +if (b != oldValue) { +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "isRolloverEnabled", +function () { +return this.rolloverEnabled; +}); +Clazz_defineMethod (c$, "setRolloverEnabled", +function (b) { +var oldValue = this.rolloverEnabled; +this.rolloverEnabled = b; +this.rolloverEnabledSet = true; +this.firePropertyChangeBool ("rolloverEnabled", oldValue, this.rolloverEnabled); +if (b != oldValue) { +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "getMnemonic", +function () { +return this.mnemonic; +}); +Clazz_defineMethod (c$, "setMnemonic", +function (mnemonic) { +this.model.setMnemonic (mnemonic); +this.updateMnemonicProperties (); +}, "~N"); +Clazz_defineMethod (c$, "setMnemonic", +function (mnemonic) { +var vk = (mnemonic).charCodeAt (0); +if (vk >= 97 && vk <= 122) vk -= (32); +this.setMnemonic (vk); +}, "~S"); +Clazz_defineMethod (c$, "setDisplayedMnemonicIndex", +function (index) { +var oldValue = this.mnemonicIndex; +if (index == -1) { +this.mnemonicIndex = -1; +} else { +var text = this.getText (); +var textLength = (text == null) ? 0 : text.length; +if (index < -1 || index >= textLength) { +throw new IllegalArgumentException ("index == " + index); +}}this.mnemonicIndex = index; +this.firePropertyChangeInt ("displayedMnemonicIndex", oldValue, index); +if (index != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~N"); +Clazz_defineMethod (c$, "getDisplayedMnemonicIndex", +function () { +return this.mnemonicIndex; +}); +Clazz_defineMethod (c$, "updateDisplayedMnemonicIndex", + function (text, mnemonic) { +this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (text, mnemonic)); +}, "~S,~N"); +Clazz_defineMethod (c$, "updateMnemonicProperties", + function () { +var newMnemonic = this.model.getMnemonic (); +if (this.mnemonic != newMnemonic) { +var oldValue = this.mnemonic; +this.mnemonic = newMnemonic; +this.firePropertyChangeInt ("mnemonic", oldValue, this.mnemonic); +this.updateDisplayedMnemonicIndex (this.getText (), this.mnemonic); +this.revalidate (); +this.repaint (); +}}); +Clazz_defineMethod (c$, "setMultiClickThreshhold", +function (threshhold) { +if (threshhold < 0) { +throw new IllegalArgumentException ("threshhold must be >= 0"); +}this.multiClickThreshhold = threshhold; +}, "~N"); +Clazz_defineMethod (c$, "getMultiClickThreshhold", +function () { +return this.multiClickThreshhold; +}); +Clazz_defineMethod (c$, "getModel", +function () { +return this.model; +}); +Clazz_defineMethod (c$, "setModel", +function (newModel) { +var oldModel = this.getModel (); +if (oldModel != null) { +oldModel.removeChangeListener (this.changeListener); +oldModel.removeActionListener (this.actionListener); +oldModel.removeItemListener (this.itemListener); +this.changeListener = null; +this.actionListener = null; +this.itemListener = null; +}this.model = newModel; +if (newModel != null) { +this.changeListener = this.createChangeListener (); +this.actionListener = this.createActionListener (); +this.itemListener = this.createItemListener (); +newModel.addChangeListener (this.changeListener); +newModel.addActionListener (this.actionListener); +newModel.addItemListener (this.itemListener); +this.updateMnemonicProperties (); +Clazz_superCall (this, javax.swing.AbstractButton, "setEnabled", [newModel.isEnabled ()]); +} else { +this.mnemonic = 0; +}this.updateDisplayedMnemonicIndex (this.getText (), this.mnemonic); +this.firePropertyChangeObject ("model", oldModel, newModel); +if (newModel !== oldModel) { +this.revalidate (); +this.repaint (); +}}, "javax.swing.ButtonModel"); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_defineMethod (c$, "setUI", +function (ui) { +Clazz_superCall (this, javax.swing.AbstractButton, "setUI", [ui]); +if (Clazz_instanceOf (this.disabledIcon, javax.swing.plaf.UIResource)) { +this.setDisabledIcon (null); +}if (Clazz_instanceOf (this.disabledSelectedIcon, javax.swing.plaf.UIResource)) { +this.setDisabledSelectedIcon (null); +}}, "javax.swing.plaf.ButtonUI"); +Clazz_overrideMethod (c$, "updateUI", +function () { +}); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +if (!this.$setLayout) { +this.setLayout ( new javax.swing.OverlayLayout (this)); +}return this.addImplSAEM (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "setLayout", +function (mgr) { +this.$setLayout = true; +Clazz_superCall (this, javax.swing.AbstractButton, "setLayout", [mgr]); +}, "java.awt.LayoutManager"); +Clazz_defineMethod (c$, "addChangeListener", +function (l) { +this.listenerList.add (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "removeChangeListener", +function (l) { +this.listenerList.remove (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "getChangeListeners", +function () { +return (this.listenerList.getListeners (javax.swing.event.ChangeListener)); +}); +Clazz_defineMethod (c$, "fireStateChanged", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.ChangeListener) { +if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); +(listeners[i + 1]).stateChanged (this.changeEvent); +}} +}); +Clazz_defineMethod (c$, "addActionListener", +function (l) { +this.listenerList.add (java.awt.event.ActionListener, l); +}, "java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "removeActionListener", +function (l) { +if ((l != null) && (this.getAction () === l)) { +this.setAction (null); +} else { +this.listenerList.remove (java.awt.event.ActionListener, l); +}}, "java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "getActionListeners", +function () { +return (this.listenerList.getListeners (java.awt.event.ActionListener)); +}); +Clazz_defineMethod (c$, "createChangeListener", +function () { +return this.getHandler (); +}); +Clazz_defineMethod (c$, "fireActionPerformed", +function (event) { +var listeners = this.listenerList.getListenerList (); +var e = null; +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === java.awt.event.ActionListener) { +if (e == null) { +var actionCommand = event.getActionCommand (); +if (actionCommand == null) { +actionCommand = this.getActionCommand (); +}e = new java.awt.event.ActionEvent (this, 1001, actionCommand, event.getWhen (), event.getModifiers ()); +}(listeners[i + 1]).actionPerformed (e); +}} +}, "java.awt.event.ActionEvent"); +Clazz_defineMethod (c$, "fireItemStateChanged", +function (event) { +var listeners = this.listenerList.getListenerList (); +var e = null; +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === java.awt.event.ItemListener) { +if (e == null) { +e = new java.awt.event.ItemEvent (this, 701, this, event.getStateChange ()); +}(listeners[i + 1]).itemStateChanged (e); +}} +}, "java.awt.event.ItemEvent"); +Clazz_defineMethod (c$, "createActionListener", +function () { +return this.getHandler (); +}); +Clazz_defineMethod (c$, "createItemListener", +function () { +return this.getHandler (); +}); +Clazz_defineMethod (c$, "setEnabled", +function (b) { +if (!b && this.model.isRollover ()) { +this.model.setRollover (false); +}Clazz_superCall (this, javax.swing.AbstractButton, "setEnabled", [b]); +this.model.setEnabled (b); +}, "~B"); +Clazz_defineMethod (c$, "getLabel", +function () { +return this.getText (); +}); +Clazz_defineMethod (c$, "setLabel", +function (label) { +this.setText (label); +}, "~S"); +Clazz_overrideMethod (c$, "addItemListener", +function (l) { +this.listenerList.add (java.awt.event.ItemListener, l); +}, "java.awt.event.ItemListener"); +Clazz_overrideMethod (c$, "removeItemListener", +function (l) { +this.listenerList.remove (java.awt.event.ItemListener, l); +}, "java.awt.event.ItemListener"); +Clazz_defineMethod (c$, "getItemListeners", +function () { +return this.listenerList.getListeners (java.awt.event.ItemListener); +}); +Clazz_overrideMethod (c$, "getSelectedObjects", +function () { +if (this.isSelected () == false) { +return null; +}var selectedObjects = new Array (1); +selectedObjects[0] = this.getText (); +return selectedObjects; +}); +Clazz_defineMethod (c$, "init", +function (text, icon) { +if (text != null) { +this.setText (text); +}if (icon != null) { +this.setIcon (icon); +}this.updateUI (); +this.setAlignmentX (0.0); +this.setAlignmentY (0.5); +}, "~S,javax.swing.Icon"); +Clazz_defineMethod (c$, "imageUpdate", +function (img, infoflags, x, y, w, h) { +var iconDisplayed = this.getIcon (); +if (iconDisplayed == null) { +return false; +}if (!this.model.isEnabled ()) { +if (this.model.isSelected ()) { +iconDisplayed = this.getDisabledSelectedIcon (); +} else { +iconDisplayed = this.getDisabledIcon (); +}} else if (this.model.isPressed () && this.model.isArmed ()) { +iconDisplayed = this.getPressedIcon (); +} else if (this.isRolloverEnabled () && this.model.isRollover ()) { +if (this.model.isSelected ()) { +iconDisplayed = this.getRolloverSelectedIcon (); +} else { +iconDisplayed = this.getRolloverIcon (); +}} else if (this.model.isSelected ()) { +iconDisplayed = this.getSelectedIcon (); +}if (!javax.swing.SwingUtilities.doesIconReferenceImage (iconDisplayed, img)) { +return false; +}return Clazz_superCall (this, javax.swing.AbstractButton, "imageUpdate", [img, infoflags, x, y, w, h]); +}, "java.awt.Image,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setUIProperty", +function (propertyName, value) { +if (propertyName === "borderPainted") { +if (!this.borderPaintedSet) { +this.setBorderPainted ((value).booleanValue ()); +this.borderPaintedSet = false; +}} else if (propertyName === "rolloverEnabled") { +if (!this.rolloverEnabledSet) { +this.setRolloverEnabled ((value).booleanValue ()); +this.rolloverEnabledSet = false; +}} else if (propertyName === "iconTextGap") { +if (!this.iconTextGapSet) { +this.setIconTextGap ((value).intValue ()); +this.iconTextGapSet = false; +}} else if (propertyName === "contentAreaFilled") { +if (!this.contentAreaFilledSet) { +this.setContentAreaFilled ((value).booleanValue ()); +this.contentAreaFilledSet = false; +}} else { +Clazz_superCall (this, javax.swing.AbstractButton, "setUIProperty", [propertyName, value]); +}}, "~S,~O"); +Clazz_defineMethod (c$, "paramString", +function () { +var defaultIconString = ((this.defaultIcon != null) && (this.defaultIcon !== this) ? this.defaultIcon.toString () : ""); +var pressedIconString = ((this.pressedIcon != null) && (this.pressedIcon !== this) ? this.pressedIcon.toString () : ""); +var disabledIconString = ((this.disabledIcon != null) && (this.disabledIcon !== this) ? this.disabledIcon.toString () : ""); +var selectedIconString = ((this.selectedIcon != null) && (this.selectedIcon !== this) ? this.selectedIcon.toString () : ""); +var disabledSelectedIconString = ((this.disabledSelectedIcon != null) && (this.disabledSelectedIcon !== this) ? this.disabledSelectedIcon.toString () : ""); +var rolloverIconString = ((this.rolloverIcon != null) && (this.rolloverIcon !== this) ? this.rolloverIcon.toString () : ""); +var rolloverSelectedIconString = ((this.rolloverSelectedIcon != null) && (this.rolloverSelectedIcon !== this) ? this.rolloverSelectedIcon.toString () : ""); +var paintBorderString = (this.$paintBorder ? "true" : "false"); +var paintFocusString = (this.paintFocus ? "true" : "false"); +var rolloverEnabledString = (this.rolloverEnabled ? "true" : "false"); +return Clazz_superCall (this, javax.swing.AbstractButton, "paramString", []) + ",defaultIcon=" + defaultIconString + ",disabledIcon=" + disabledIconString + ",disabledSelectedIcon=" + disabledSelectedIconString + ",margin=" + this.margin + ",paintBorder=" + paintBorderString + ",paintFocus=" + paintFocusString + ",pressedIcon=" + pressedIconString + ",rolloverEnabled=" + rolloverEnabledString + ",rolloverIcon=" + rolloverIconString + ",rolloverSelectedIcon=" + rolloverSelectedIconString + ",selectedIcon=" + selectedIconString + ",text=" + this.text; +}); +Clazz_defineMethod (c$, "getHandler", + function () { +if (this.handler == null) { +this.handler = Clazz_innerTypeInstance (javax.swing.AbstractButton.Handler, this, null); +}return this.handler; +}); +c$.$AbstractButton$ButtonChangeListener$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, javax.swing.AbstractButton, "ButtonChangeListener", null, javax.swing.event.ChangeListener); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_overrideMethod (c$, "stateChanged", +function (a) { +this.b$["javax.swing.AbstractButton"].getHandler ().stateChanged (a); +}, "javax.swing.event.ChangeEvent"); +c$ = Clazz_p0p (); +}; +c$.$AbstractButton$Handler$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, javax.swing.AbstractButton, "Handler", null, [java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.awt.event.ItemListener]); +Clazz_overrideMethod (c$, "stateChanged", +function (a) { +this.b$["javax.swing.AbstractButton"].updateMnemonicProperties (); +if (this.b$["javax.swing.AbstractButton"].isEnabled () != this.b$["javax.swing.AbstractButton"].model.isEnabled ()) { +this.b$["javax.swing.AbstractButton"].setEnabled (this.b$["javax.swing.AbstractButton"].model.isEnabled ()); +}this.b$["javax.swing.AbstractButton"].fireStateChanged (); +this.b$["javax.swing.AbstractButton"].repaint (); +}, "javax.swing.event.ChangeEvent"); +Clazz_overrideMethod (c$, "actionPerformed", +function (a) { +this.b$["javax.swing.AbstractButton"].fireActionPerformed (a); +}, "java.awt.event.ActionEvent"); +Clazz_overrideMethod (c$, "itemStateChanged", +function (a) { +this.b$["javax.swing.AbstractButton"].fireItemStateChanged (a); +if (this.b$["javax.swing.AbstractButton"].shouldUpdateSelectedStateFromAction ()) { +var b = this.b$["javax.swing.AbstractButton"].getAction (); +if (b != null && javax.swing.AbstractAction.hasSelectedKey (b)) { +var c = this.b$["javax.swing.AbstractButton"].isSelected (); +var d = javax.swing.AbstractAction.isSelected (b); +if (d != c) { +b.putValue ("SwingSelectedKey", new Boolean (c)); +}}}}, "java.awt.event.ItemEvent"); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.AbstractButton, "ButtonActionPropertyChangeListener", javax.swing.ActionPropertyChangeListener); +Clazz_overrideMethod (c$, "actionPropertyChanged", +function (a, b, c) { +if (javax.swing.AbstractAction.shouldReconfigure (c)) { +a.configurePropertiesFromAction (b); +} else { +a.actionPropertyChanged (b, c.getPropertyName ()); +}}, "javax.swing.AbstractButton,javax.swing.Action,java.beans.PropertyChangeEvent"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"MODEL_CHANGED_PROPERTY", "model", +"TEXT_CHANGED_PROPERTY", "text", +"MNEMONIC_CHANGED_PROPERTY", "mnemonic", +"MARGIN_CHANGED_PROPERTY", "margin", +"VERTICAL_ALIGNMENT_CHANGED_PROPERTY", "verticalAlignment", +"HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY", "horizontalAlignment", +"VERTICAL_TEXT_POSITION_CHANGED_PROPERTY", "verticalTextPosition", +"HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY", "horizontalTextPosition", +"BORDER_PAINTED_CHANGED_PROPERTY", "borderPainted", +"FOCUS_PAINTED_CHANGED_PROPERTY", "focusPainted", +"ROLLOVER_ENABLED_CHANGED_PROPERTY", "rolloverEnabled", +"CONTENT_AREA_FILLED_CHANGED_PROPERTY", "contentAreaFilled", +"ICON_CHANGED_PROPERTY", "icon", +"PRESSED_ICON_CHANGED_PROPERTY", "pressedIcon", +"SELECTED_ICON_CHANGED_PROPERTY", "selectedIcon", +"ROLLOVER_ICON_CHANGED_PROPERTY", "rolloverIcon", +"ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY", "rolloverSelectedIcon", +"DISABLED_ICON_CHANGED_PROPERTY", "disabledIcon", +"DISABLED_SELECTED_ICON_CHANGED_PROPERTY", "disabledSelectedIcon"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (null, "javax.swing.ArrayTable", ["java.util.Hashtable"], function () { +c$ = Clazz_decorateAsClass (function () { +this.table = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "ArrayTable", null, Cloneable); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "put", +function (key, value) { +if (this.table == null) { +this.table = Clazz_newArray (-1, [key, value]); +} else { +var size = this.size (); +if (size < 8) { +if (this.containsKey (key)) { +var tmp = this.table; +for (var i = 0; i < tmp.length - 1; i += 2) { +if (tmp[i].equals (key)) { +tmp[i + 1] = value; +break; +}} +} else { +var array = this.table; +var i = array.length; +var tmp = new Array (i + 2); +System.arraycopy (array, 0, tmp, 0, i); +tmp[i] = key; +tmp[i + 1] = value; +this.table = tmp; +}} else { +if ((size == 8) && this.isArray ()) { +this.grow (); +}(this.table).put (key, value); +}}}, "~O,~O"); +Clazz_defineMethod (c$, "get", +function (key) { +var value = null; +if (this.table != null) { +if (this.isArray ()) { +var array = this.table; +for (var i = 0; i < array.length - 1; i += 2) { +if (array[i].equals (key)) { +value = array[i + 1]; +break; +}} +} else { +value = (this.table).get (key); +}}return value; +}, "~O"); +Clazz_defineMethod (c$, "size", +function () { +var size; +if (this.table == null) return 0; +if (this.isArray ()) { +size = Clazz_doubleToInt ((this.table).length / 2); +} else { +size = (this.table).size (); +}return size; +}); +Clazz_defineMethod (c$, "containsKey", +function (key) { +var contains = false; +if (this.table != null) { +if (this.isArray ()) { +var array = this.table; +for (var i = 0; i < array.length - 1; i += 2) { +if (array[i].equals (key)) { +contains = true; +break; +}} +} else { +contains = (this.table).containsKey (key); +}}return contains; +}, "~O"); +Clazz_defineMethod (c$, "remove", +function (key) { +var value = null; +if (key == null) { +return null; +}if (this.table != null) { +if (this.isArray ()) { +var index = -1; +var array = this.table; +for (var i = array.length - 2; i >= 0; i -= 2) { +if (array[i].equals (key)) { +index = i; +value = array[i + 1]; +break; +}} +if (index != -1) { +var tmp = new Array (array.length - 2); +System.arraycopy (array, 0, tmp, 0, index); +if (index < tmp.length) System.arraycopy (array, index + 2, tmp, index, tmp.length - index); +this.table = (tmp.length == 0) ? null : tmp; +}} else { +value = (this.table).remove (key); +}if (this.size () == 7 && !this.isArray ()) { +this.shrink (); +}}return value; +}, "~O"); +Clazz_defineMethod (c$, "clear", +function () { +this.table = null; +}); +Clazz_overrideMethod (c$, "clone", +function () { +var newArrayTable = new javax.swing.ArrayTable (); +if (this.isArray ()) { +var array = this.table; +for (var i = 0; i < array.length - 1; i += 2) { +newArrayTable.put (array[i], array[i + 1]); +} +} else { +var tmp = this.table; +var keys = tmp.keys (); +while (keys.hasMoreElements ()) { +var o = keys.nextElement (); +newArrayTable.put (o, tmp.get (o)); +} +}return newArrayTable; +}); +Clazz_defineMethod (c$, "getKeys", +function (keys) { +if (this.table == null) { +return null; +}if (this.isArray ()) { +var array = this.table; +if (keys == null) { +keys = new Array (Clazz_doubleToInt (array.length / 2)); +}for (var i = 0, index = 0; i < array.length - 1; i += 2, index++) { +keys[index] = array[i]; +} +} else { +var tmp = this.table; +var enum_ = tmp.keys (); +var counter = tmp.size (); +if (keys == null) { +keys = new Array (counter); +}while (counter > 0) { +keys[--counter] = enum_.nextElement (); +} +}return keys; +}, "~A"); +Clazz_defineMethod (c$, "isArray", + function () { +return (Clazz_instanceOf (this.table, Array)); +}); +Clazz_defineMethod (c$, "grow", + function () { +var array = this.table; +var tmp = new java.util.Hashtable (Clazz_doubleToInt (array.length / 2)); +for (var i = 0; i < array.length; i += 2) { +tmp.put (array[i], array[i + 1]); +} +this.table = tmp; +}); +Clazz_defineMethod (c$, "shrink", + function () { +var tmp = this.table; +var array = new Array (tmp.size () * 2); +var keys = tmp.keys (); +var j = 0; +while (keys.hasMoreElements ()) { +var o = keys.nextElement (); +array[j] = o; +array[j + 1] = tmp.get (o); +j += 2; +} +this.table = array; +}); +Clazz_defineStatics (c$, +"ARRAY_BOUNDARY", 8); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.beans.PropertyChangeSupport"], "javax.swing.event.SwingPropertyChangeSupport", ["java.lang.NullPointerException", "javax.swing.SwingUtilities"], function () { +c$ = Clazz_decorateAsClass (function () { +this.notifyOnEDT = false; +Clazz_instantialize (this, arguments); +}, javax.swing.event, "SwingPropertyChangeSupport", java.beans.PropertyChangeSupport); +Clazz_makeConstructor (c$, +function (sourceBean) { +this.construct (sourceBean, false); +}, "~O"); +Clazz_makeConstructor (c$, +function (sourceBean, notifyOnEDT) { +Clazz_superConstructor (this, javax.swing.event.SwingPropertyChangeSupport, [sourceBean]); +this.notifyOnEDT = notifyOnEDT; +}, "~O,~B"); +Clazz_defineMethod (c$, "firePropertyChangeEvt", +function (evt) { +if (evt == null) { +throw new NullPointerException (); +}if (!this.isNotifyOnEDT () || javax.swing.SwingUtilities.isEventDispatchThread ()) { +Clazz_superCall (this, javax.swing.event.SwingPropertyChangeSupport, "firePropertyChangeEvt", [evt]); +} else { +javax.swing.SwingUtilities.invokeLater (((Clazz_isClassDefined ("javax.swing.event.SwingPropertyChangeSupport$1") ? 0 : javax.swing.event.SwingPropertyChangeSupport.$SwingPropertyChangeSupport$1$ ()), Clazz_innerTypeInstance (javax.swing.event.SwingPropertyChangeSupport$1, this, Clazz_cloneFinals ("evt", evt)))); +}}, "java.beans.PropertyChangeEvent"); +Clazz_defineMethod (c$, "isNotifyOnEDT", +function () { +return this.notifyOnEDT; +}); +c$.$SwingPropertyChangeSupport$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing.event, "SwingPropertyChangeSupport$1", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +this.b$["javax.swing.event.SwingPropertyChangeSupport"].firePropertyChangeEvt (this.f$.evt); +}); +c$ = Clazz_p0p (); +}; +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent"], "javax.swing.JLayeredPane", ["java.util.ArrayList", "$.Hashtable", "java.awt.Color"], function () { +c$ = Clazz_decorateAsClass (function () { +this.componentToLayer = null; +this.optimizedDrawingPossible = true; +Clazz_instantialize (this, arguments); +}, javax.swing, "JLayeredPane", javax.swing.JComponent); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JLayeredPane, []); +this.setLayout (null); +}); +Clazz_defineMethod (c$, "validateOptimizedDrawing", + function () { +var layeredComponentFound = false; +{ +var layer = null; +for (var c, $c = 0, $$c = this.getComponents (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) { +layer = null; +if ((Clazz_instanceOf (c, javax.swing.JComponent) && (layer = (c).getClientProperty ("layeredContainerLayer")) != null)) { +if (layer != null && layer.equals (javax.swing.JLayeredPane.FRAME_CONTENT_LAYER)) continue; +layeredComponentFound = true; +break; +}} +}if (layeredComponentFound) this.optimizedDrawingPossible = false; + else this.optimizedDrawingPossible = true; +}); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +var layer = javax.swing.JLayeredPane.DEFAULT_LAYER.intValue (); +var pos; +if (Clazz_instanceOf (constraints, Integer)) { +layer = (constraints).intValue (); +this.setLayer (comp, layer); +} else layer = this.getLayer (comp); +pos = this.insertIndexForLayer (layer, index); +this.addImplSAEM (comp, constraints, pos); +comp.validate (); +comp.repaint (); +this.validateOptimizedDrawing (); +return comp; +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "remove", +function (index) { +var c = this.getComponent (index); +Clazz_superCall (this, javax.swing.JLayeredPane, "remove", [index]); +if (c != null && !(Clazz_instanceOf (c, javax.swing.JComponent))) { +this.getComponentToLayer ().remove (c); +}this.validateOptimizedDrawing (); +}, "~N"); +Clazz_defineMethod (c$, "removeAll", +function () { +var children = this.getComponents (); +var cToL = this.getComponentToLayer (); +for (var counter = children.length - 1; counter >= 0; counter--) { +var c = children[counter]; +if (c != null && !(Clazz_instanceOf (c, javax.swing.JComponent))) { +cToL.remove (c); +}} +Clazz_superCall (this, javax.swing.JLayeredPane, "removeAll", []); +}); +Clazz_overrideMethod (c$, "isOptimizedDrawingEnabled", +function () { +return this.optimizedDrawingPossible; +}); +c$.putLayer = Clazz_defineMethod (c$, "putLayer", +function (c, layer) { +var layerObj; +layerObj = new Integer (layer); +c.putClientProperty ("layeredContainerLayer", layerObj); +}, "javax.swing.JComponent,~N"); +c$.getLayer = Clazz_defineMethod (c$, "getLayer", +function (c) { +var i; +if ((i = c.getClientProperty ("layeredContainerLayer")) != null) return i.intValue (); +return javax.swing.JLayeredPane.DEFAULT_LAYER.intValue (); +}, "javax.swing.JComponent"); +c$.getLayeredPaneAbove = Clazz_defineMethod (c$, "getLayeredPaneAbove", +function (c) { +if (c == null) return null; +var parent = c.getParent (); +while (parent != null && !(Clazz_instanceOf (parent, javax.swing.JLayeredPane))) parent = parent.getParent (); + +return parent; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "setLayer", +function (c, layer) { +this.setLayer (c, layer, -1); +}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "setLayer", +function (c, layer, position) { +var layerObj; +layerObj = this.getObjectForLayer (layer); +if (layer == this.getLayer (c) && position == this.getPosition (c)) { +this.repaint (c.getBounds ()); +return; +}if (Clazz_instanceOf (c, javax.swing.JComponent)) (c).putClientProperty ("layeredContainerLayer", layerObj); + else this.getComponentToLayer ().put (c, layerObj); +if (c.getParent () == null || c.getParent () !== this) { +this.repaint (c.getBounds ()); +return; +}var index = this.insertIndexForLayer (c, layer, position); +this.setComponentZOrder (c, index); +this.repaint (c.getBounds ()); +}, "java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getLayer", +function (c) { +var i; +if (Clazz_instanceOf (c, javax.swing.JComponent)) i = (c).getClientProperty ("layeredContainerLayer"); + else i = this.getComponentToLayer ().get (c); +if (i == null) return javax.swing.JLayeredPane.DEFAULT_LAYER.intValue (); +return i.intValue (); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getIndexOf", +function (c) { +var i; +var count; +count = this.getComponentCount (); +for (i = 0; i < count; i++) { +if (c === this.getComponent (i)) return i; +} +return -1; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "moveToFront", +function (c) { +this.setPosition (c, 0); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "moveToBack", +function (c) { +this.setPosition (c, -1); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "setPosition", +function (c, position) { +this.setLayer (c, this.getLayer (c), position); +}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "getPosition", +function (c) { +var i; +var count; +var startLayer; +var curLayer; +var startLocation; +var pos = 0; +count = this.getComponentCount (); +startLocation = this.getIndexOf (c); +if (startLocation == -1) return -1; +startLayer = this.getLayer (c); +for (i = startLocation - 1; i >= 0; i--) { +curLayer = this.getLayer (this.getComponent (i)); +if (curLayer == startLayer) pos++; + else return pos; +} +return pos; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "highestLayer", +function () { +if (this.getComponentCount () > 0) return this.getLayer (this.getComponent (0)); +return 0; +}); +Clazz_defineMethod (c$, "lowestLayer", +function () { +var count = this.getComponentCount (); +if (count > 0) return this.getLayer (this.getComponent (count - 1)); +return 0; +}); +Clazz_defineMethod (c$, "getComponentCountInLayer", +function (layer) { +var i; +var count; +var curLayer; +var layerCount = 0; +count = this.getComponentCount (); +for (i = 0; i < count; i++) { +curLayer = this.getLayer (this.getComponent (i)); +if (curLayer == layer) { +layerCount++; +} else if (layerCount > 0 || curLayer < layer) { +break; +}} +return layerCount; +}, "~N"); +Clazz_defineMethod (c$, "getComponentsInLayer", +function (layer) { +var i; +var count; +var curLayer; +var layerCount = 0; +var results; +results = new Array (this.getComponentCountInLayer (layer)); +count = this.getComponentCount (); +for (i = 0; i < count; i++) { +curLayer = this.getLayer (this.getComponent (i)); +if (curLayer == layer) { +results[layerCount++] = this.getComponent (i); +} else if (layerCount > 0 || curLayer < layer) { +break; +}} +return results; +}, "~N"); +Clazz_defineMethod (c$, "paint", +function (g) { +if (this.isOpaque ()) { +var r = g.getClipBounds (); +var c = this.getBackground (); +if (c == null) c = java.awt.Color.lightGray; +g.setColor (c); +if (r != null) { +g.fillRect (r.x, r.y, r.width, r.height); +} else { +g.fillRect (0, 0, this.getWidth (), this.getHeight ()); +}}Clazz_superCall (this, javax.swing.JLayeredPane, "paint", [g]); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "getComponentToLayer", +function () { +if (this.componentToLayer == null) this.componentToLayer = new java.util.Hashtable (4); +return this.componentToLayer; +}); +Clazz_defineMethod (c$, "getObjectForLayer", +function (layer) { +var layerObj; +switch (layer) { +case 0: +layerObj = javax.swing.JLayeredPane.DEFAULT_LAYER; +break; +case 100: +layerObj = javax.swing.JLayeredPane.PALETTE_LAYER; +break; +case 200: +layerObj = javax.swing.JLayeredPane.MODAL_LAYER; +break; +case 300: +layerObj = javax.swing.JLayeredPane.POPUP_LAYER; +break; +case 400: +layerObj = javax.swing.JLayeredPane.DRAG_LAYER; +break; +default: +layerObj = new Integer (layer); +} +return layerObj; +}, "~N"); +Clazz_defineMethod (c$, "insertIndexForLayer", +function (layer, position) { +return this.insertIndexForLayer (null, layer, position); +}, "~N,~N"); +Clazz_defineMethod (c$, "insertIndexForLayer", + function (comp, layer, position) { +var i; +var count; +var curLayer; +var layerStart = -1; +var layerEnd = -1; +var componentCount = this.getComponentCount (); +var compList = new java.util.ArrayList (componentCount); +for (var index = 0; index < componentCount; index++) { +if (this.getComponent (index) !== comp) { +compList.add (this.getComponent (index)); +}} +count = compList.size (); +for (i = 0; i < count; i++) { +curLayer = this.getLayer (compList.get (i)); +if (layerStart == -1 && curLayer == layer) { +layerStart = i; +}if (curLayer < layer) { +if (i == 0) { +layerStart = 0; +layerEnd = 0; +} else { +layerEnd = i; +}break; +}} +if (layerStart == -1 && layerEnd == -1) return count; +if (layerStart != -1 && layerEnd == -1) layerEnd = count; +if (layerEnd != -1 && layerStart == -1) layerStart = layerEnd; +if (position == -1) return layerEnd; +if (position > -1 && layerStart + position <= layerEnd) return layerStart + position; +return layerEnd; +}, "java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "paramString", +function () { +var optimizedDrawingPossibleString = (this.optimizedDrawingPossible ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JLayeredPane, "paramString", []) + ",optimizedDrawingPossible=" + optimizedDrawingPossibleString; +}); +c$.DEFAULT_LAYER = c$.prototype.DEFAULT_LAYER = new Integer (0); +c$.PALETTE_LAYER = c$.prototype.PALETTE_LAYER = new Integer (100); +c$.MODAL_LAYER = c$.prototype.MODAL_LAYER = new Integer (200); +c$.POPUP_LAYER = c$.prototype.POPUP_LAYER = new Integer (300); +c$.DRAG_LAYER = c$.prototype.DRAG_LAYER = new Integer (400); +c$.FRAME_CONTENT_LAYER = c$.prototype.FRAME_CONTENT_LAYER = new Integer (-30000); +Clazz_defineStatics (c$, +"LAYER_PROPERTY", "layeredContainerLayer"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent"], "javax.swing.JPanel", ["java.lang.Boolean", "java.awt.FlowLayout", "javax.swing.UIManager"], function () { +c$ = Clazz_declareType (javax.swing, "JPanel", javax.swing.JComponent); +Clazz_makeConstructor (c$, +function (layout, isDoubleBuffered) { +Clazz_superConstructor (this, javax.swing.JPanel, []); +this.setLayout (layout); +this.setUIProperty ("opaque", Boolean.TRUE); +this.updateUI (); +}, "java.awt.LayoutManager,~B"); +Clazz_makeConstructor (c$, +function (layout) { +this.construct (layout, true); +}, "java.awt.LayoutManager"); +Clazz_makeConstructor (c$, +function (isDoubleBuffered) { +this.construct ( new java.awt.FlowLayout (), isDoubleBuffered); +}, "~B"); +Clazz_makeConstructor (c$, +function () { +this.construct (true); +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "PanelUI"; +}); +Clazz_defineStatics (c$, +"$uiClassID", "PanelUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.lang.Enum", "java.util.Enumeration", "javax.swing.UIDefaults"], "javax.swing.MultiUIDefaults", ["java.lang.StringBuffer", "java.util.HashSet"], function () { +c$ = Clazz_decorateAsClass (function () { +this.tables = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "MultiUIDefaults", javax.swing.UIDefaults); +Clazz_makeConstructor (c$, +function (defaults) { +Clazz_superConstructor (this, javax.swing.MultiUIDefaults); +this.tables = defaults; +}, "~A"); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.MultiUIDefaults); +this.tables = new Array (0); +}); +Clazz_defineMethod (c$, "get", +function (key) { +var value = Clazz_superCall (this, javax.swing.MultiUIDefaults, "get", [key]); +if (value != null) { +return value; +}for (var i = 0; i < this.tables.length; i++) { +var table = this.tables[i]; +value = (table != null) ? table.get (key) : null; +if (value != null) { +return value; +}} +return null; +}, "~O"); +Clazz_defineMethod (c$, "get", +function (key, l) { +var value = Clazz_superCall (this, javax.swing.MultiUIDefaults, "get", [key, l]); +if (value != null) { +return value; +}for (var i = 0; i < this.tables.length; i++) { +var table = this.tables[i]; +value = (table != null) ? table.get (key, l) : null; +if (value != null) { +return value; +}} +return null; +}, "~O,java.util.Locale"); +Clazz_overrideMethod (c$, "size", +function () { +return this.entrySet ().size (); +}); +Clazz_overrideMethod (c$, "isEmpty", +function () { +return this.size () == 0; +}); +Clazz_overrideMethod (c$, "keys", +function () { +return new javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator (javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.KEYS, this.entrySet ()); +}); +Clazz_overrideMethod (c$, "elements", +function () { +return new javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator (javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.ELEMENTS, this.entrySet ()); +}); +Clazz_defineMethod (c$, "entrySet", +function () { +var set = new java.util.HashSet (); +for (var i = this.tables.length - 1; i >= 0; i--) { +if (this.tables[i] != null) { +set.addAll (this.tables[i].entrySet ()); +}} +set.addAll (Clazz_superCall (this, javax.swing.MultiUIDefaults, "entrySet", [])); +return set; +}); +Clazz_defineMethod (c$, "getUIError", +function (msg) { +if (this.tables.length > 0) { +this.tables[0].getUIError (msg); +} else { +Clazz_superCall (this, javax.swing.MultiUIDefaults, "getUIError", [msg]); +}}, "~S"); +Clazz_defineMethod (c$, "remove", +function (key) { +var value = null; +for (var i = this.tables.length - 1; i >= 0; i--) { +if (this.tables[i] != null) { +var v = this.tables[i].remove (key); +if (v != null) { +value = v; +}}} +var v = Clazz_superCall (this, javax.swing.MultiUIDefaults, "remove", [key]); +if (v != null) { +value = v; +}return value; +}, "~O"); +Clazz_defineMethod (c$, "clear", +function () { +Clazz_superCall (this, javax.swing.MultiUIDefaults, "clear", []); +for (var i = 0; i < this.tables.length; i++) { +var table = this.tables[i]; +if (table != null) { +table.clear (); +}} +}); +Clazz_overrideMethod (c$, "toString", +function () { +var buf = new StringBuffer (); +buf.append ("{"); +var keys = this.keys (); +while (keys.hasMoreElements ()) { +var key = keys.nextElement (); +buf.append (key + "=" + this.get (key) + ", "); +} +var length = buf.length (); +if (length > 1) { +buf.$delete (length - 2, length); +}buf.append ("}"); +return buf.toString (); +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.iterator = null; +this.type = null; +Clazz_instantialize (this, arguments); +}, javax.swing.MultiUIDefaults, "MultiUIDefaultsEnumerator", null, java.util.Enumeration); +Clazz_makeConstructor (c$, +function (a, b) { +this.type = a; +this.iterator = b.iterator (); +}, "javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type,java.util.Set"); +Clazz_overrideMethod (c$, "hasMoreElements", +function () { +return this.iterator.hasNext (); +}); +Clazz_overrideMethod (c$, "nextElement", +function () { +switch (this.type) { +case javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.KEYS: +return this.iterator.next ().getKey (); +case javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator.Type.ELEMENTS: +return this.iterator.next ().getValue (); +default: +return null; +} +}); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.MultiUIDefaults.MultiUIDefaultsEnumerator, "Type", Enum); +Clazz_defineEnumConstant (c$, "KEYS", 0, []); +Clazz_defineEnumConstant (c$, "ELEMENTS", 1, []); +c$ = Clazz_p0p (); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (null, "java.awt.Font", ["java.awt.font.TextAttribute", "java.awt.geom.AffineTransform", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.family = null; +this.name = null; +this.style = 0; +this.size = 0; +this.pointSize = 0; +this.$hasLayoutAttributes = false; +this.nonIdentityTx = false; +this.hash = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "Font"); +Clazz_makeConstructor (c$, +function (name, style, size) { +this.name = (name != null) ? name : "Default"; +this.style = (style & -4) == 0 ? style : 0; +this.size = size; +this.pointSize = size; +}, "~S,~N,~N"); +Clazz_makeConstructor (c$, + function (name, style, sizePts) { +this.name = (name != null) ? name : "Default"; +this.style = (style & -4) == 0 ? style : 0; +this.size = Clazz_doubleToInt (sizePts + 0.5); +this.pointSize = sizePts; +}, "~S,~N,~N"); +Clazz_makeConstructor (c$, +function (font) { +this.name = font.name; +this.style = font.style; +this.size = font.size; +this.pointSize = font.pointSize; +}, "java.awt.Font"); +Clazz_defineMethod (c$, "getTransform", +function () { +return new java.awt.geom.AffineTransform (); +}); +Clazz_defineMethod (c$, "getFamily", +function () { +return (this.family == null ? this.family = swingjs.JSToolkit.getFontFamily (this) : this.family); +}); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getFontName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getStyle", +function () { +return this.style; +}); +Clazz_defineMethod (c$, "getSize", +function () { +return this.size; +}); +Clazz_defineMethod (c$, "getSize2D", +function () { +return this.pointSize; +}); +Clazz_defineMethod (c$, "isPlain", +function () { +return this.style == 0; +}); +Clazz_defineMethod (c$, "isBold", +function () { +return (this.style & 1) != 0; +}); +Clazz_defineMethod (c$, "isItalic", +function () { +return (this.style & 2) != 0; +}); +Clazz_defineMethod (c$, "isTransformed", +function () { +return this.nonIdentityTx; +}); +Clazz_defineMethod (c$, "hasLayoutAttributes", +function () { +return this.$hasLayoutAttributes; +}); +c$.getFont = Clazz_defineMethod (c$, "getFont", +function (nm) { +return java.awt.Font.getFont (nm, null); +}, "~S"); +c$.decode = Clazz_defineMethod (c$, "decode", +function (str) { +var fontName = str; +var styleName = ""; +var fontSize = 12; +var fontStyle = 0; +if (str == null) { +return new java.awt.Font ("Dialog", fontStyle, fontSize); +}var lastHyphen = str.lastIndexOf ('-'); +var lastSpace = str.lastIndexOf (' '); +var sepChar = (lastHyphen > lastSpace) ? '-' : ' '; +var sizeIndex = str.lastIndexOf (sepChar); +var styleIndex = str.lastIndexOf (sepChar, sizeIndex - 1); +var strlen = str.length; +if (sizeIndex > 0 && sizeIndex + 1 < strlen) { +try { +fontSize = Integer.$valueOf (str.substring (sizeIndex + 1)).intValue (); +if (fontSize <= 0) { +fontSize = 12; +}} catch (e) { +if (Clazz_exceptionOf (e, NumberFormatException)) { +styleIndex = sizeIndex; +sizeIndex = strlen; +if (str.charAt (sizeIndex - 1) == sepChar) { +sizeIndex--; +}} else { +throw e; +} +} +}if (styleIndex >= 0 && styleIndex + 1 < strlen) { +styleName = str.substring (styleIndex + 1, sizeIndex); +styleName = styleName.toLowerCase (); +if (styleName.equals ("bolditalic")) { +fontStyle = 3; +} else if (styleName.equals ("italic")) { +fontStyle = 2; +} else if (styleName.equals ("bold")) { +fontStyle = 1; +} else if (styleName.equals ("plain")) { +fontStyle = 0; +} else { +styleIndex = sizeIndex; +if (str.charAt (styleIndex - 1) == sepChar) { +styleIndex--; +}}fontName = str.substring (0, styleIndex); +} else { +var fontEnd = strlen; +if (styleIndex > 0) { +fontEnd = styleIndex; +} else if (sizeIndex > 0) { +fontEnd = sizeIndex; +}if (fontEnd > 0 && str.charAt (fontEnd - 1) == sepChar) { +fontEnd--; +}fontName = str.substring (0, fontEnd); +}return new java.awt.Font (fontName, fontStyle, fontSize); +}, "~S"); +c$.getFont = Clazz_defineMethod (c$, "getFont", +function (nm, font) { +var str = null; +try { +str = System.getProperty (nm); +} catch (e) { +if (Clazz_exceptionOf (e, SecurityException)) { +} else { +throw e; +} +} +if (str == null) { +return font; +}return java.awt.Font.decode (str); +}, "~S,java.awt.Font"); +Clazz_overrideMethod (c$, "hashCode", +function () { +if (this.hash == 0) { +this.hash = this.name.hashCode () ^ this.style ^ this.size; +}return this.hash; +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (obj === this) { +return true; +}if (obj != null) { +try { +var font = obj; +if (this.size == font.size && this.style == font.style && this.nonIdentityTx == font.nonIdentityTx && this.$hasLayoutAttributes == font.$hasLayoutAttributes && this.pointSize == font.pointSize && this.name.equals (font.name)) { +return true; +}} catch (e) { +if (Clazz_exceptionOf (e, ClassCastException)) { +} else { +throw e; +} +} +}return false; +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +var strStyle; +if (this.isBold ()) { +strStyle = this.isItalic () ? "bolditalic" : "bold"; +} else { +strStyle = this.isItalic () ? "italic" : "plain"; +}return this.getClass ().getName () + "[family=" + this.getFamily () + ",name=" + this.name + ",style=" + strStyle + ",size=" + this.size + "]"; +}); +Clazz_defineMethod (c$, "getAvailableAttributes", +function () { +var attributes = Clazz_newArray (-1, [java.awt.font.TextAttribute.FAMILY, java.awt.font.TextAttribute.WEIGHT, java.awt.font.TextAttribute.WIDTH, java.awt.font.TextAttribute.SIZE, java.awt.font.TextAttribute.UNDERLINE, java.awt.font.TextAttribute.STRIKETHROUGH]); +return attributes; +}); +Clazz_defineMethod (c$, "deriveFont", +function (style, size) { +return new java.awt.Font (this.name, style, size); +}, "~N,~N"); +Clazz_defineMethod (c$, "deriveFont", +function (size) { +return new java.awt.Font (this.name, this.style, size); +}, "~N"); +Clazz_defineMethod (c$, "deriveFont", +function (style) { +return new java.awt.Font (this.name, style, this.size); +}, "~N"); +Clazz_defineMethod (c$, "hasUniformLineMetrics", +function () { +return false; +}); +Clazz_overrideMethod (c$, "finalize", +function () { +}); +Clazz_defineStatics (c$, +"DIALOG", "Dialog", +"DIALOG_INPUT", "DialogInput", +"SANS_SERIF", "SansSerif", +"SERIF", "Serif", +"MONOSPACED", "Monospaced", +"PLAIN", 0, +"BOLD", 1, +"ITALIC", 2, +"ROMAN_BASELINE", 0, +"CENTER_BASELINE", 1, +"HANGING_BASELINE", 2, +"TRUETYPE_FONT", 0, +"TYPE1_FONT", 1, +"LAYOUT_LEFT_TO_RIGHT", 0, +"LAYOUT_RIGHT_TO_LEFT", 1, +"LAYOUT_NO_START_CONTEXT", 2, +"LAYOUT_NO_LIMIT_CONTEXT", 4); +}); +Clazz_declarePackage ("java.awt.font"); +Clazz_load (["java.text.AttributedCharacterIterator", "java.lang.Boolean", "$.Float", "java.util.HashMap"], "java.awt.font.TextAttribute", ["java.io.InvalidObjectException"], function () { +c$ = Clazz_declareType (java.awt.font, "TextAttribute", java.text.AttributedCharacterIterator.Attribute); +Clazz_makeConstructor (c$, +function (name) { +Clazz_superConstructor (this, java.awt.font.TextAttribute, [name]); +if (this.getClass () === java.awt.font.TextAttribute) { +java.awt.font.TextAttribute.$instanceMap.put (name, this); +}}, "~S"); +Clazz_overrideMethod (c$, "readResolve", +function () { +if (this.getClass () !== java.awt.font.TextAttribute) { +throw new java.io.InvalidObjectException ("subclass didn't correctly implement readResolve"); +}var instance = java.awt.font.TextAttribute.$instanceMap.get (this.getName ()); +if (instance != null) { +return instance; +} else { +throw new java.io.InvalidObjectException ("unknown attribute name"); +}}); +c$.$instanceMap = c$.prototype.$instanceMap = new java.util.HashMap (29); +c$.FAMILY = c$.prototype.FAMILY = new java.awt.font.TextAttribute ("family"); +c$.WEIGHT = c$.prototype.WEIGHT = new java.awt.font.TextAttribute ("weight"); +c$.WEIGHT_EXTRA_LIGHT = c$.prototype.WEIGHT_EXTRA_LIGHT = Float.$valueOf (0.5); +c$.WEIGHT_LIGHT = c$.prototype.WEIGHT_LIGHT = Float.$valueOf (0.75); +c$.WEIGHT_DEMILIGHT = c$.prototype.WEIGHT_DEMILIGHT = Float.$valueOf (0.875); +c$.WEIGHT_REGULAR = c$.prototype.WEIGHT_REGULAR = Float.$valueOf (1.0); +c$.WEIGHT_SEMIBOLD = c$.prototype.WEIGHT_SEMIBOLD = Float.$valueOf (1.25); +c$.WEIGHT_MEDIUM = c$.prototype.WEIGHT_MEDIUM = Float.$valueOf (1.5); +c$.WEIGHT_DEMIBOLD = c$.prototype.WEIGHT_DEMIBOLD = Float.$valueOf (1.75); +c$.WEIGHT_BOLD = c$.prototype.WEIGHT_BOLD = Float.$valueOf (2.0); +c$.WEIGHT_HEAVY = c$.prototype.WEIGHT_HEAVY = Float.$valueOf (2.25); +c$.WEIGHT_EXTRABOLD = c$.prototype.WEIGHT_EXTRABOLD = Float.$valueOf (2.5); +c$.WEIGHT_ULTRABOLD = c$.prototype.WEIGHT_ULTRABOLD = Float.$valueOf (2.75); +c$.WIDTH = c$.prototype.WIDTH = new java.awt.font.TextAttribute ("width"); +c$.WIDTH_CONDENSED = c$.prototype.WIDTH_CONDENSED = Float.$valueOf (0.75); +c$.WIDTH_SEMI_CONDENSED = c$.prototype.WIDTH_SEMI_CONDENSED = Float.$valueOf (0.875); +c$.WIDTH_REGULAR = c$.prototype.WIDTH_REGULAR = Float.$valueOf (1.0); +c$.WIDTH_SEMI_EXTENDED = c$.prototype.WIDTH_SEMI_EXTENDED = Float.$valueOf (1.25); +c$.WIDTH_EXTENDED = c$.prototype.WIDTH_EXTENDED = Float.$valueOf (1.5); +c$.POSTURE = c$.prototype.POSTURE = new java.awt.font.TextAttribute ("posture"); +c$.POSTURE_REGULAR = c$.prototype.POSTURE_REGULAR = Float.$valueOf (0.0); +c$.POSTURE_OBLIQUE = c$.prototype.POSTURE_OBLIQUE = Float.$valueOf (0.20); +c$.SIZE = c$.prototype.SIZE = new java.awt.font.TextAttribute ("size"); +c$.TRANSFORM = c$.prototype.TRANSFORM = new java.awt.font.TextAttribute ("transform"); +c$.SUPERSCRIPT = c$.prototype.SUPERSCRIPT = new java.awt.font.TextAttribute ("superscript"); +c$.SUPERSCRIPT_SUPER = c$.prototype.SUPERSCRIPT_SUPER = Integer.$valueOf (1); +c$.SUPERSCRIPT_SUB = c$.prototype.SUPERSCRIPT_SUB = Integer.$valueOf (-1); +c$.FONT = c$.prototype.FONT = new java.awt.font.TextAttribute ("font"); +c$.CHAR_REPLACEMENT = c$.prototype.CHAR_REPLACEMENT = new java.awt.font.TextAttribute ("char_replacement"); +c$.FOREGROUND = c$.prototype.FOREGROUND = new java.awt.font.TextAttribute ("foreground"); +c$.BACKGROUND = c$.prototype.BACKGROUND = new java.awt.font.TextAttribute ("background"); +c$.UNDERLINE = c$.prototype.UNDERLINE = new java.awt.font.TextAttribute ("underline"); +c$.UNDERLINE_ON = c$.prototype.UNDERLINE_ON = Integer.$valueOf (0); +c$.STRIKETHROUGH = c$.prototype.STRIKETHROUGH = new java.awt.font.TextAttribute ("strikethrough"); +c$.STRIKETHROUGH_ON = c$.prototype.STRIKETHROUGH_ON = Boolean.TRUE; +c$.RUN_DIRECTION = c$.prototype.RUN_DIRECTION = new java.awt.font.TextAttribute ("run_direction"); +c$.RUN_DIRECTION_LTR = c$.prototype.RUN_DIRECTION_LTR = Boolean.FALSE; +c$.RUN_DIRECTION_RTL = c$.prototype.RUN_DIRECTION_RTL = Boolean.TRUE; +c$.BIDI_EMBEDDING = c$.prototype.BIDI_EMBEDDING = new java.awt.font.TextAttribute ("bidi_embedding"); +c$.JUSTIFICATION = c$.prototype.JUSTIFICATION = new java.awt.font.TextAttribute ("justification"); +c$.JUSTIFICATION_FULL = c$.prototype.JUSTIFICATION_FULL = Float.$valueOf (1.0); +c$.JUSTIFICATION_NONE = c$.prototype.JUSTIFICATION_NONE = Float.$valueOf (0.0); +c$.INPUT_METHOD_HIGHLIGHT = c$.prototype.INPUT_METHOD_HIGHLIGHT = new java.awt.font.TextAttribute ("input method highlight"); +c$.INPUT_METHOD_UNDERLINE = c$.prototype.INPUT_METHOD_UNDERLINE = new java.awt.font.TextAttribute ("input method underline"); +c$.UNDERLINE_LOW_ONE_PIXEL = c$.prototype.UNDERLINE_LOW_ONE_PIXEL = Integer.$valueOf (1); +c$.UNDERLINE_LOW_TWO_PIXEL = c$.prototype.UNDERLINE_LOW_TWO_PIXEL = Integer.$valueOf (2); +c$.UNDERLINE_LOW_DOTTED = c$.prototype.UNDERLINE_LOW_DOTTED = Integer.$valueOf (3); +c$.UNDERLINE_LOW_GRAY = c$.prototype.UNDERLINE_LOW_GRAY = Integer.$valueOf (4); +c$.UNDERLINE_LOW_DASHED = c$.prototype.UNDERLINE_LOW_DASHED = Integer.$valueOf (5); +c$.SWAP_COLORS = c$.prototype.SWAP_COLORS = new java.awt.font.TextAttribute ("swap_colors"); +c$.SWAP_COLORS_ON = c$.prototype.SWAP_COLORS_ON = Boolean.TRUE; +c$.NUMERIC_SHAPING = c$.prototype.NUMERIC_SHAPING = new java.awt.font.TextAttribute ("numeric_shaping"); +c$.KERNING = c$.prototype.KERNING = new java.awt.font.TextAttribute ("kerning"); +c$.KERNING_ON = c$.prototype.KERNING_ON = Integer.$valueOf (1); +c$.LIGATURES = c$.prototype.LIGATURES = new java.awt.font.TextAttribute ("ligatures"); +c$.LIGATURES_ON = c$.prototype.LIGATURES_ON = Integer.$valueOf (1); +c$.TRACKING = c$.prototype.TRACKING = new java.awt.font.TextAttribute ("tracking"); +c$.TRACKING_TIGHT = c$.prototype.TRACKING_TIGHT = Float.$valueOf (-0.04); +c$.TRACKING_LOOSE = c$.prototype.TRACKING_LOOSE = Float.$valueOf (.04); +}); +Clazz_declarePackage ("java.text"); +Clazz_load (["java.text.CharacterIterator", "java.io.InvalidObjectException", "java.util.HashMap"], "java.text.AttributedCharacterIterator", null, function () { +Clazz_declareInterface (java.text, "AttributedCharacterIterator", java.text.CharacterIterator); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.name = null; +Clazz_instantialize (this, arguments); +}, java.text.AttributedCharacterIterator, "Attribute", null, java.io.Serializable); +Clazz_makeConstructor (c$, +function (a) { +this.name = a; +if (this.getClass () === java.text.AttributedCharacterIterator.Attribute) { +java.text.AttributedCharacterIterator.Attribute.instanceMap.put (a, this); +}}, "~S"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "(" + this.name + ")"; +}); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "readResolve", +function () { +if (this.getClass () !== java.text.AttributedCharacterIterator.Attribute) { +throw new java.io.InvalidObjectException ("subclass didn't correctly implement readResolve"); +}var a = java.text.AttributedCharacterIterator.Attribute.instanceMap.get (this.getName ()); +if (a != null) { +return a; +} else { +throw new java.io.InvalidObjectException ("unknown attribute name"); +}}); +c$.instanceMap = c$.prototype.instanceMap = new java.util.HashMap (7); +c$.LANGUAGE = c$.prototype.LANGUAGE = new java.text.AttributedCharacterIterator.Attribute ("language"); +c$.READING = c$.prototype.READING = new java.text.AttributedCharacterIterator.Attribute ("reading"); +c$.INPUT_METHOD_SEGMENT = c$.prototype.INPUT_METHOD_SEGMENT = new java.text.AttributedCharacterIterator.Attribute ("input_method_segment"); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.text"); +c$ = Clazz_declareInterface (java.text, "CharacterIterator", Cloneable); +Clazz_defineStatics (c$, +"DONE", '\uFFFF'); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (null, "java.awt.geom.Point2D", ["java.lang.Double", "$.InternalError"], function () { +c$ = Clazz_declareType (java.awt.geom, "Point2D", null, Cloneable); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setLocation", +function (p) { +this.setLocation (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +c$.distanceSq = Clazz_defineMethod (c$, "distanceSq", +function (x1, y1, x2, y2) { +x1 -= x2; +y1 -= y2; +return (x1 * x1 + y1 * y1); +}, "~N,~N,~N,~N"); +c$.distance = Clazz_defineMethod (c$, "distance", +function (x1, y1, x2, y2) { +x1 -= x2; +y1 -= y2; +return Math.sqrt (x1 * x1 + y1 * y1); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "distanceSq", +function (px, py) { +px -= this.getX (); +py -= this.getY (); +return (px * px + py * py); +}, "~N,~N"); +Clazz_defineMethod (c$, "distanceSq", +function (pt) { +var px = pt.getX () - this.getX (); +var py = pt.getY () - this.getY (); +return (px * px + py * py); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "distance", +function (px, py) { +px -= this.getX (); +py -= this.getY (); +return Math.sqrt (px * px + py * py); +}, "~N,~N"); +Clazz_defineMethod (c$, "distance", +function (pt) { +var px = pt.getX () - this.getX (); +var py = pt.getY () - this.getY (); +return Math.sqrt (px * px + py * py); +}, "java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.Point2D, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_overrideMethod (c$, "hashCode", +function () { +var bits = java.lang.Double.doubleToLongBits (this.getX ()); +bits ^= java.lang.Double.doubleToLongBits (this.getY ()) * 31; +return ((bits) ^ ((bits >> 32))); +}); +Clazz_defineMethod (c$, "equals", +function (obj) { +if (Clazz_instanceOf (obj, java.awt.geom.Point2D)) { +var p2d = obj; +return (this.getX () == p2d.getX ()) && (this.getY () == p2d.getY ()); +}return Clazz_superCall (this, java.awt.geom.Point2D, "equals", [obj]); +}, "~O"); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Point2D, "Float", java.awt.geom.Point2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.Point2D.Float, []); +}); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Point2D.Float, []); +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "setLocation", +function (a, b) { +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz_defineMethod (c$, "setLocation", +function (a, b) { +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz_overrideMethod (c$, "toString", +function () { +return "Point2D.Float[" + this.x + ", " + this.y + "]"; +}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Point2D, "Double", java.awt.geom.Point2D); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.geom.Point2D.Double, []); +}); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Point2D.Double, []); +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz_overrideMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_overrideMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "setLocation", +function (a, b) { +this.x = a; +this.y = b; +}, "~N,~N"); +Clazz_overrideMethod (c$, "toString", +function () { +return "Point2D.Double[" + this.x + ", " + this.y + "]"; +}); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (null, "java.awt.geom.AffineTransform", ["java.lang.Double", "$.InternalError", "JU.AU", "java.awt.geom.NoninvertibleTransformException", "$.Path2D", "$.Point2D", "java.awt.geom.Point2D.Double"], function () { +c$ = Clazz_decorateAsClass (function () { +this.m00 = 0; +this.m10 = 0; +this.m01 = 0; +this.m11 = 0; +this.m02 = 0; +this.m12 = 0; +this.state = 0; +this.type = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "AffineTransform", null, [Cloneable, java.io.Serializable]); +Clazz_makeConstructor (c$, + function (m00, m10, m01, m11, m02, m12, state) { +{ +switch (arguments.length) { case 0: this.m00 = this.m11 = 1.0; +return; +case 1: +if (Clazz_instanceOf(m00, java.awt.geom.AffineTransform)) { +var Tx = m00; this.m00 = +Tx.m00; this.m10 = Tx.m10; this.m01 = Tx.m01; this.m11 = +Tx.m11; this.m02 = Tx.m02; this.m12 = Tx.m12; this.state = +Tx.state; this.type = Tx.type; +} else { +var flatmatrix = m00; +this.m00 = flatmatrix[0]; +this.m10 = flatmatrix[1]; +this.m01 = flatmatrix[2]; +this.m11 = flatmatrix[3]; +if (flatmatrix.length > 5) { +this.m02 = flatmatrix[4]; +this.m12 = flatmatrix[5]; +} +this.updateState(); +} +return; +case 6: +this.m00 = m00; +this.m10 = m10; +this.m01 = m01; +this.m11 = m11; +this.m02 = m02; +this.m12 = m12; +this.updateState(); +return; +} +}this.m00 = m00; +this.m10 = m10; +this.m01 = m01; +this.m11 = m11; +this.m02 = m02; +this.m12 = m12; +this.state = state; +this.type = -1; +}, "~N,~N,~N,~N,~N,~N,~N"); +c$.getTranslateInstance = Clazz_defineMethod (c$, "getTranslateInstance", +function (tx, ty) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToTranslation (tx, ty); +return Tx; +}, "~N,~N"); +c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", +function (theta) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToRotation (theta); +return Tx; +}, "~N"); +c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", +function (theta, anchorx, anchory) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToRotation (theta, anchorx, anchory); +return Tx; +}, "~N,~N,~N"); +c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", +function (vecx, vecy) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToRotation (vecx, vecy); +return Tx; +}, "~N,~N"); +c$.getRotateInstance = Clazz_defineMethod (c$, "getRotateInstance", +function (vecx, vecy, anchorx, anchory) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToRotation (vecx, vecy, anchorx, anchory); +return Tx; +}, "~N,~N,~N,~N"); +c$.getQuadrantRotateInstance = Clazz_defineMethod (c$, "getQuadrantRotateInstance", +function (numquadrants) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToQuadrantRotation (numquadrants); +return Tx; +}, "~N"); +c$.getQuadrantRotateInstance = Clazz_defineMethod (c$, "getQuadrantRotateInstance", +function (numquadrants, anchorx, anchory) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToQuadrantRotation (numquadrants, anchorx, anchory); +return Tx; +}, "~N,~N,~N"); +c$.getScaleInstance = Clazz_defineMethod (c$, "getScaleInstance", +function (sx, sy) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToScale (sx, sy); +return Tx; +}, "~N,~N"); +c$.getShearInstance = Clazz_defineMethod (c$, "getShearInstance", +function (shx, shy) { +var Tx = new java.awt.geom.AffineTransform (); +Tx.setToShear (shx, shy); +return Tx; +}, "~N,~N"); +Clazz_defineMethod (c$, "getType", +function () { +if (this.type == -1) { +this.calculateType (); +}return this.type; +}); +Clazz_defineMethod (c$, "calculateType", + function () { +var ret = 0; +var sgn0; +var sgn1; +var M0; +var M1; +var M2; +var M3; +this.updateState (); +switch (this.state) { +default: +this.stateError (); +case (7): +ret = 1; +case (6): +if ((M0 = this.m00) * (M2 = this.m01) + (M3 = this.m10) * (M1 = this.m11) != 0) { +this.type = 32; +return; +}sgn0 = (M0 >= 0.0); +sgn1 = (M1 >= 0.0); +if (sgn0 == sgn1) { +if (M0 != M1 || M2 != -M3) { +ret |= (20); +} else if (M0 * M1 - M2 * M3 != 1.0) { +ret |= (18); +} else { +ret |= 16; +}} else { +if (M0 != -M1 || M2 != M3) { +ret |= (84); +} else if (M0 * M1 - M2 * M3 != 1.0) { +ret |= (82); +} else { +ret |= (80); +}}break; +case (5): +ret = 1; +case (4): +sgn0 = ((M0 = this.m01) >= 0.0); +sgn1 = ((M1 = this.m10) >= 0.0); +if (sgn0 != sgn1) { +if (M0 != -M1) { +ret |= (12); +} else if (M0 != 1.0 && M0 != -1.0) { +ret |= (10); +} else { +ret |= 8; +}} else { +if (M0 == M1) { +ret |= (74); +} else { +ret |= (76); +}}break; +case (3): +ret = 1; +case (2): +sgn0 = ((M0 = this.m00) >= 0.0); +sgn1 = ((M1 = this.m11) >= 0.0); +if (sgn0 == sgn1) { +if (sgn0) { +if (M0 == M1) { +ret |= 2; +} else { +ret |= 4; +}} else { +if (M0 != M1) { +ret |= (12); +} else if (M0 != -1.0) { +ret |= (10); +} else { +ret |= 8; +}}} else { +if (M0 == -M1) { +if (M0 == 1.0 || M0 == -1.0) { +ret |= 64; +} else { +ret |= (66); +}} else { +ret |= (68); +}}break; +case (1): +ret = 1; +break; +case (0): +break; +} +this.type = ret; +}); +Clazz_defineMethod (c$, "getDeterminant", +function () { +switch (this.state) { +default: +this.stateError (); +case (7): +case (6): +return this.m00 * this.m11 - this.m01 * this.m10; +case (5): +case (4): +return -(this.m01 * this.m10); +case (3): +case (2): +return this.m00 * this.m11; +case (1): +case (0): +return 1.0; +} +}); +Clazz_defineMethod (c$, "updateState", +function () { +if (this.m01 == 0.0 && this.m10 == 0.0) { +if (this.m00 == 1.0 && this.m11 == 1.0) { +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 0; +this.type = 0; +} else { +this.state = 1; +this.type = 1; +}} else { +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 2; +this.type = -1; +} else { +this.state = (3); +this.type = -1; +}}} else { +if (this.m00 == 0.0 && this.m11 == 0.0) { +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 4; +this.type = -1; +} else { +this.state = (5); +this.type = -1; +}} else { +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = (6); +this.type = -1; +} else { +this.state = (7); +this.type = -1; +}}}}); +Clazz_defineMethod (c$, "stateError", + function () { +throw new InternalError ("missing case in transform state switch"); +}); +Clazz_defineMethod (c$, "getMatrix", +function (flatmatrix) { +flatmatrix[0] = this.m00; +flatmatrix[1] = this.m10; +flatmatrix[2] = this.m01; +flatmatrix[3] = this.m11; +if (flatmatrix.length > 5) { +flatmatrix[4] = this.m02; +flatmatrix[5] = this.m12; +}}, "~A"); +Clazz_defineMethod (c$, "getScaleX", +function () { +return this.m00; +}); +Clazz_defineMethod (c$, "getScaleY", +function () { +return this.m11; +}); +Clazz_defineMethod (c$, "getShearX", +function () { +return this.m01; +}); +Clazz_defineMethod (c$, "getShearY", +function () { +return this.m10; +}); +Clazz_defineMethod (c$, "getTranslateX", +function () { +return this.m02; +}); +Clazz_defineMethod (c$, "getTranslateY", +function () { +return this.m12; +}); +Clazz_defineMethod (c$, "translate", +function (tx, ty) { +switch (this.state) { +default: +this.stateError (); +case (7): +this.m02 = tx * this.m00 + ty * this.m01 + this.m02; +this.m12 = tx * this.m10 + ty * this.m11 + this.m12; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 6; +if (this.type != -1) { +this.type -= 1; +}}return; +case (6): +this.m02 = tx * this.m00 + ty * this.m01; +this.m12 = tx * this.m10 + ty * this.m11; +if (this.m02 != 0.0 || this.m12 != 0.0) { +this.state = 7; +this.type |= 1; +}return; +case (5): +this.m02 = ty * this.m01 + this.m02; +this.m12 = tx * this.m10 + this.m12; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 4; +if (this.type != -1) { +this.type -= 1; +}}return; +case (4): +this.m02 = ty * this.m01; +this.m12 = tx * this.m10; +if (this.m02 != 0.0 || this.m12 != 0.0) { +this.state = 5; +this.type |= 1; +}return; +case (3): +this.m02 = tx * this.m00 + this.m02; +this.m12 = ty * this.m11 + this.m12; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 2; +if (this.type != -1) { +this.type -= 1; +}}return; +case (2): +this.m02 = tx * this.m00; +this.m12 = ty * this.m11; +if (this.m02 != 0.0 || this.m12 != 0.0) { +this.state = 3; +this.type |= 1; +}return; +case (1): +this.m02 = tx + this.m02; +this.m12 = ty + this.m12; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 0; +this.type = 0; +}return; +case (0): +this.m02 = tx; +this.m12 = ty; +if (tx != 0.0 || ty != 0.0) { +this.state = 1; +this.type = 1; +}return; +} +}, "~N,~N"); +Clazz_defineMethod (c$, "rotate90", + function () { +var M0 = this.m00; +this.m00 = this.m01; +this.m01 = -M0; +M0 = this.m10; +this.m10 = this.m11; +this.m11 = -M0; +var state = java.awt.geom.AffineTransform.rot90conversion[this.state]; +if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) { +state -= 2; +}this.state = state; +this.type = -1; +}); +Clazz_defineMethod (c$, "rotate180", + function () { +this.m00 = -this.m00; +this.m11 = -this.m11; +var state = this.state; +if ((state & (4)) != 0) { +this.m01 = -this.m01; +this.m10 = -this.m10; +} else { +if (this.m00 == 1.0 && this.m11 == 1.0) { +this.state = state & -3; +} else { +this.state = state | 2; +}}this.type = -1; +}); +Clazz_defineMethod (c$, "rotate270", + function () { +var M0 = this.m00; +this.m00 = -this.m01; +this.m01 = M0; +M0 = this.m10; +this.m10 = -this.m11; +this.m11 = M0; +var state = java.awt.geom.AffineTransform.rot90conversion[this.state]; +if ((state & (6)) == 2 && this.m00 == 1.0 && this.m11 == 1.0) { +state -= 2; +}this.state = state; +this.type = -1; +}); +Clazz_defineMethod (c$, "rotate", +function (theta) { +var sin = Math.sin (theta); +if (sin == 1.0) { +this.rotate90 (); +} else if (sin == -1.0) { +this.rotate270 (); +} else { +var cos = Math.cos (theta); +if (cos == -1.0) { +this.rotate180 (); +} else if (cos != 1.0) { +var M0; +var M1; +M0 = this.m00; +M1 = this.m01; +this.m00 = cos * M0 + sin * M1; +this.m01 = -sin * M0 + cos * M1; +M0 = this.m10; +M1 = this.m11; +this.m10 = cos * M0 + sin * M1; +this.m11 = -sin * M0 + cos * M1; +this.updateState (); +}}}, "~N"); +Clazz_defineMethod (c$, "rotate", +function (theta, anchorx, anchory) { +this.translate (anchorx, anchory); +this.rotate (theta); +this.translate (-anchorx, -anchory); +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "rotate", +function (vecx, vecy) { +if (vecy == 0.0) { +if (vecx < 0.0) { +this.rotate180 (); +}} else if (vecx == 0.0) { +if (vecy > 0.0) { +this.rotate90 (); +} else { +this.rotate270 (); +}} else { +var len = Math.sqrt (vecx * vecx + vecy * vecy); +var sin = vecy / len; +var cos = vecx / len; +var M0; +var M1; +M0 = this.m00; +M1 = this.m01; +this.m00 = cos * M0 + sin * M1; +this.m01 = -sin * M0 + cos * M1; +M0 = this.m10; +M1 = this.m11; +this.m10 = cos * M0 + sin * M1; +this.m11 = -sin * M0 + cos * M1; +this.updateState (); +}}, "~N,~N"); +Clazz_defineMethod (c$, "rotate", +function (vecx, vecy, anchorx, anchory) { +this.translate (anchorx, anchory); +this.rotate (vecx, vecy); +this.translate (-anchorx, -anchory); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "quadrantRotate", +function (numquadrants) { +switch (numquadrants & 3) { +case 0: +break; +case 1: +this.rotate90 (); +break; +case 2: +this.rotate180 (); +break; +case 3: +this.rotate270 (); +break; +} +}, "~N"); +Clazz_defineMethod (c$, "quadrantRotate", +function (numquadrants, anchorx, anchory) { +switch (numquadrants & 3) { +case 0: +return; +case 1: +this.m02 += anchorx * (this.m00 - this.m01) + anchory * (this.m01 + this.m00); +this.m12 += anchorx * (this.m10 - this.m11) + anchory * (this.m11 + this.m10); +this.rotate90 (); +break; +case 2: +this.m02 += anchorx * (this.m00 + this.m00) + anchory * (this.m01 + this.m01); +this.m12 += anchorx * (this.m10 + this.m10) + anchory * (this.m11 + this.m11); +this.rotate180 (); +break; +case 3: +this.m02 += anchorx * (this.m00 + this.m01) + anchory * (this.m01 - this.m00); +this.m12 += anchorx * (this.m10 + this.m11) + anchory * (this.m11 - this.m10); +this.rotate270 (); +break; +} +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state &= -2; +} else { +this.state |= 1; +}}, "~N,~N,~N"); +Clazz_defineMethod (c$, "scale", +function (sx, sy) { +var state = this.state; +switch (state) { +default: +this.stateError (); +case (7): +case (6): +this.m00 *= sx; +this.m11 *= sy; +case (5): +case (4): +this.m01 *= sy; +this.m10 *= sx; +if (this.m01 == 0 && this.m10 == 0) { +state &= 1; +if (this.m00 == 1.0 && this.m11 == 1.0) { +this.type = (state == 0 ? 0 : 1); +} else { +state |= 2; +this.type = -1; +}this.state = state; +}return; +case (3): +case (2): +this.m00 *= sx; +this.m11 *= sy; +if (this.m00 == 1.0 && this.m11 == 1.0) { +this.state = (state &= 1); +this.type = (state == 0 ? 0 : 1); +} else { +this.type = -1; +}return; +case (1): +case (0): +this.m00 = sx; +this.m11 = sy; +if (sx != 1.0 || sy != 1.0) { +this.state = state | 2; +this.type = -1; +}return; +} +}, "~N,~N"); +Clazz_defineMethod (c$, "shear", +function (shx, shy) { +var state = this.state; +switch (state) { +default: +this.stateError (); +case (7): +case (6): +var M0; +var M1; +M0 = this.m00; +M1 = this.m01; +this.m00 = M0 + M1 * shy; +this.m01 = M0 * shx + M1; +M0 = this.m10; +M1 = this.m11; +this.m10 = M0 + M1 * shy; +this.m11 = M0 * shx + M1; +this.updateState (); +return; +case (5): +case (4): +this.m00 = this.m01 * shy; +this.m11 = this.m10 * shx; +if (this.m00 != 0.0 || this.m11 != 0.0) { +this.state = state | 2; +}this.type = -1; +return; +case (3): +case (2): +this.m01 = this.m00 * shx; +this.m10 = this.m11 * shy; +if (this.m01 != 0.0 || this.m10 != 0.0) { +this.state = state | 4; +}this.type = -1; +return; +case (1): +case (0): +this.m01 = shx; +this.m10 = shy; +if (this.m01 != 0.0 || this.m10 != 0.0) { +this.state = state | 2 | 4; +this.type = -1; +}return; +} +}, "~N,~N"); +Clazz_defineMethod (c$, "setToIdentity", +function () { +this.m00 = this.m11 = 1.0; +this.m10 = this.m01 = this.m02 = this.m12 = 0.0; +this.state = 0; +this.type = 0; +}); +Clazz_defineMethod (c$, "setToTranslation", +function (tx, ty) { +this.m00 = 1.0; +this.m10 = 0.0; +this.m01 = 0.0; +this.m11 = 1.0; +this.m02 = tx; +this.m12 = ty; +if (tx != 0.0 || ty != 0.0) { +this.state = 1; +this.type = 1; +} else { +this.state = 0; +this.type = 0; +}}, "~N,~N"); +Clazz_defineMethod (c$, "setToRotation", +function (theta) { +var sin = Math.sin (theta); +var cos; +if (sin == 1.0 || sin == -1.0) { +cos = 0.0; +this.state = 4; +this.type = 8; +} else { +cos = Math.cos (theta); +if (cos == -1.0) { +sin = 0.0; +this.state = 2; +this.type = 8; +} else if (cos == 1.0) { +sin = 0.0; +this.state = 0; +this.type = 0; +} else { +this.state = 6; +this.type = 16; +}}this.m00 = cos; +this.m10 = sin; +this.m01 = -sin; +this.m11 = cos; +this.m02 = 0.0; +this.m12 = 0.0; +}, "~N"); +Clazz_defineMethod (c$, "setToRotation", +function (theta, anchorx, anchory) { +this.setToRotation (theta); +var sin = this.m10; +var oneMinusCos = 1.0 - this.m00; +this.m02 = anchorx * oneMinusCos + anchory * sin; +this.m12 = anchory * oneMinusCos - anchorx * sin; +if (this.m02 != 0.0 || this.m12 != 0.0) { +this.state |= 1; +this.type |= 1; +}}, "~N,~N,~N"); +Clazz_defineMethod (c$, "setToRotation", +function (vecx, vecy) { +var sin; +var cos; +if (vecy == 0) { +sin = 0.0; +if (vecx < 0.0) { +cos = -1.0; +this.state = 2; +this.type = 8; +} else { +cos = 1.0; +this.state = 0; +this.type = 0; +}} else if (vecx == 0) { +cos = 0.0; +sin = (vecy > 0.0) ? 1.0 : -1.0; +this.state = 4; +this.type = 8; +} else { +var len = Math.sqrt (vecx * vecx + vecy * vecy); +cos = vecx / len; +sin = vecy / len; +this.state = 6; +this.type = 16; +}this.m00 = cos; +this.m10 = sin; +this.m01 = -sin; +this.m11 = cos; +this.m02 = 0.0; +this.m12 = 0.0; +}, "~N,~N"); +Clazz_defineMethod (c$, "setToRotation", +function (vecx, vecy, anchorx, anchory) { +this.setToRotation (vecx, vecy); +var sin = this.m10; +var oneMinusCos = 1.0 - this.m00; +this.m02 = anchorx * oneMinusCos + anchory * sin; +this.m12 = anchory * oneMinusCos - anchorx * sin; +if (this.m02 != 0.0 || this.m12 != 0.0) { +this.state |= 1; +this.type |= 1; +}}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setToQuadrantRotation", +function (numquadrants) { +switch (numquadrants & 3) { +case 0: +this.m00 = 1.0; +this.m10 = 0.0; +this.m01 = 0.0; +this.m11 = 1.0; +this.m02 = 0.0; +this.m12 = 0.0; +this.state = 0; +this.type = 0; +break; +case 1: +this.m00 = 0.0; +this.m10 = 1.0; +this.m01 = -1.0; +this.m11 = 0.0; +this.m02 = 0.0; +this.m12 = 0.0; +this.state = 4; +this.type = 8; +break; +case 2: +this.m00 = -1.0; +this.m10 = 0.0; +this.m01 = 0.0; +this.m11 = -1.0; +this.m02 = 0.0; +this.m12 = 0.0; +this.state = 2; +this.type = 8; +break; +case 3: +this.m00 = 0.0; +this.m10 = -1.0; +this.m01 = 1.0; +this.m11 = 0.0; +this.m02 = 0.0; +this.m12 = 0.0; +this.state = 4; +this.type = 8; +break; +} +}, "~N"); +Clazz_defineMethod (c$, "setToQuadrantRotation", +function (numquadrants, anchorx, anchory) { +switch (numquadrants & 3) { +case 0: +this.m00 = 1.0; +this.m10 = 0.0; +this.m01 = 0.0; +this.m11 = 1.0; +this.m02 = 0.0; +this.m12 = 0.0; +this.state = 0; +this.type = 0; +break; +case 1: +this.m00 = 0.0; +this.m10 = 1.0; +this.m01 = -1.0; +this.m11 = 0.0; +this.m02 = anchorx + anchory; +this.m12 = anchory - anchorx; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 4; +this.type = 8; +} else { +this.state = 5; +this.type = 9; +}break; +case 2: +this.m00 = -1.0; +this.m10 = 0.0; +this.m01 = 0.0; +this.m11 = -1.0; +this.m02 = anchorx + anchorx; +this.m12 = anchory + anchory; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 2; +this.type = 8; +} else { +this.state = 3; +this.type = 9; +}break; +case 3: +this.m00 = 0.0; +this.m10 = -1.0; +this.m01 = 1.0; +this.m11 = 0.0; +this.m02 = anchorx - anchory; +this.m12 = anchory + anchorx; +if (this.m02 == 0.0 && this.m12 == 0.0) { +this.state = 4; +this.type = 8; +} else { +this.state = 5; +this.type = 9; +}break; +} +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "setToScale", +function (sx, sy) { +this.m00 = sx; +this.m10 = 0.0; +this.m01 = 0.0; +this.m11 = sy; +this.m02 = 0.0; +this.m12 = 0.0; +if (sx != 1.0 || sy != 1.0) { +this.state = 2; +this.type = -1; +} else { +this.state = 0; +this.type = 0; +}}, "~N,~N"); +Clazz_defineMethod (c$, "setToShear", +function (shx, shy) { +this.m00 = 1.0; +this.m01 = shx; +this.m10 = shy; +this.m11 = 1.0; +this.m02 = 0.0; +this.m12 = 0.0; +if (shx != 0.0 || shy != 0.0) { +this.state = (6); +this.type = -1; +} else { +this.state = 0; +this.type = 0; +}}, "~N,~N"); +Clazz_defineMethod (c$, "setTransform", +function (Tx) { +this.m00 = Tx.m00; +this.m10 = Tx.m10; +this.m01 = Tx.m01; +this.m11 = Tx.m11; +this.m02 = Tx.m02; +this.m12 = Tx.m12; +this.state = Tx.state; +this.type = Tx.type; +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "setTransform", +function (m00, m10, m01, m11, m02, m12) { +this.m00 = m00; +this.m10 = m10; +this.m01 = m01; +this.m11 = m11; +this.m02 = m02; +this.m12 = m12; +this.updateState (); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "concatenate", +function (Tx) { +var M0; +var M1; +var T00; +var T01; +var T10; +var T11; +var T02; +var T12; +var mystate = this.state; +var txstate = Tx.state; +switch ((txstate << 3) | mystate) { +case (0): +case (1): +case (2): +case (3): +case (4): +case (5): +case (6): +case (7): +return; +case (56): +this.m01 = Tx.m01; +this.m10 = Tx.m10; +case (24): +this.m00 = Tx.m00; +this.m11 = Tx.m11; +case (8): +this.m02 = Tx.m02; +this.m12 = Tx.m12; +this.state = txstate; +this.type = Tx.type; +return; +case (48): +this.m01 = Tx.m01; +this.m10 = Tx.m10; +case (16): +this.m00 = Tx.m00; +this.m11 = Tx.m11; +this.state = txstate; +this.type = Tx.type; +return; +case (40): +this.m02 = Tx.m02; +this.m12 = Tx.m12; +case (32): +this.m01 = Tx.m01; +this.m10 = Tx.m10; +this.m00 = this.m11 = 0.0; +this.state = txstate; +this.type = Tx.type; +return; +case (15): +case (14): +case (13): +case (12): +case (11): +case (10): +case (9): +this.translate (Tx.m02, Tx.m12); +return; +case (23): +case (22): +case (21): +case (20): +case (19): +case (18): +case (17): +this.scale (Tx.m00, Tx.m11); +return; +case (39): +case (38): +T01 = Tx.m01; +T10 = Tx.m10; +M0 = this.m00; +this.m00 = this.m01 * T10; +this.m01 = M0 * T01; +M0 = this.m10; +this.m10 = this.m11 * T10; +this.m11 = M0 * T01; +this.type = -1; +return; +case (37): +case (36): +this.m00 = this.m01 * Tx.m10; +this.m01 = 0.0; +this.m11 = this.m10 * Tx.m01; +this.m10 = 0.0; +this.state = mystate ^ (6); +this.type = -1; +return; +case (35): +case (34): +this.m01 = this.m00 * Tx.m01; +this.m00 = 0.0; +this.m10 = this.m11 * Tx.m10; +this.m11 = 0.0; +this.state = mystate ^ (6); +this.type = -1; +return; +case (33): +this.m00 = 0.0; +this.m01 = Tx.m01; +this.m10 = Tx.m10; +this.m11 = 0.0; +this.state = 5; +this.type = -1; +return; +} +T00 = Tx.m00; +T01 = Tx.m01; +T02 = Tx.m02; +T10 = Tx.m10; +T11 = Tx.m11; +T12 = Tx.m12; +switch (mystate) { +default: +this.stateError (); +case (6): +this.state = mystate | txstate; +case (7): +M0 = this.m00; +M1 = this.m01; +this.m00 = T00 * M0 + T10 * M1; +this.m01 = T01 * M0 + T11 * M1; +this.m02 += T02 * M0 + T12 * M1; +M0 = this.m10; +M1 = this.m11; +this.m10 = T00 * M0 + T10 * M1; +this.m11 = T01 * M0 + T11 * M1; +this.m12 += T02 * M0 + T12 * M1; +this.type = -1; +return; +case (5): +case (4): +M0 = this.m01; +this.m00 = T10 * M0; +this.m01 = T11 * M0; +this.m02 += T12 * M0; +M0 = this.m10; +this.m10 = T00 * M0; +this.m11 = T01 * M0; +this.m12 += T02 * M0; +break; +case (3): +case (2): +M0 = this.m00; +this.m00 = T00 * M0; +this.m01 = T01 * M0; +this.m02 += T02 * M0; +M0 = this.m11; +this.m10 = T10 * M0; +this.m11 = T11 * M0; +this.m12 += T12 * M0; +break; +case (1): +this.m00 = T00; +this.m01 = T01; +this.m02 += T02; +this.m10 = T10; +this.m11 = T11; +this.m12 += T12; +this.state = txstate | 1; +this.type = -1; +return; +} +this.updateState (); +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "preConcatenate", +function (Tx) { +var M0; +var M1; +var T00; +var T01; +var T10; +var T11; +var T02; +var T12; +var mystate = this.state; +var txstate = Tx.state; +switch ((txstate << 3) | mystate) { +case (0): +case (1): +case (2): +case (3): +case (4): +case (5): +case (6): +case (7): +return; +case (8): +case (10): +case (12): +case (14): +this.m02 = Tx.m02; +this.m12 = Tx.m12; +this.state = mystate | 1; +this.type |= 1; +return; +case (9): +case (11): +case (13): +case (15): +this.m02 = this.m02 + Tx.m02; +this.m12 = this.m12 + Tx.m12; +return; +case (17): +case (16): +this.state = mystate | 2; +case (23): +case (22): +case (21): +case (20): +case (19): +case (18): +T00 = Tx.m00; +T11 = Tx.m11; +if ((mystate & 4) != 0) { +this.m01 = this.m01 * T00; +this.m10 = this.m10 * T11; +if ((mystate & 2) != 0) { +this.m00 = this.m00 * T00; +this.m11 = this.m11 * T11; +}} else { +this.m00 = this.m00 * T00; +this.m11 = this.m11 * T11; +}if ((mystate & 1) != 0) { +this.m02 = this.m02 * T00; +this.m12 = this.m12 * T11; +}this.type = -1; +return; +case (37): +case (36): +mystate = mystate | 2; +case (33): +case (32): +case (35): +case (34): +this.state = mystate ^ 4; +case (39): +case (38): +T01 = Tx.m01; +T10 = Tx.m10; +M0 = this.m00; +this.m00 = this.m10 * T01; +this.m10 = M0 * T10; +M0 = this.m01; +this.m01 = this.m11 * T01; +this.m11 = M0 * T10; +M0 = this.m02; +this.m02 = this.m12 * T01; +this.m12 = M0 * T10; +this.type = -1; +return; +} +T00 = Tx.m00; +T01 = Tx.m01; +T02 = Tx.m02; +T10 = Tx.m10; +T11 = Tx.m11; +T12 = Tx.m12; +switch (mystate) { +default: +this.stateError (); +case (7): +M0 = this.m02; +M1 = this.m12; +T02 += M0 * T00 + M1 * T01; +T12 += M0 * T10 + M1 * T11; +case (6): +this.m02 = T02; +this.m12 = T12; +M0 = this.m00; +M1 = this.m10; +this.m00 = M0 * T00 + M1 * T01; +this.m10 = M0 * T10 + M1 * T11; +M0 = this.m01; +M1 = this.m11; +this.m01 = M0 * T00 + M1 * T01; +this.m11 = M0 * T10 + M1 * T11; +break; +case (5): +M0 = this.m02; +M1 = this.m12; +T02 += M0 * T00 + M1 * T01; +T12 += M0 * T10 + M1 * T11; +case (4): +this.m02 = T02; +this.m12 = T12; +M0 = this.m10; +this.m00 = M0 * T01; +this.m10 = M0 * T11; +M0 = this.m01; +this.m01 = M0 * T00; +this.m11 = M0 * T10; +break; +case (3): +M0 = this.m02; +M1 = this.m12; +T02 += M0 * T00 + M1 * T01; +T12 += M0 * T10 + M1 * T11; +case (2): +this.m02 = T02; +this.m12 = T12; +M0 = this.m00; +this.m00 = M0 * T00; +this.m10 = M0 * T10; +M0 = this.m11; +this.m01 = M0 * T01; +this.m11 = M0 * T11; +break; +case (1): +M0 = this.m02; +M1 = this.m12; +T02 += M0 * T00 + M1 * T01; +T12 += M0 * T10 + M1 * T11; +case (0): +this.m02 = T02; +this.m12 = T12; +this.m00 = T00; +this.m10 = T10; +this.m01 = T01; +this.m11 = T11; +this.state = mystate | txstate; +this.type = -1; +return; +} +this.updateState (); +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "createInverse", +function () { +var det; +switch (this.state) { +default: +this.stateError (); +case (7): +det = this.m00 * this.m11 - this.m01 * this.m10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}return new java.awt.geom.AffineTransform (this.m11 / det, -this.m10 / det, -this.m01 / det, this.m00 / det, (this.m01 * this.m12 - this.m11 * this.m02) / det, (this.m10 * this.m02 - this.m00 * this.m12) / det, (7)); +case (6): +det = this.m00 * this.m11 - this.m01 * this.m10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}return new java.awt.geom.AffineTransform (this.m11 / det, -this.m10 / det, -this.m01 / det, this.m00 / det, 0.0, 0.0, (6)); +case (5): +if (this.m01 == 0.0 || this.m10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}return new java.awt.geom.AffineTransform (0.0, 1.0 / this.m01, 1.0 / this.m10, 0.0, -this.m12 / this.m10, -this.m02 / this.m01, (5)); +case (4): +if (this.m01 == 0.0 || this.m10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}return new java.awt.geom.AffineTransform (0.0, 1.0 / this.m01, 1.0 / this.m10, 0.0, 0.0, 0.0, (4)); +case (3): +if (this.m00 == 0.0 || this.m11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}return new java.awt.geom.AffineTransform (1.0 / this.m00, 0.0, 0.0, 1.0 / this.m11, -this.m02 / this.m00, -this.m12 / this.m11, (3)); +case (2): +if (this.m00 == 0.0 || this.m11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}return new java.awt.geom.AffineTransform (1.0 / this.m00, 0.0, 0.0, 1.0 / this.m11, 0.0, 0.0, (2)); +case (1): +return new java.awt.geom.AffineTransform (1.0, 0.0, 0.0, 1.0, -this.m02, -this.m12, (1)); +case (0): +return new java.awt.geom.AffineTransform (); +} +}); +Clazz_defineMethod (c$, "invert", +function () { +var M00; +var M01; +var M02; +var M10; +var M11; +var M12; +var det; +switch (this.state) { +default: +this.stateError (); +case (7): +M00 = this.m00; +M01 = this.m01; +M02 = this.m02; +M10 = this.m10; +M11 = this.m11; +M12 = this.m12; +det = M00 * M11 - M01 * M10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}this.m00 = M11 / det; +this.m10 = -M10 / det; +this.m01 = -M01 / det; +this.m11 = M00 / det; +this.m02 = (M01 * M12 - M11 * M02) / det; +this.m12 = (M10 * M02 - M00 * M12) / det; +break; +case (6): +M00 = this.m00; +M01 = this.m01; +M10 = this.m10; +M11 = this.m11; +det = M00 * M11 - M01 * M10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}this.m00 = M11 / det; +this.m10 = -M10 / det; +this.m01 = -M01 / det; +this.m11 = M00 / det; +break; +case (5): +M01 = this.m01; +M02 = this.m02; +M10 = this.m10; +M12 = this.m12; +if (M01 == 0.0 || M10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}this.m10 = 1.0 / M01; +this.m01 = 1.0 / M10; +this.m02 = -M12 / M10; +this.m12 = -M02 / M01; +break; +case (4): +M01 = this.m01; +M10 = this.m10; +if (M01 == 0.0 || M10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}this.m10 = 1.0 / M01; +this.m01 = 1.0 / M10; +break; +case (3): +M00 = this.m00; +M02 = this.m02; +M11 = this.m11; +M12 = this.m12; +if (M00 == 0.0 || M11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}this.m00 = 1.0 / M00; +this.m11 = 1.0 / M11; +this.m02 = -M02 / M00; +this.m12 = -M12 / M11; +break; +case (2): +M00 = this.m00; +M11 = this.m11; +if (M00 == 0.0 || M11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}this.m00 = 1.0 / M00; +this.m11 = 1.0 / M11; +break; +case (1): +this.m02 = -this.m02; +this.m12 = -this.m12; +break; +case (0): +break; +} +}); +Clazz_defineMethod (c$, "transform", +function (ptSrc, ptDst) { +if (ptDst == null) { +if (Clazz_instanceOf (ptSrc, java.awt.geom.Point2D.Double)) { +ptDst = new java.awt.geom.Point2D.Double (); +} else { +ptDst = new java.awt.geom.Point2D.Float (); +}}var x = ptSrc.getX (); +var y = ptSrc.getY (); +switch (this.state) { +default: +this.stateError (); +case (7): +ptDst.setLocation (x * this.m00 + y * this.m01 + this.m02, x * this.m10 + y * this.m11 + this.m12); +return ptDst; +case (6): +ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11); +return ptDst; +case (5): +ptDst.setLocation (y * this.m01 + this.m02, x * this.m10 + this.m12); +return ptDst; +case (4): +ptDst.setLocation (y * this.m01, x * this.m10); +return ptDst; +case (3): +ptDst.setLocation (x * this.m00 + this.m02, y * this.m11 + this.m12); +return ptDst; +case (2): +ptDst.setLocation (x * this.m00, y * this.m11); +return ptDst; +case (1): +ptDst.setLocation (x + this.m02, y + this.m12); +return ptDst; +case (0): +ptDst.setLocation (x, y); +return ptDst; +} +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "transform", +function (srcPts, srcOff, dstPts, dstOff, numPts) { +if (numPts == 0) return; +if (!JU.AU.isAD (srcPts)) { +var src = srcPts; +var dst = dstPts; +this.transform (src, srcOff, dst, dstOff, numPts); +return; +}var M00; +var M01; +var M02; +var M10; +var M11; +var M12; +if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) { +System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); +srcOff = dstOff; +}switch (this.state) { +default: +this.stateError (); +case (7): +M00 = this.m00; +M01 = this.m01; +M02 = this.m02; +M10 = this.m10; +M11 = this.m11; +M12 = this.m12; +while (--numPts >= 0) { +var x = srcPts[srcOff++]; +var y = srcPts[srcOff++]; +dstPts[dstOff++] = M00 * x + M01 * y + M02; +dstPts[dstOff++] = M10 * x + M11 * y + M12; +} +return; +case (6): +M00 = this.m00; +M01 = this.m01; +M10 = this.m10; +M11 = this.m11; +while (--numPts >= 0) { +var x = srcPts[srcOff++]; +var y = srcPts[srcOff++]; +dstPts[dstOff++] = M00 * x + M01 * y; +dstPts[dstOff++] = M10 * x + M11 * y; +} +return; +case (5): +M01 = this.m01; +M02 = this.m02; +M10 = this.m10; +M12 = this.m12; +while (--numPts >= 0) { +var x = srcPts[srcOff++]; +dstPts[dstOff++] = M01 * srcPts[srcOff++] + M02; +dstPts[dstOff++] = M10 * x + M12; +} +return; +case (4): +M01 = this.m01; +M10 = this.m10; +while (--numPts >= 0) { +var x = srcPts[srcOff++]; +dstPts[dstOff++] = M01 * srcPts[srcOff++]; +dstPts[dstOff++] = M10 * x; +} +return; +case (3): +M00 = this.m00; +M02 = this.m02; +M11 = this.m11; +M12 = this.m12; +while (--numPts >= 0) { +dstPts[dstOff++] = M00 * srcPts[srcOff++] + M02; +dstPts[dstOff++] = M11 * srcPts[srcOff++] + M12; +} +return; +case (2): +M00 = this.m00; +M11 = this.m11; +while (--numPts >= 0) { +dstPts[dstOff++] = M00 * srcPts[srcOff++]; +dstPts[dstOff++] = M11 * srcPts[srcOff++]; +} +return; +case (1): +M02 = this.m02; +M12 = this.m12; +while (--numPts >= 0) { +dstPts[dstOff++] = srcPts[srcOff++] + M02; +dstPts[dstOff++] = srcPts[srcOff++] + M12; +} +return; +case (0): +if (srcPts !== dstPts || srcOff != dstOff) { +System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); +}return; +} +}, "~A,~N,~A,~N,~N"); +Clazz_defineMethod (c$, "inverseTransform", +function (ptSrc, ptDst) { +if (ptDst == null) { +if (Clazz_instanceOf (ptSrc, java.awt.geom.Point2D.Double)) { +ptDst = new java.awt.geom.Point2D.Double (); +} else { +ptDst = new java.awt.geom.Point2D.Float (); +}}var x = ptSrc.getX (); +var y = ptSrc.getY (); +switch (this.state) { +default: +this.stateError (); +case (7): +x -= this.m02; +y -= this.m12; +case (6): +var det = this.m00 * this.m11 - this.m01 * this.m10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}ptDst.setLocation ((x * this.m11 - y * this.m01) / det, (y * this.m00 - x * this.m10) / det); +return ptDst; +case (5): +x -= this.m02; +y -= this.m12; +case (4): +if (this.m01 == 0.0 || this.m10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}ptDst.setLocation (y / this.m10, x / this.m01); +return ptDst; +case (3): +x -= this.m02; +y -= this.m12; +case (2): +if (this.m00 == 0.0 || this.m11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}ptDst.setLocation (x / this.m00, y / this.m11); +return ptDst; +case (1): +ptDst.setLocation (x - this.m02, y - this.m12); +return ptDst; +case (0): +ptDst.setLocation (x, y); +return ptDst; +} +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "inverseTransform", +function (srcPts, srcOff, dstPts, dstOff, numPts) { +var M00; +var M01; +var M02; +var M10; +var M11; +var M12; +var det; +if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) { +System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); +srcOff = dstOff; +}switch (this.state) { +default: +this.stateError (); +case (7): +M00 = this.m00; +M01 = this.m01; +M02 = this.m02; +M10 = this.m10; +M11 = this.m11; +M12 = this.m12; +det = M00 * M11 - M01 * M10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}while (--numPts >= 0) { +var x = srcPts[srcOff++] - M02; +var y = srcPts[srcOff++] - M12; +dstPts[dstOff++] = (x * M11 - y * M01) / det; +dstPts[dstOff++] = (y * M00 - x * M10) / det; +} +return; +case (6): +M00 = this.m00; +M01 = this.m01; +M10 = this.m10; +M11 = this.m11; +det = M00 * M11 - M01 * M10; +if (Math.abs (det) <= 4.9E-324) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is " + det); +}while (--numPts >= 0) { +var x = srcPts[srcOff++]; +var y = srcPts[srcOff++]; +dstPts[dstOff++] = (x * M11 - y * M01) / det; +dstPts[dstOff++] = (y * M00 - x * M10) / det; +} +return; +case (5): +M01 = this.m01; +M02 = this.m02; +M10 = this.m10; +M12 = this.m12; +if (M01 == 0.0 || M10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}while (--numPts >= 0) { +var x = srcPts[srcOff++] - M02; +dstPts[dstOff++] = (srcPts[srcOff++] - M12) / M10; +dstPts[dstOff++] = x / M01; +} +return; +case (4): +M01 = this.m01; +M10 = this.m10; +if (M01 == 0.0 || M10 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}while (--numPts >= 0) { +var x = srcPts[srcOff++]; +dstPts[dstOff++] = srcPts[srcOff++] / M10; +dstPts[dstOff++] = x / M01; +} +return; +case (3): +M00 = this.m00; +M02 = this.m02; +M11 = this.m11; +M12 = this.m12; +if (M00 == 0.0 || M11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}while (--numPts >= 0) { +dstPts[dstOff++] = (srcPts[srcOff++] - M02) / M00; +dstPts[dstOff++] = (srcPts[srcOff++] - M12) / M11; +} +return; +case (2): +M00 = this.m00; +M11 = this.m11; +if (M00 == 0.0 || M11 == 0.0) { +throw new java.awt.geom.NoninvertibleTransformException ("Determinant is 0"); +}while (--numPts >= 0) { +dstPts[dstOff++] = srcPts[srcOff++] / M00; +dstPts[dstOff++] = srcPts[srcOff++] / M11; +} +return; +case (1): +M02 = this.m02; +M12 = this.m12; +while (--numPts >= 0) { +dstPts[dstOff++] = srcPts[srcOff++] - M02; +dstPts[dstOff++] = srcPts[srcOff++] - M12; +} +return; +case (0): +if (srcPts !== dstPts || srcOff != dstOff) { +System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); +}return; +} +}, "~A,~N,~A,~N,~N"); +Clazz_defineMethod (c$, "deltaTransform", +function (ptSrc, ptDst) { +if (ptDst == null) { +if (Clazz_instanceOf (ptSrc, java.awt.geom.Point2D.Double)) { +ptDst = new java.awt.geom.Point2D.Double (); +} else { +ptDst = new java.awt.geom.Point2D.Float (); +}}var x = ptSrc.getX (); +var y = ptSrc.getY (); +switch (this.state) { +default: +this.stateError (); +case (7): +case (6): +ptDst.setLocation (x * this.m00 + y * this.m01, x * this.m10 + y * this.m11); +return ptDst; +case (5): +case (4): +ptDst.setLocation (y * this.m01, x * this.m10); +return ptDst; +case (3): +case (2): +ptDst.setLocation (x * this.m00, y * this.m11); +return ptDst; +case (1): +case (0): +ptDst.setLocation (x, y); +return ptDst; +} +}, "java.awt.geom.Point2D,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "deltaTransform", +function (srcPts, srcOff, dstPts, dstOff, numPts) { +var M00; +var M01; +var M10; +var M11; +if (dstPts === srcPts && dstOff > srcOff && dstOff < srcOff + numPts * 2) { +System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); +srcOff = dstOff; +}switch (this.state) { +default: +this.stateError (); +case (7): +case (6): +M00 = this.m00; +M01 = this.m01; +M10 = this.m10; +M11 = this.m11; +while (--numPts >= 0) { +var x = srcPts[srcOff++]; +var y = srcPts[srcOff++]; +dstPts[dstOff++] = x * M00 + y * M01; +dstPts[dstOff++] = x * M10 + y * M11; +} +return; +case (5): +case (4): +M01 = this.m01; +M10 = this.m10; +while (--numPts >= 0) { +var x = srcPts[srcOff++]; +dstPts[dstOff++] = srcPts[srcOff++] * M01; +dstPts[dstOff++] = x * M10; +} +return; +case (3): +case (2): +M00 = this.m00; +M11 = this.m11; +while (--numPts >= 0) { +dstPts[dstOff++] = srcPts[srcOff++] * M00; +dstPts[dstOff++] = srcPts[srcOff++] * M11; +} +return; +case (1): +case (0): +if (srcPts !== dstPts || srcOff != dstOff) { +System.arraycopy (srcPts, srcOff, dstPts, dstOff, numPts * 2); +}return; +} +}, "~A,~N,~A,~N,~N"); +Clazz_defineMethod (c$, "createTransformedShape", +function (pSrc) { +if (pSrc == null) { +return null; +}return new java.awt.geom.Path2D.Double (pSrc, this); +}, "java.awt.Shape"); +c$._matround = Clazz_defineMethod (c$, "_matround", + function (matval) { +return Math.rint (matval * 1E15) / 1E15; +}, "~N"); +Clazz_overrideMethod (c$, "toString", +function () { +return ("AffineTransform[[" + java.awt.geom.AffineTransform._matround (this.m00) + ", " + java.awt.geom.AffineTransform._matround (this.m01) + ", " + java.awt.geom.AffineTransform._matround (this.m02) + "], [" + java.awt.geom.AffineTransform._matround (this.m10) + ", " + java.awt.geom.AffineTransform._matround (this.m11) + ", " + java.awt.geom.AffineTransform._matround (this.m12) + "]]"); +}); +Clazz_defineMethod (c$, "isIdentity", +function () { +return (this.state == 0 || (this.getType () == 0)); +}); +Clazz_defineMethod (c$, "clone", +function () { +try { +return Clazz_superCall (this, java.awt.geom.AffineTransform, "clone", []); +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +throw new InternalError (); +} else { +throw e; +} +} +}); +Clazz_overrideMethod (c$, "hashCode", +function () { +var bits = Double.doubleToLongBits (this.m00); +bits = bits * 31 + Double.doubleToLongBits (this.m01); +bits = bits * 31 + Double.doubleToLongBits (this.m02); +bits = bits * 31 + Double.doubleToLongBits (this.m10); +bits = bits * 31 + Double.doubleToLongBits (this.m11); +bits = bits * 31 + Double.doubleToLongBits (this.m12); +return ((bits) ^ ((bits >> 32))); +}); +Clazz_overrideMethod (c$, "equals", +function (obj) { +if (!(Clazz_instanceOf (obj, java.awt.geom.AffineTransform))) { +return false; +}var a = obj; +return ((this.m00 == a.m00) && (this.m01 == a.m01) && (this.m02 == a.m02) && (this.m10 == a.m10) && (this.m11 == a.m11) && (this.m12 == a.m12)); +}, "~O"); +Clazz_defineStatics (c$, +"TYPE_UNKNOWN", -1, +"TYPE_IDENTITY", 0, +"TYPE_TRANSLATION", 1, +"TYPE_UNIFORM_SCALE", 2, +"TYPE_GENERAL_SCALE", 4, +"TYPE_MASK_SCALE", (6), +"TYPE_FLIP", 64, +"TYPE_QUADRANT_ROTATION", 8, +"TYPE_GENERAL_ROTATION", 16, +"TYPE_MASK_ROTATION", (24), +"TYPE_GENERAL_TRANSFORM", 32, +"APPLY_IDENTITY", 0, +"APPLY_TRANSLATE", 1, +"APPLY_SCALE", 2, +"APPLY_SHEAR", 4, +"HI_SHIFT", 3, +"HI_IDENTITY", 0, +"HI_TRANSLATE", 8, +"HI_SCALE", 16, +"HI_SHEAR", 32, +"rot90conversion", Clazz_newIntArray (-1, [4, 5, 4, 5, 2, 3, 6, 7])); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.lang.Exception"], "java.awt.geom.NoninvertibleTransformException", null, function () { +c$ = Clazz_declareType (java.awt.geom, "NoninvertibleTransformException", Exception); +}); +Clazz_declarePackage ("java.awt.geom"); +Clazz_load (["java.awt.Shape", "java.awt.geom.PathIterator"], "java.awt.geom.Path2D", ["java.lang.Double", "$.IllegalArgumentException", "java.util.Arrays", "java.awt.geom.FlatteningPathIterator", "$.IllegalPathStateException", "$.Point2D", "$.Rectangle2D", "jssun.awt.geom.Curve"], function () { +c$ = Clazz_decorateAsClass (function () { +this.pointTypes = null; +this.numTypes = 0; +this.numCoords = 0; +this.windingRule = 0; +Clazz_instantialize (this, arguments); +}, java.awt.geom, "Path2D", null, [java.awt.Shape, Cloneable]); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_makeConstructor (c$, +function (rule, initialTypes) { +this.setWindingRule (rule); +this.pointTypes = Clazz_newByteArray (initialTypes, 0); +}, "~N,~N"); +Clazz_defineMethod (c$, "closePath", +function () { +if (this.numTypes == 0 || this.pointTypes[this.numTypes - 1] != 4) { +this.needRoom (true, 0); +this.pointTypes[this.numTypes++] = 4; +}}); +Clazz_defineMethod (c$, "append", +function (s, connect) { +this.append (s.getPathIterator (null), connect); +}, "java.awt.Shape,~B"); +Clazz_defineMethod (c$, "getWindingRule", +function () { +return this.windingRule; +}); +Clazz_defineMethod (c$, "setWindingRule", +function (rule) { +if (rule != 0 && rule != 1) { +throw new IllegalArgumentException ("winding rule must be WIND_EVEN_ODD or WIND_NON_ZERO"); +}this.windingRule = rule; +}, "~N"); +Clazz_defineMethod (c$, "getCurrentPoint", +function () { +var index = this.numCoords; +if (this.numTypes < 1 || index < 1) { +return null; +}if (this.pointTypes[this.numTypes - 1] == 4) { +loop : for (var i = this.numTypes - 2; i > 0; i--) { +switch (this.pointTypes[i]) { +case 0: +break loop; +case 1: +index -= 2; +break; +case 2: +index -= 4; +break; +case 3: +index -= 6; +break; +case 4: +break; +} +} +}return this.getPoint (index - 2); +}); +Clazz_defineMethod (c$, "reset", +function () { +this.numTypes = this.numCoords = 0; +}); +Clazz_defineMethod (c$, "createTransformedShape", +function (at) { +var p2d = this.clone (); +if (at != null) { +p2d.transform (at); +}return p2d; +}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getBounds", +function () { +return this.getBounds2D ().getBounds (); +}); +c$.contains = Clazz_defineMethod (c$, "contains", +function (pi, x, y) { +if (x * 0.0 + y * 0.0 == 0.0) { +var mask = (pi.getWindingRule () == 1 ? -1 : 1); +var cross = jssun.awt.geom.Curve.pointCrossingsForPath (pi, x, y); +return ((cross & mask) != 0); +} else { +return false; +}}, "java.awt.geom.PathIterator,~N,~N"); +c$.contains = Clazz_defineMethod (c$, "contains", +function (pi, p) { +return java.awt.geom.Path2D.contains (pi, p.getX (), p.getY ()); +}, "java.awt.geom.PathIterator,java.awt.geom.Point2D"); +Clazz_defineMethod (c$, "contains", +function (x, y) { +if (x * 0.0 + y * 0.0 == 0.0) { +if (this.numTypes < 2) { +return false; +}var mask = (this.windingRule == 1 ? -1 : 1); +return ((this.pointCrossings (x, y) & mask) != 0); +} else { +return false; +}}, "~N,~N"); +Clazz_defineMethod (c$, "contains", +function (p) { +return this.contains (p.getX (), p.getY ()); +}, "java.awt.geom.Point2D"); +c$.contains = Clazz_defineMethod (c$, "contains", +function (pi, x, y, w, h) { +if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { +return false; +}if (w <= 0 || h <= 0) { +return false; +}var mask = (pi.getWindingRule () == 1 ? -1 : 2); +var crossings = jssun.awt.geom.Curve.rectCrossingsForPath (pi, x, y, x + w, y + h); +return (crossings != -2147483648 && (crossings & mask) != 0); +}, "java.awt.geom.PathIterator,~N,~N,~N,~N"); +c$.contains = Clazz_defineMethod (c$, "contains", +function (pi, r) { +return java.awt.geom.Path2D.contains (pi, r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.PathIterator,java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "contains", +function (x, y, w, h) { +if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { +return false; +}if (w <= 0 || h <= 0) { +return false; +}var mask = (this.windingRule == 1 ? -1 : 2); +var crossings = this.rectCrossings (x, y, x + w, y + h); +return (crossings != -2147483648 && (crossings & mask) != 0); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "contains", +function (r) { +return this.contains (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +c$.intersects = Clazz_defineMethod (c$, "intersects", +function (pi, x, y, w, h) { +if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { +return false; +}if (w <= 0 || h <= 0) { +return false; +}var mask = (pi.getWindingRule () == 1 ? -1 : 2); +var crossings = jssun.awt.geom.Curve.rectCrossingsForPath (pi, x, y, x + w, y + h); +return (crossings == -2147483648 || (crossings & mask) != 0); +}, "java.awt.geom.PathIterator,~N,~N,~N,~N"); +c$.intersects = Clazz_defineMethod (c$, "intersects", +function (pi, r) { +return java.awt.geom.Path2D.intersects (pi, r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.PathIterator,java.awt.geom.Rectangle2D"); +Clazz_defineMethod (c$, "intersects", +function (x, y, w, h) { +if (java.lang.Double.isNaN (x + w) || java.lang.Double.isNaN (y + h)) { +return false; +}if (w <= 0 || h <= 0) { +return false; +}var mask = (this.windingRule == 1 ? -1 : 2); +var crossings = this.rectCrossings (x, y, x + w, y + h); +return (crossings == -2147483648 || (crossings & mask) != 0); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "intersects", +function (r) { +return this.intersects (r.getX (), r.getY (), r.getWidth (), r.getHeight ()); +}, "java.awt.geom.Rectangle2D"); +Clazz_overrideMethod (c$, "getPathIterator", +function (at, flatness) { +return new java.awt.geom.FlatteningPathIterator (this.getPathIterator (at), flatness); +}, "java.awt.geom.AffineTransform,~N"); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.typeIdx = 0; +this.pointIdx = 0; +this.path = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D, "Iterator", null, java.awt.geom.PathIterator); +Clazz_makeConstructor (c$, +function (a) { +this.path = a; +}, "java.awt.geom.Path2D"); +Clazz_overrideMethod (c$, "getWindingRule", +function () { +return this.path.getWindingRule (); +}); +Clazz_overrideMethod (c$, "isDone", +function () { +return (this.typeIdx >= this.path.numTypes); +}); +Clazz_overrideMethod (c$, "next", +function () { +var a = this.path.pointTypes[this.typeIdx++]; +this.pointIdx += java.awt.geom.Path2D.Iterator.curvecoords[a]; +}); +Clazz_defineStatics (c$, +"curvecoords", Clazz_newIntArray (-1, [2, 2, 4, 6, 0])); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.floatCoords = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D, "Float", java.awt.geom.Path2D); +Clazz_makeConstructor (c$, +function () { +this.construct (1, 20); +}); +Clazz_makeConstructor (c$, +function (a) { +this.construct (a, 20); +}, "~N"); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Float, []); +this.setWindingRule (a); +this.pointTypes = Clazz_newByteArray (b, 0); +this.floatCoords = Clazz_newFloatArray (b * 2, 0); +}, "~N,~N"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (a, null); +}, "java.awt.Shape"); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Float, []); +this.setPath (a, b); +}, "java.awt.Shape,java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "setPath", + function (a, b) { +if (Clazz_instanceOf (a, java.awt.geom.Path2D)) { +var c = a; +this.setWindingRule (c.windingRule); +this.numTypes = c.numTypes; +this.pointTypes = java.util.Arrays.copyOf (c.pointTypes, c.pointTypes.length); +this.numCoords = c.numCoords; +this.floatCoords = c.cloneCoordsFloat (b); +} else { +var c = a.getPathIterator (b); +this.setWindingRule (c.getWindingRule ()); +this.pointTypes = Clazz_newByteArray (20, 0); +this.floatCoords = Clazz_newFloatArray (40, 0); +this.append (c, false); +}}, "java.awt.Shape,java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "cloneCoordsFloat", +function (a) { +var b; +if (a == null) { +b = java.util.Arrays.copyOf (this.floatCoords, this.floatCoords.length); +} else { +b = Clazz_newFloatArray (this.floatCoords.length, 0); +a.transform (this.floatCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); +}return b; +}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "cloneCoordsDouble", +function (a) { +var b = Clazz_newDoubleArray (this.floatCoords.length, 0); +if (a == null) { +for (var c = 0; c < this.numCoords; c++) { +b[c] = this.floatCoords[c]; +} +} else { +a.transform (this.floatCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); +}return b; +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "append", +function (a, b) { +{ +if (typeof pi == "number") { +this.floatCoords[this.numCoords++] = pi; +this.floatCoords[this.numCoords++] = connect; +return; +} +}var c = Clazz_newFloatArray (6, 0); +while (!a.isDone ()) { +switch (a.currentSegment (c)) { +case 0: +if (!b || this.numTypes < 1 || this.numCoords < 1) { +this.moveTo (c[0], c[1]); +break; +}if (this.pointTypes[this.numTypes - 1] != 4 && this.floatCoords[this.numCoords - 2] == c[0] && this.floatCoords[this.numCoords - 1] == c[1]) { +break; +}case 1: +this.lineTo (c[0], c[1]); +break; +case 2: +this.quadTo (c[0], c[1], c[2], c[3]); +break; +case 3: +this.curveTo (c[0], c[1], c[2], c[3], c[4], c[5]); +break; +case 4: +this.closePath (); +break; +} +a.next (); +b = false; +} +}, "java.awt.geom.PathIterator,~B"); +Clazz_overrideMethod (c$, "getPoint", +function (a) { +return new java.awt.geom.Point2D.Float (this.floatCoords[a], this.floatCoords[a + 1]); +}, "~N"); +Clazz_overrideMethod (c$, "needRoom", +function (a, b) { +if (a && this.numTypes == 0) { +throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); +}var c = this.pointTypes.length; +if (this.numTypes >= c) { +var d = c; +if (d > 500) { +d = 500; +}this.pointTypes = java.util.Arrays.copyOf (this.pointTypes, c + d); +}c = this.floatCoords.length; +if (this.numCoords + b > c) { +var d = c; +if (d > 1000) { +d = 1000; +}if (d < b) { +d = b; +}this.floatCoords = java.util.Arrays.copyOf (this.floatCoords, c + d); +}}, "~B,~N"); +Clazz_defineMethod (c$, "moveTo", +function (a, b) { +if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) { +this.floatCoords[this.numCoords - 2] = a; +this.floatCoords[this.numCoords - 1] = b; +} else { +this.needRoom (false, 2); +this.pointTypes[this.numTypes++] = 0; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +}}, "~N,~N"); +Clazz_defineMethod (c$, "moveTo", +function (a, b) { +if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) { +this.floatCoords[this.numCoords - 2] = a; +this.floatCoords[this.numCoords - 1] = b; +} else { +this.needRoom (false, 2); +this.pointTypes[this.numTypes++] = 0; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +}}, "~N,~N"); +Clazz_defineMethod (c$, "lineTo", +function (a, b) { +this.needRoom (true, 2); +this.pointTypes[this.numTypes++] = 1; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +}, "~N,~N"); +Clazz_defineMethod (c$, "lineTo", +function (a, b) { +this.needRoom (true, 2); +this.pointTypes[this.numTypes++] = 1; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +}, "~N,~N"); +Clazz_defineMethod (c$, "quadTo", +function (a, b, c, d) { +this.needRoom (true, 4); +this.pointTypes[this.numTypes++] = 2; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +this.floatCoords[this.numCoords++] = c; +this.floatCoords[this.numCoords++] = d; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "quadTo", +function (a, b, c, d) { +this.needRoom (true, 4); +this.pointTypes[this.numTypes++] = 2; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +this.floatCoords[this.numCoords++] = c; +this.floatCoords[this.numCoords++] = d; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "curveTo", +function (a, b, c, d, e, f) { +this.needRoom (true, 6); +this.pointTypes[this.numTypes++] = 3; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +this.floatCoords[this.numCoords++] = c; +this.floatCoords[this.numCoords++] = d; +this.floatCoords[this.numCoords++] = e; +this.floatCoords[this.numCoords++] = f; +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "curveTo", +function (a, b, c, d, e, f) { +this.needRoom (true, 6); +this.pointTypes[this.numTypes++] = 3; +this.floatCoords[this.numCoords++] = a; +this.floatCoords[this.numCoords++] = b; +this.floatCoords[this.numCoords++] = c; +this.floatCoords[this.numCoords++] = d; +this.floatCoords[this.numCoords++] = e; +this.floatCoords[this.numCoords++] = f; +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "pointCrossings", +function (a, b) { +var c; +var d; +var e; +var f; +var g; +var h; +var i = this.floatCoords; +e = c = i[0]; +f = d = i[1]; +var j = 0; +var k = 2; +for (var l = 1; l < this.numTypes; l++) { +switch (this.pointTypes[l]) { +case 0: +if (f != d) { +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); +}c = e = i[k++]; +d = f = i[k++]; +break; +case 1: +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, g = i[k++], h = i[k++]); +e = g; +f = h; +break; +case 2: +j += jssun.awt.geom.Curve.pointCrossingsForQuad (a, b, e, f, i[k++], i[k++], g = i[k++], h = i[k++], 0); +e = g; +f = h; +break; +case 3: +j += jssun.awt.geom.Curve.pointCrossingsForCubic (a, b, e, f, i[k++], i[k++], i[k++], i[k++], g = i[k++], h = i[k++], 0); +e = g; +f = h; +break; +case 4: +if (f != d) { +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); +}e = c; +f = d; +break; +} +} +if (f != d) { +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); +}return j; +}, "~N,~N"); +Clazz_overrideMethod (c$, "rectCrossings", +function (a, b, c, d) { +var e = this.floatCoords; +var f; +var g; +var h; +var i; +var j; +var k; +f = h = e[0]; +g = i = e[1]; +var l = 0; +var m = 2; +for (var n = 1; l != -2147483648 && n < this.numTypes; n++) { +switch (this.pointTypes[n]) { +case 0: +if (f != h || g != i) { +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); +}h = f = e[m++]; +i = g = e[m++]; +break; +case 1: +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, j = e[m++], k = e[m++]); +f = j; +g = k; +break; +case 2: +l = jssun.awt.geom.Curve.rectCrossingsForQuad (l, a, b, c, d, f, g, e[m++], e[m++], j = e[m++], k = e[m++], 0); +f = j; +g = k; +break; +case 3: +l = jssun.awt.geom.Curve.rectCrossingsForCubic (l, a, b, c, d, f, g, e[m++], e[m++], e[m++], e[m++], j = e[m++], k = e[m++], 0); +f = j; +g = k; +break; +case 4: +if (f != h || g != i) { +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); +}f = h; +g = i; +break; +} +} +if (l != -2147483648 && (f != h || g != i)) { +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); +}return l; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "transform", +function (a) { +a.transform (this.floatCoords, 0, this.floatCoords, 0, Clazz_doubleToInt (this.numCoords / 2)); +}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a; +var b; +var c; +var d; +var e = this.numCoords; +if (e > 0) { +b = d = this.floatCoords[--e]; +a = c = this.floatCoords[--e]; +while (e > 0) { +var f = this.floatCoords[--e]; +var g = this.floatCoords[--e]; +if (g < a) a = g; +if (f < b) b = f; +if (g > c) c = g; +if (f > d) d = f; +} +} else { +a = b = c = d = 0.0; +}return new java.awt.geom.Rectangle2D.Float (a, b, c - a, d - b); +}); +Clazz_defineMethod (c$, "getPathIterator", +function (a) { +if (a == null) { +return new java.awt.geom.Path2D.Float.CopyIterator (this); +} else { +return new java.awt.geom.Path2D.Float.TxIterator (this, a); +}}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "clone", +function () { +return new java.awt.geom.Path2D.Float (this); +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.floatCoords = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D.Float, "CopyIterator", java.awt.geom.Path2D.Iterator); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Float.CopyIterator, [a]); +this.floatCoords = a.floatCoords; +}, "java.awt.geom.Path2D.Float"); +Clazz_defineMethod (c$, "currentSegment", +function (a) { +var b = this.path.pointTypes[this.typeIdx]; +var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; +if (c > 0) { +for (var d = 0; d < c; d++) { +a[d] = this.floatCoords[this.pointIdx + d]; +} +}return b; +}, "~A"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.floatCoords = null; +this.affine = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D.Float, "TxIterator", java.awt.geom.Path2D.Iterator); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Float.TxIterator, [a]); +this.floatCoords = a.floatCoords; +this.affine = b; +}, "java.awt.geom.Path2D.Float,java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "currentSegment", +function (a) { +var b = this.path.pointTypes[this.typeIdx]; +var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; +if (c > 0) { +this.affine.transform (this.floatCoords, this.pointIdx, a, 0, Clazz_doubleToInt (c / 2)); +}return b; +}, "~A"); +c$ = Clazz_p0p (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.doubleCoords = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D, "Double", java.awt.geom.Path2D); +Clazz_makeConstructor (c$, +function () { +this.construct (1, 20); +}); +Clazz_makeConstructor (c$, +function (a) { +this.construct (a, 20); +}, "~N"); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Double, [a, b]); +this.doubleCoords = Clazz_newDoubleArray (b * 2, 0); +}, "~N,~N"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (a, null); +}, "java.awt.Shape"); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Double, []); +if (Clazz_instanceOf (a, java.awt.geom.Path2D)) { +var c = a; +this.setWindingRule (c.windingRule); +this.numTypes = c.numTypes; +this.pointTypes = java.util.Arrays.copyOf (c.pointTypes, c.pointTypes.length); +this.numCoords = c.numCoords; +this.doubleCoords = c.cloneCoordsDouble (b); +} else { +var c = a.getPathIterator (b); +this.setWindingRule (c.getWindingRule ()); +this.pointTypes = Clazz_newByteArray (20, 0); +this.doubleCoords = Clazz_newDoubleArray (40, 0); +this.append (c, false); +}}, "java.awt.Shape,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "cloneCoordsFloat", +function (a) { +var b = Clazz_newFloatArray (this.doubleCoords.length, 0); +if (a == null) { +for (var c = 0; c < this.numCoords; c++) { +b[c] = this.doubleCoords[c]; +} +} else { +a.transform (this.doubleCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); +}return b; +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "cloneCoordsDouble", +function (a) { +var b; +if (a == null) { +b = java.util.Arrays.copyOf (this.doubleCoords, this.doubleCoords.length); +} else { +b = Clazz_newDoubleArray (this.doubleCoords.length, 0); +a.transform (this.doubleCoords, 0, b, 0, Clazz_doubleToInt (this.numCoords / 2)); +}return b; +}, "java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "append", +function (a, b) { +{ +if (typeof pi == "number") { +this.floatCoords[this.numCoords++] = pi; +this.floatCoords[this.numCoords++] = connect; +return; +} +}var c = Clazz_newDoubleArray (6, 0); +while (!a.isDone ()) { +switch (a.currentSegment (c)) { +case 0: +if (!b || this.numTypes < 1 || this.numCoords < 1) { +this.moveTo (c[0], c[1]); +break; +}if (this.pointTypes[this.numTypes - 1] != 4 && this.doubleCoords[this.numCoords - 2] == c[0] && this.doubleCoords[this.numCoords - 1] == c[1]) { +break; +}case 1: +this.lineTo (c[0], c[1]); +break; +case 2: +this.quadTo (c[0], c[1], c[2], c[3]); +break; +case 3: +this.curveTo (c[0], c[1], c[2], c[3], c[4], c[5]); +break; +case 4: +this.closePath (); +break; +} +a.next (); +b = false; +} +}, "java.awt.geom.PathIterator,~B"); +Clazz_overrideMethod (c$, "getPoint", +function (a) { +return new java.awt.geom.Point2D.Double (this.doubleCoords[a], this.doubleCoords[a + 1]); +}, "~N"); +Clazz_overrideMethod (c$, "needRoom", +function (a, b) { +if (a && this.numTypes == 0) { +throw new java.awt.geom.IllegalPathStateException ("missing initial moveto in path definition"); +}var c = this.pointTypes.length; +if (this.numTypes >= c) { +var d = c; +if (d > 500) { +d = 500; +}this.pointTypes = java.util.Arrays.copyOf (this.pointTypes, c + d); +}c = this.doubleCoords.length; +if (this.numCoords + b > c) { +var d = c; +if (d > 1000) { +d = 1000; +}if (d < b) { +d = b; +}this.doubleCoords = java.util.Arrays.copyOf (this.doubleCoords, c + d); +}}, "~B,~N"); +Clazz_overrideMethod (c$, "moveTo", +function (a, b) { +if (this.numTypes > 0 && this.pointTypes[this.numTypes - 1] == 0) { +this.doubleCoords[this.numCoords - 2] = a; +this.doubleCoords[this.numCoords - 1] = b; +} else { +this.needRoom (false, 2); +this.pointTypes[this.numTypes++] = 0; +this.doubleCoords[this.numCoords++] = a; +this.doubleCoords[this.numCoords++] = b; +}}, "~N,~N"); +Clazz_overrideMethod (c$, "lineTo", +function (a, b) { +this.needRoom (true, 2); +this.pointTypes[this.numTypes++] = 1; +this.doubleCoords[this.numCoords++] = a; +this.doubleCoords[this.numCoords++] = b; +}, "~N,~N"); +Clazz_overrideMethod (c$, "quadTo", +function (a, b, c, d) { +this.needRoom (true, 4); +this.pointTypes[this.numTypes++] = 2; +this.doubleCoords[this.numCoords++] = a; +this.doubleCoords[this.numCoords++] = b; +this.doubleCoords[this.numCoords++] = c; +this.doubleCoords[this.numCoords++] = d; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "curveTo", +function (a, b, c, d, e, f) { +this.needRoom (true, 6); +this.pointTypes[this.numTypes++] = 3; +this.doubleCoords[this.numCoords++] = a; +this.doubleCoords[this.numCoords++] = b; +this.doubleCoords[this.numCoords++] = c; +this.doubleCoords[this.numCoords++] = d; +this.doubleCoords[this.numCoords++] = e; +this.doubleCoords[this.numCoords++] = f; +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "pointCrossings", +function (a, b) { +var c; +var d; +var e; +var f; +var g; +var h; +var i = this.doubleCoords; +e = c = i[0]; +f = d = i[1]; +var j = 0; +var k = 2; +for (var l = 1; l < this.numTypes; l++) { +switch (this.pointTypes[l]) { +case 0: +if (f != d) { +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); +}c = e = i[k++]; +d = f = i[k++]; +break; +case 1: +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, g = i[k++], h = i[k++]); +e = g; +f = h; +break; +case 2: +j += jssun.awt.geom.Curve.pointCrossingsForQuad (a, b, e, f, i[k++], i[k++], g = i[k++], h = i[k++], 0); +e = g; +f = h; +break; +case 3: +j += jssun.awt.geom.Curve.pointCrossingsForCubic (a, b, e, f, i[k++], i[k++], i[k++], i[k++], g = i[k++], h = i[k++], 0); +e = g; +f = h; +break; +case 4: +if (f != d) { +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); +}e = c; +f = d; +break; +} +} +if (f != d) { +j += jssun.awt.geom.Curve.pointCrossingsForLine (a, b, e, f, c, d); +}return j; +}, "~N,~N"); +Clazz_overrideMethod (c$, "rectCrossings", +function (a, b, c, d) { +var e = this.doubleCoords; +var f; +var g; +var h; +var i; +var j; +var k; +f = h = e[0]; +g = i = e[1]; +var l = 0; +var m = 2; +for (var n = 1; l != -2147483648 && n < this.numTypes; n++) { +switch (this.pointTypes[n]) { +case 0: +if (f != h || g != i) { +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); +}h = f = e[m++]; +i = g = e[m++]; +break; +case 1: +j = e[m++]; +k = e[m++]; +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, j, k); +f = j; +g = k; +break; +case 2: +l = jssun.awt.geom.Curve.rectCrossingsForQuad (l, a, b, c, d, f, g, e[m++], e[m++], j = e[m++], k = e[m++], 0); +f = j; +g = k; +break; +case 3: +l = jssun.awt.geom.Curve.rectCrossingsForCubic (l, a, b, c, d, f, g, e[m++], e[m++], e[m++], e[m++], j = e[m++], k = e[m++], 0); +f = j; +g = k; +break; +case 4: +if (f != h || g != i) { +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); +}f = h; +g = i; +break; +} +} +if (l != -2147483648 && (f != h || g != i)) { +l = jssun.awt.geom.Curve.rectCrossingsForLine (l, a, b, c, d, f, g, h, i); +}return l; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "transform", +function (a) { +a.transform (this.doubleCoords, 0, this.doubleCoords, 0, Clazz_doubleToInt (this.numCoords / 2)); +}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getBounds2D", +function () { +var a; +var b; +var c; +var d; +var e = this.numCoords; +if (e > 0) { +b = d = this.doubleCoords[--e]; +a = c = this.doubleCoords[--e]; +while (e > 0) { +var f = this.doubleCoords[--e]; +var g = this.doubleCoords[--e]; +if (g < a) a = g; +if (f < b) b = f; +if (g > c) c = g; +if (f > d) d = f; +} +} else { +a = b = c = d = 0.0; +}return new java.awt.geom.Rectangle2D.Double (a, b, c - a, d - b); +}); +Clazz_defineMethod (c$, "getPathIterator", +function (a) { +if (a == null) { +return new java.awt.geom.Path2D.Double.CopyIterator (this); +} else { +return new java.awt.geom.Path2D.Double.TxIterator (this, a); +}}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "clone", +function () { +return new java.awt.geom.Path2D.Double (this); +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.doubleCoords = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D.Double, "CopyIterator", java.awt.geom.Path2D.Iterator); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Double.CopyIterator, [a]); +this.doubleCoords = a.doubleCoords; +}, "java.awt.geom.Path2D.Double"); +Clazz_defineMethod (c$, "currentSegment", +function (a) { +var b = this.path.pointTypes[this.typeIdx]; +var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; +if (c > 0) { +for (var d = 0; d < c; d++) { +a[d] = this.doubleCoords[this.pointIdx + d]; +} +}return b; +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (a) { +var b = this.path.pointTypes[this.typeIdx]; +var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; +if (c > 0) { +System.arraycopy (this.doubleCoords, this.pointIdx, a, 0, c); +}return b; +}, "~A"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.doubleCoords = null; +this.affine = null; +Clazz_instantialize (this, arguments); +}, java.awt.geom.Path2D.Double, "TxIterator", java.awt.geom.Path2D.Iterator); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, java.awt.geom.Path2D.Double.TxIterator, [a]); +this.doubleCoords = a.doubleCoords; +this.affine = b; +}, "java.awt.geom.Path2D.Double,java.awt.geom.AffineTransform"); +Clazz_defineMethod (c$, "currentSegment", +function (a) { +var b = this.path.pointTypes[this.typeIdx]; +var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; +if (c > 0) { +this.affine.transform (this.doubleCoords, this.pointIdx, a, 0, Clazz_doubleToInt (c / 2)); +}return b; +}, "~A"); +Clazz_defineMethod (c$, "currentSegment", +function (a) { +var b = this.path.pointTypes[this.typeIdx]; +var c = java.awt.geom.Path2D.Iterator.curvecoords[b]; +if (c > 0) { +this.affine.transform (this.doubleCoords, this.pointIdx, a, 0, Clazz_doubleToInt (c / 2)); +}return b; +}, "~A"); +c$ = Clazz_p0p (); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"WIND_EVEN_ODD", 0, +"WIND_NON_ZERO", 1, +"SEG_MOVETO", 0, +"SEG_LINETO", 1, +"SEG_QUADTO", 2, +"SEG_CUBICTO", 3, +"SEG_CLOSE", 4, +"INIT_SIZE", 20, +"EXPAND_MAX", 500); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "Icon"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JTextField"], "javax.swing.JPasswordField", ["javax.swing.text.Segment"], function () { +c$ = Clazz_decorateAsClass (function () { +this.echoChar = '\0'; +this.echoCharSet = false; +Clazz_instantialize (this, arguments); +}, javax.swing, "JPasswordField", javax.swing.JTextField); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, 0); +}); +Clazz_makeConstructor (c$, +function (text) { +this.construct (null, text, 0); +}, "~S"); +Clazz_makeConstructor (c$, +function (columns) { +this.construct (null, null, columns); +}, "~N"); +Clazz_makeConstructor (c$, +function (text, columns) { +this.construct (null, text, columns); +}, "~S,~N"); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "PasswordFieldUI"; +}); +Clazz_defineMethod (c$, "updateUI", +function () { +if (!this.echoCharSet) { +this.echoChar = '*'; +}Clazz_superCall (this, javax.swing.JPasswordField, "updateUI", []); +}); +Clazz_defineMethod (c$, "getEchoChar", +function () { +return this.echoChar; +}); +Clazz_defineMethod (c$, "setEchoChar", +function (c) { +this.echoChar = c; +this.echoCharSet = true; +this.repaint (); +this.revalidate (); +}, "~S"); +Clazz_defineMethod (c$, "echoCharIsSet", +function () { +return this.echoChar.charCodeAt (0) != 0; +}); +Clazz_overrideMethod (c$, "cut", +function () { +}); +Clazz_overrideMethod (c$, "copy", +function () { +}); +Clazz_defineMethod (c$, "getPassword", +function () { +var doc = this.getDocument (); +var txt = new javax.swing.text.Segment (); +try { +doc.getText (0, doc.getLength (), txt); +} catch (e) { +if (Clazz_exceptionOf (e, javax.swing.text.BadLocationException)) { +return null; +} else { +throw e; +} +} +var retValue = Clazz_newCharArray (txt.count, '\0'); +System.arraycopy (txt.array, txt.offset, retValue, 0, txt.count); +return retValue; +}); +Clazz_defineMethod (c$, "paramString", +function () { +return Clazz_superCall (this, javax.swing.JPasswordField, "paramString", []) + ",echoChar=" + this.echoChar; +}); +Clazz_defineMethod (c$, "customSetUIProperty", +function (propertyName, value) { +if (propertyName === "echoChar") { +if (!this.echoCharSet) { +this.setEchoChar ((value).charValue ()); +this.echoCharSet = false; +}return true; +}return false; +}, "~S,~O"); +Clazz_defineStatics (c$, +"$$uiClassID", "PasswordFieldUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.ActionPropertyChangeListener", "$.SwingConstants", "javax.swing.event.ChangeListener", "javax.swing.text.JTextComponent", "$.TextAction"], "javax.swing.JTextField", ["java.lang.Boolean", "$.IllegalArgumentException", "java.awt.EventQueue", "java.awt.event.ActionEvent", "$.ActionListener", "$.InputEvent", "javax.swing.AbstractAction", "$.JViewport", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.$action = null; +this.actionPropertyChangeListener = null; +this.horizontalAlignment = 10; +this.columns = 0; +this.columnWidth = 0; +this.command = null; +if (!Clazz_isClassDefined ("javax.swing.JTextField.ScrollRepainter")) { +javax.swing.JTextField.$JTextField$ScrollRepainter$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "JTextField", javax.swing.text.JTextComponent, javax.swing.SwingConstants); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, 0); +}); +Clazz_makeConstructor (c$, +function (text) { +this.construct (null, text, 0); +}, "~S"); +Clazz_makeConstructor (c$, +function (columns) { +this.construct (null, null, columns); +}, "~N"); +Clazz_makeConstructor (c$, +function (text, columns) { +this.construct (null, text, columns); +}, "~S,~N"); +Clazz_makeConstructor (c$, +function (doc, text, columns) { +Clazz_superConstructor (this, javax.swing.JTextField); +if (columns < 0) { +throw new IllegalArgumentException ("columns less than zero."); +}this.columns = columns; +if (doc == null) { +doc = this.createDefaultModel (); +}this.setDocument (doc); +if (text != null) { +this.setText (text); +}}, "javax.swing.text.Document,~S,~N"); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "TextFieldUI"; +}); +Clazz_defineMethod (c$, "setDocument", +function (doc) { +if (doc != null) { +doc.putProperty ("filterNewlines", Boolean.TRUE); +}Clazz_superCall (this, javax.swing.JTextField, "setDocument", [doc]); +}, "javax.swing.text.Document"); +Clazz_overrideMethod (c$, "isValidateRoot", +function () { +var parent = this.getParent (); +if (Clazz_instanceOf (parent, javax.swing.JViewport)) { +return false; +}return true; +}); +Clazz_defineMethod (c$, "getHorizontalAlignment", +function () { +return this.horizontalAlignment; +}); +Clazz_defineMethod (c$, "setHorizontalAlignment", +function (alignment) { +if (alignment == this.horizontalAlignment) return; +var oldValue = this.horizontalAlignment; +if ((alignment == 2) || (alignment == 0) || (alignment == 4) || (alignment == 10) || (alignment == 11)) { +this.horizontalAlignment = alignment; +} else { +throw new IllegalArgumentException ("horizontalAlignment"); +}this.firePropertyChangeInt ("horizontalAlignment", oldValue, this.horizontalAlignment); +this.invalidate (); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "createDefaultModel", +function () { +return swingjs.JSToolkit.getPlainDocument (this); +}); +Clazz_defineMethod (c$, "getColumns", +function () { +return this.columns; +}); +Clazz_defineMethod (c$, "setColumns", +function (columns) { +var oldVal = this.columns; +if (columns < 0) { +throw new IllegalArgumentException ("columns less than zero."); +}if (columns != oldVal) { +this.columns = columns; +this.invalidate (); +}}, "~N"); +Clazz_defineMethod (c$, "getColumnWidth", +function () { +if (this.columnWidth == 0) { +var metrics = this.getFontMetrics (this.getFont ()); +this.columnWidth = metrics.charWidth ('m'); +}return this.columnWidth; +}); +Clazz_overrideMethod (c$, "getPreferredSize", +function () { +return this.getPrefSizeJTF (); +}); +Clazz_defineMethod (c$, "getPrefSizeJTF", +function () { +var size = this.getPrefSizeJComp (); +if (this.columns != 0) { +var insets = this.getInsets (); +size.width = this.columns * this.getColumnWidth () + insets.left + insets.right; +}return size; +}); +Clazz_defineMethod (c$, "setFont", +function (f) { +Clazz_superCall (this, javax.swing.JTextField, "setFont", [f]); +this.columnWidth = 0; +}, "java.awt.Font"); +Clazz_defineMethod (c$, "addActionListener", +function (l) { +this.listenerList.add (java.awt.event.ActionListener, l); +}, "java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "removeActionListener", +function (l) { +if ((l != null) && (this.getAction () === l)) { +this.setAction (null); +} else { +this.listenerList.remove (java.awt.event.ActionListener, l); +}}, "java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "getActionListeners", +function () { +return this.listenerList.getListeners (java.awt.event.ActionListener); +}); +Clazz_defineMethod (c$, "fireActionPerformed", +function () { +var listeners = this.listenerList.getListenerList (); +var modifiers = 0; +var currentEvent = java.awt.EventQueue.getCurrentEvent (); +if (Clazz_instanceOf (currentEvent, java.awt.event.InputEvent)) { +modifiers = (currentEvent).getModifiers (); +} else if (Clazz_instanceOf (currentEvent, java.awt.event.ActionEvent)) { +modifiers = (currentEvent).getModifiers (); +}var e = new java.awt.event.ActionEvent (this, 1001, (this.command != null) ? this.command : this.getText (), java.awt.EventQueue.getMostRecentEventTime (), modifiers); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === java.awt.event.ActionListener) { +(listeners[i + 1]).actionPerformed (e); +}} +}); +Clazz_defineMethod (c$, "setActionCommand", +function (command) { +this.command = command; +}, "~S"); +Clazz_defineMethod (c$, "setAction", +function (a) { +var oldValue = this.getAction (); +if (this.$action == null || !this.$action.equals (a)) { +this.$action = a; +if (oldValue != null) { +this.removeActionListener (oldValue); +oldValue.removePropertyChangeListener (this.actionPropertyChangeListener); +this.actionPropertyChangeListener = null; +}this.configurePropertiesFromAction (this.$action); +if (this.$action != null) { +if (!this.isListener (java.awt.event.ActionListener, this.$action)) { +this.addActionListener (this.$action); +}this.actionPropertyChangeListener = this.createActionPropertyChangeListener (this.$action); +this.$action.addPropertyChangeListener (this.actionPropertyChangeListener); +}this.firePropertyChangeObject ("action", oldValue, this.$action); +}}, "javax.swing.Action"); +Clazz_defineMethod (c$, "isListener", + function (c, a) { +var isListener = false; +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === c && listeners[i + 1] === a) { +isListener = true; +}} +return isListener; +}, "Class,java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "getAction", +function () { +return this.$action; +}); +Clazz_defineMethod (c$, "configurePropertiesFromAction", +function (a) { +javax.swing.AbstractAction.setEnabledFromAction (this, a); +javax.swing.AbstractAction.setToolTipTextFromAction (this, a); +this.setActionCommandFromAction (a); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "actionPropertyChanged", +function (action, propertyName) { +if (propertyName === "ActionCommandKey") { +this.setActionCommandFromAction (action); +} else if (propertyName === "enabled") { +javax.swing.AbstractAction.setEnabledFromAction (this, action); +} else if (propertyName === "ShortDescription") { +javax.swing.AbstractAction.setToolTipTextFromAction (this, action); +}}, "javax.swing.Action,~S"); +Clazz_defineMethod (c$, "setActionCommandFromAction", + function (action) { +this.setActionCommand ((action == null) ? null : action.getValue ("ActionCommandKey")); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createActionPropertyChangeListener", +function (a) { +return new javax.swing.JTextField.TextFieldActionPropertyChangeListener (this, a); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "getActions", +function () { +return javax.swing.text.TextAction.augmentList (Clazz_superCall (this, javax.swing.JTextField, "getActions", []), javax.swing.JTextField.defaultActions); +}); +Clazz_defineMethod (c$, "postActionEvent", +function () { +this.fireActionPerformed (); +}); +Clazz_defineMethod (c$, "hasActionListener", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === java.awt.event.ActionListener) { +return true; +}} +return false; +}); +Clazz_defineMethod (c$, "paramString", +function () { +var horizontalAlignmentString; +if (this.horizontalAlignment == 2) { +horizontalAlignmentString = "LEFT"; +} else if (this.horizontalAlignment == 0) { +horizontalAlignmentString = "CENTER"; +} else if (this.horizontalAlignment == 4) { +horizontalAlignmentString = "RIGHT"; +} else if (this.horizontalAlignment == 10) { +horizontalAlignmentString = "LEADING"; +} else if (this.horizontalAlignment == 11) { +horizontalAlignmentString = "TRAILING"; +} else horizontalAlignmentString = ""; +var commandString = (this.command != null ? this.command : ""); +return Clazz_superCall (this, javax.swing.JTextField, "paramString", []) + ",columns=" + this.columns + ",columnWidth=" + this.columnWidth + ",command=" + commandString + ",horizontalAlignment=" + horizontalAlignmentString; +}); +c$.$JTextField$ScrollRepainter$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, javax.swing.JTextField, "ScrollRepainter", null, javax.swing.event.ChangeListener); +Clazz_overrideMethod (c$, "stateChanged", +function (a) { +this.b$["javax.swing.JTextField"].repaint (); +}, "javax.swing.event.ChangeEvent"); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.JTextField, "TextFieldActionPropertyChangeListener", javax.swing.ActionPropertyChangeListener); +Clazz_overrideMethod (c$, "actionPropertyChanged", +function (a, b, c) { +if (javax.swing.AbstractAction.shouldReconfigure (c)) { +a.configurePropertiesFromAction (b); +} else { +a.actionPropertyChanged (b, c.getPropertyName ()); +}}, "javax.swing.JTextField,javax.swing.Action,java.beans.PropertyChangeEvent"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.JTextField, "NotifyAction", javax.swing.text.TextAction); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JTextField.NotifyAction, ["notify-field-accept"]); +}); +Clazz_overrideMethod (c$, "actionPerformed", +function (a) { +var b = this.getFocusedComponent (); +if (Clazz_instanceOf (b, javax.swing.JTextField)) { +var c = b; +c.postActionEvent (); +}}, "java.awt.event.ActionEvent"); +Clazz_overrideMethod (c$, "isEnabled", +function () { +var a = this.getFocusedComponent (); +if (Clazz_instanceOf (a, javax.swing.JTextField)) { +return (a).hasActionListener (); +}return false; +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"notifyAction", "notify-field-accept"); +c$.defaultActions = c$.prototype.defaultActions = Clazz_newArray (-1, [ new javax.swing.JTextField.NotifyAction ()]); +Clazz_defineStatics (c$, +"$uiClassID", "TextFieldUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.beans.PropertyChangeListener"], "javax.swing.ActionPropertyChangeListener", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.action = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "ActionPropertyChangeListener", null, java.beans.PropertyChangeListener); +Clazz_makeConstructor (c$, +function (c, a) { +this.setTarget (c); +this.action = a; +}, "~O,javax.swing.Action"); +Clazz_overrideMethod (c$, "propertyChange", +function (e) { +var target = this.getTarget (); +if (target == null) { +this.getAction ().removePropertyChangeListener (this); +} else { +this.actionPropertyChanged (target, this.getAction (), e); +}}, "java.beans.PropertyChangeEvent"); +Clazz_defineMethod (c$, "setTarget", + function (c) { +}, "~O"); +Clazz_defineMethod (c$, "getTarget", +function () { +return null; +}); +Clazz_defineMethod (c$, "getAction", +function () { +return this.action; +}); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.ChangeListener", null, function () { +Clazz_declareInterface (javax.swing.event, "ChangeListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (null, "javax.swing.ActionMap", ["java.util.HashMap", "javax.swing.ArrayTable"], function () { +c$ = Clazz_decorateAsClass (function () { +this.arrayTable = null; +this.parent = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "ActionMap"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setParent", +function (map) { +this.parent = map; +}, "javax.swing.ActionMap"); +Clazz_defineMethod (c$, "getParent", +function () { +return this.parent; +}); +Clazz_defineMethod (c$, "put", +function (key, action) { +if (key == null) { +return; +}if (action == null) { +this.remove (key); +} else { +if (this.arrayTable == null) { +this.arrayTable = new javax.swing.ArrayTable (); +}this.arrayTable.put (key, action); +}}, "~O,javax.swing.Action"); +Clazz_defineMethod (c$, "get", +function (key) { +var value = (this.arrayTable == null) ? null : this.arrayTable.get (key); +if (value == null) { +var parent = this.getParent (); +if (parent != null) { +return parent.get (key); +}}return value; +}, "~O"); +Clazz_defineMethod (c$, "remove", +function (key) { +if (this.arrayTable != null) { +this.arrayTable.remove (key); +}}, "~O"); +Clazz_defineMethod (c$, "clear", +function () { +if (this.arrayTable != null) { +this.arrayTable.clear (); +}}); +Clazz_defineMethod (c$, "keys", +function () { +if (this.arrayTable == null) { +return null; +}return this.arrayTable.getKeys (null); +}); +Clazz_defineMethod (c$, "size", +function () { +if (this.arrayTable == null) { +return 0; +}return this.arrayTable.size (); +}); +Clazz_defineMethod (c$, "allKeys", +function () { +var count = this.size (); +var parent = this.getParent (); +if (count == 0) { +if (parent != null) { +return parent.allKeys (); +}return this.keys (); +}if (parent == null) { +return this.keys (); +}var keys = this.keys (); +var pKeys = parent.allKeys (); +if (pKeys == null) { +return keys; +}if (keys == null) { +return pKeys; +}var keyMap = new java.util.HashMap (); +var counter; +for (counter = keys.length - 1; counter >= 0; counter--) { +keyMap.put (keys[counter], keys[counter]); +} +for (counter = pKeys.length - 1; counter >= 0; counter--) { +keyMap.put (pKeys[counter], pKeys[counter]); +} +return keyMap.keySet ().toArray (); +}); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (null, "javax.swing.InputMap", ["java.util.HashMap", "javax.swing.ArrayTable"], function () { +c$ = Clazz_decorateAsClass (function () { +this.arrayTable = null; +this.parent = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "InputMap"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "setParent", +function (map) { +this.parent = map; +}, "javax.swing.InputMap"); +Clazz_defineMethod (c$, "getParent", +function () { +return this.parent; +}); +Clazz_defineMethod (c$, "put", +function (keyStroke, actionMapKey) { +if (keyStroke == null) { +return; +}if (actionMapKey == null) { +this.remove (keyStroke); +} else { +if (this.arrayTable == null) { +this.arrayTable = new javax.swing.ArrayTable (); +}this.arrayTable.put (keyStroke, actionMapKey); +}}, "javax.swing.KeyStroke,~O"); +Clazz_defineMethod (c$, "get", +function (keyStroke) { +if (this.arrayTable == null) { +var parent = this.getParent (); +if (parent != null) { +return parent.get (keyStroke); +}return null; +}var value = this.arrayTable.get (keyStroke); +if (value == null) { +var parent = this.getParent (); +if (parent != null) { +return parent.get (keyStroke); +}}return value; +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "remove", +function (key) { +if (this.arrayTable != null) { +this.arrayTable.remove (key); +}}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "clear", +function () { +if (this.arrayTable != null) { +this.arrayTable.clear (); +}}); +Clazz_defineMethod (c$, "keys", +function () { +if (this.arrayTable == null) { +return null; +}var keys = new Array (this.arrayTable.size ()); +this.arrayTable.getKeys (keys); +return keys; +}); +Clazz_defineMethod (c$, "size", +function () { +if (this.arrayTable == null) { +return 0; +}return this.arrayTable.size (); +}); +Clazz_defineMethod (c$, "allKeys", +function () { +var count = this.size (); +var parent = this.getParent (); +if (count == 0) { +if (parent != null) { +return parent.allKeys (); +}return this.keys (); +}if (parent == null) { +return this.keys (); +}var keys = this.keys (); +var pKeys = parent.allKeys (); +if (pKeys == null) { +return keys; +}if (keys == null) { +return pKeys; +}var keyMap = new java.util.HashMap (); +var counter; +for (counter = keys.length - 1; counter >= 0; counter--) { +keyMap.put (keys[counter], keys[counter]); +} +for (counter = pKeys.length - 1; counter >= 0; counter--) { +keyMap.put (pKeys[counter], pKeys[counter]); +} +var allKeys = new Array (keyMap.size ()); +return keyMap.keySet ().toArray (allKeys); +}); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "Scrollable"); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventObject"], "javax.swing.event.CaretEvent", null, function () { +c$ = Clazz_declareType (javax.swing.event, "CaretEvent", java.util.EventObject); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.DocumentListener", null, function () { +Clazz_declareInterface (javax.swing.event, "DocumentListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (null, "javax.swing.event.EventListenerList", ["java.lang.reflect.Array"], function () { +c$ = Clazz_decorateAsClass (function () { +this.listenerList = null; +Clazz_instantialize (this, arguments); +}, javax.swing.event, "EventListenerList"); +Clazz_prepareFields (c$, function () { +this.listenerList = javax.swing.event.EventListenerList.NULL_ARRAY; +}); +Clazz_defineMethod (c$, "getListenerList", +function () { +return this.listenerList; +}); +Clazz_defineMethod (c$, "getListeners", +function (t) { +var lList = this.listenerList; +var n = this.getListenerCount (lList, t); +var result = java.lang.reflect.Array.newInstance (t, n); +var j = 0; +for (var i = lList.length - 2; i >= 0; i -= 2) { +if (lList[i] === t) { +result[j++] = lList[i + 1]; +}} +return result; +}, "Class"); +Clazz_defineMethod (c$, "getListenerCount", +function () { +return Clazz_doubleToInt (this.listenerList.length / 2); +}); +Clazz_defineMethod (c$, "getListenerCount", +function (t) { +var lList = this.listenerList; +return this.getListenerCount (lList, t); +}, "Class"); +Clazz_defineMethod (c$, "getListenerCount", + function (list, t) { +var count = 0; +for (var i = 0; i < list.length; i += 2) { +if (t === list[i]) count++; +} +return count; +}, "~A,Class"); +Clazz_defineMethod (c$, "add", +function (t, l) { +if (l == null) { +return; +}if (this.listenerList === javax.swing.event.EventListenerList.NULL_ARRAY) { +this.listenerList = Clazz_newArray (-1, [t, l]); +} else { +var i = this.listenerList.length; +var tmp = new Array (i + 2); +System.arraycopy (this.listenerList, 0, tmp, 0, i); +tmp[i] = t; +tmp[i + 1] = l; +this.listenerList = tmp; +}}, "Class,~O"); +Clazz_defineMethod (c$, "remove", +function (t, l) { +if (l == null) { +return; +}var index = -1; +for (var i = this.listenerList.length - 2; i >= 0; i -= 2) { +if ((this.listenerList[i] === t) && (this.listenerList[i + 1].equals (l) == true)) { +index = i; +break; +}} +if (index != -1) { +var tmp = new Array (this.listenerList.length - 2); +System.arraycopy (this.listenerList, 0, tmp, 0, index); +if (index < tmp.length) System.arraycopy (this.listenerList, index + 2, tmp, index, tmp.length - index); +this.listenerList = (tmp.length == 0) ? javax.swing.event.EventListenerList.NULL_ARRAY : tmp; +}}, "Class,~O"); +Clazz_overrideMethod (c$, "toString", +function () { +var lList = this.listenerList; +var s = "EventListenerList: "; +s += Clazz_doubleToInt (lList.length / 2) + " listeners: "; +for (var i = 0; i <= lList.length - 2; i += 2) { +s += " type " + (lList[i]).getName (); +s += " listener " + lList[i + 1]; +} +return s; +}); +c$.NULL_ARRAY = c$.prototype.NULL_ARRAY = new Array (0); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventObject"], "javax.swing.event.ChangeEvent", null, function () { +c$ = Clazz_declareType (javax.swing.event, "ChangeEvent", java.util.EventObject); +}); +Clazz_declarePackage ("jssun.swing"); +Clazz_load (["jssun.swing.UIClientPropertyKey"], "jssun.swing.StringUIClientPropertyKey", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.key = null; +Clazz_instantialize (this, arguments); +}, jssun.swing, "StringUIClientPropertyKey", null, jssun.swing.UIClientPropertyKey); +Clazz_makeConstructor (c$, +function (key) { +this.key = key; +}, "~S"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.key; +}); +}); +Clazz_declarePackage ("jssun.swing"); +Clazz_declareInterface (jssun.swing, "UIClientPropertyKey"); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.Graphics"], "java.awt.Graphics2D", null, function () { +c$ = Clazz_declareType (java.awt, "Graphics2D", java.awt.Graphics); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.Graphics2D, []); +}); +Clazz_overrideMethod (c$, "draw3DRect", +function (x, y, width, height, raised) { +var p = this.getPaint (); +var c = this.getColor (); +var brighter = c.brighter (); +var darker = c.darker (); +this.setColor (raised ? brighter : darker); +this.fillRect (x, y, 1, height + 1); +this.fillRect (x + 1, y, width - 1, 1); +this.setColor (raised ? darker : brighter); +this.fillRect (x + 1, y + height, width, 1); +this.fillRect (x + width, y, 1, height); +this.setPaint (p); +}, "~N,~N,~N,~N,~B"); +Clazz_overrideMethod (c$, "fill3DRect", +function (x, y, width, height, raised) { +var p = this.getPaint (); +var c = this.getColor (); +var brighter = c.brighter (); +var darker = c.darker (); +if (!raised) { +this.setColor (darker); +} else if (p !== c) { +this.setColor (c); +}this.fillRect (x + 1, y + 1, width - 2, height - 2); +this.setColor (raised ? brighter : darker); +this.fillRect (x, y, 1, height); +this.fillRect (x + 1, y, width - 2, 1); +this.setColor (raised ? darker : brighter); +this.fillRect (x + 1, y + height - 1, width - 1, 1); +this.fillRect (x + width - 1, y, 1, height - 1); +this.setPaint (p); +}, "~N,~N,~N,~N,~B"); +}); +Clazz_declarePackage ("java.awt"); +c$ = Clazz_declareType (java.awt, "Graphics"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "create", +function () { +return this.createSwingJS (); +}); +Clazz_defineMethod (c$, "create", +function (x, y, width, height) { +return this.create4 (x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "create4", +function (x, y, width, height) { +var g = this.createSwingJS (); +if (g == null) return null; +g.translate (x, y); +g.clipRect (0, 0, width, height); +return g; +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getFontMetrics", +function () { +return this.getFontMetrics (this.getFont ()); +}); +Clazz_defineMethod (c$, "drawRect", +function (x, y, width, height) { +if ((width < 0) || (height < 0)) { +return; +}if (height == 0 || width == 0) { +this.drawLine (x, y, x + width, y + height); +} else { +this.drawLine (x, y, x + width - 1, y); +this.drawLine (x + width, y, x + width, y + height - 1); +this.drawLine (x + width, y + height, x + 1, y + height); +this.drawLine (x, y + height, x, y + 1); +}}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "draw3DRect", +function (x, y, width, height, raised) { +var c = this.getColor (); +var brighter = c.brighter (); +var darker = c.darker (); +this.setColor (raised ? brighter : darker); +this.drawLine (x, y, x, y + height); +this.drawLine (x + 1, y, x + width - 1, y); +this.setColor (raised ? darker : brighter); +this.drawLine (x + 1, y + height, x + width, y + height); +this.drawLine (x + width, y, x + width, y + height - 1); +this.setColor (c); +}, "~N,~N,~N,~N,~B"); +Clazz_defineMethod (c$, "fill3DRect", +function (x, y, width, height, raised) { +var c = this.getColor (); +var brighter = c.brighter (); +var darker = c.darker (); +if (!raised) { +this.setColor (darker); +}this.fillRect (x + 1, y + 1, width - 2, height - 2); +this.setColor (raised ? brighter : darker); +this.drawLine (x, y, x, y + height - 1); +this.drawLine (x + 1, y, x + width - 2, y); +this.setColor (raised ? darker : brighter); +this.drawLine (x + 1, y + height - 1, x + width - 1, y + height - 1); +this.drawLine (x + width - 1, y, x + width - 1, y + height - 2); +this.setColor (c); +}, "~N,~N,~N,~N,~B"); +Clazz_defineMethod (c$, "drawPolygon", +function (p) { +this.drawPolygon (p.xpoints, p.ypoints, p.npoints); +}, "java.awt.Polygon"); +Clazz_defineMethod (c$, "fillPolygon", +function (p) { +this.fillPolygon (p.xpoints, p.ypoints, p.npoints); +}, "java.awt.Polygon"); +Clazz_defineMethod (c$, "drawChars", +function (data, offset, length, x, y) { +this.drawString ( String.instantialize (data, offset, length), x, y); +}, "~A,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "drawBytes", +function (data, offset, length, x, y) { +this.drawString ( String.instantialize (data, 0, offset, length), x, y); +}, "~A,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "finalize", +function () { +this.dispose (); +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[font=" + this.getFont () + ",color=" + this.getColor () + "]"; +}); +Clazz_defineMethod (c$, "getClipRect", +function () { +return this.getClipBounds (); +}); +Clazz_defineMethod (c$, "hitClip", +function (x, y, width, height) { +var clipRect = this.getClipBounds (); +if (clipRect == null) { +return true; +}return clipRect.intersects (x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_declarePackage ("jssun.font"); +Clazz_load (["java.awt.FontMetrics", "java.util.Hashtable"], "jssun.font.FontDesignMetrics", ["java.lang.IndexOutOfBoundsException", "java.awt.Toolkit", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.ascent = 0; +this.descent = 0; +this.leading = 0; +this.height = -1; +Clazz_instantialize (this, arguments); +}, jssun.font, "FontDesignMetrics", java.awt.FontMetrics); +c$.getMetrics = Clazz_defineMethod (c$, "getMetrics", +function (font) { +var m = null; +var r; +r = jssun.font.FontDesignMetrics.metricsCache.get (font); +if (r != null) { +m = r.get (); +}if (m == null) { +m = new jssun.font.FontDesignMetrics (font); +jssun.font.FontDesignMetrics.metricsCache.put (font, new jssun.font.FontDesignMetrics.KeyReference (font, m)); +}for (var i = 0; i < jssun.font.FontDesignMetrics.recentMetrics.length; i++) { +if (jssun.font.FontDesignMetrics.recentMetrics[i] === m) { +return m; +}} +{ +jssun.font.FontDesignMetrics.recentMetrics[jssun.font.FontDesignMetrics.recentIndex++] = m; +if (jssun.font.FontDesignMetrics.recentIndex == 5) { +jssun.font.FontDesignMetrics.recentIndex = 0; +}}return m; +}, "java.awt.Font"); +Clazz_makeConstructor (c$, + function (font) { +Clazz_superConstructor (this, jssun.font.FontDesignMetrics, [font]); +this.font = font; +this.initMatrixAndMetrics (); +}, "java.awt.Font"); +Clazz_defineMethod (c$, "initMatrixAndMetrics", + function () { +{ +//need to calculate ascent, descent, leading, and maxAdvance +}}); +Clazz_defineMethod (c$, "charWidth", +function (ch) { +var s = ""; +{ +s = "" + ch; +}return this.stringWidth (s); +}, "~S"); +Clazz_overrideMethod (c$, "stringWidth", +function (str) { +return Clazz_doubleToInt (0.5 + this.getWidth (str)); +}, "~S"); +Clazz_defineMethod (c$, "getWidth", + function (str) { +return swingjs.JSToolkit.getStringWidth (null, this.font, str); +}, "~S"); +Clazz_overrideMethod (c$, "charsWidth", +function (data, off, len) { +var width = 0; +if (len < 0) { +throw new IndexOutOfBoundsException ("len=" + len); +}var limit = off + len; +for (var i = off; i < limit; i++) { +var ch = data[i]; +width += this.stringWidth ("" + ch); +} +return Clazz_doubleToInt (0.5 + width); +}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "getWidths", +function () { +var widths = Clazz_newIntArray (256, 0); +return widths; +}); +Clazz_defineMethod (c$, "getAscent", +function () { +if (this.ascent == 0) this.ascent = java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (this.font).getAscent (); +return Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.ascent); +}); +Clazz_defineMethod (c$, "getDescent", +function () { +if (this.descent == 0) this.descent = java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (this.font).getDescent (); +return Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent); +}); +Clazz_overrideMethod (c$, "getLeading", +function () { +return Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent + this.leading) - Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent); +}); +Clazz_overrideMethod (c$, "getHeight", +function () { +if (this.height < 0) { +this.height = this.getAscent () + Clazz_floatToInt (jssun.font.FontDesignMetrics.roundingUpValue + this.descent + this.leading); +}return this.height; +}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.key = null; +this.val = null; +Clazz_instantialize (this, arguments); +}, jssun.font.FontDesignMetrics, "KeyReference"); +Clazz_makeConstructor (c$, +function (a, b) { +this.key = a; +this.val = b; +}, "~O,~O"); +Clazz_defineMethod (c$, "get", +function () { +return this.val; +}); +Clazz_defineMethod (c$, "dispose", +function () { +if (jssun.font.FontDesignMetrics.metricsCache.get (this.key) === this) { +jssun.font.FontDesignMetrics.metricsCache.remove (this.key); +}}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"roundingUpValue", 0.95); +c$.metricsCache = c$.prototype.metricsCache = new java.util.Hashtable (); +Clazz_defineStatics (c$, +"MAXRECENT", 5); +c$.recentMetrics = c$.prototype.recentMetrics = new Array (5); +Clazz_defineStatics (c$, +"recentIndex", 0); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.font.FontRenderContext"], "java.awt.FontMetrics", ["java.lang.Character"], function () { +c$ = Clazz_decorateAsClass (function () { +this.font = null; +Clazz_instantialize (this, arguments); +}, java.awt, "FontMetrics"); +Clazz_makeConstructor (c$, +function (font) { +this.font = font; +}, "java.awt.Font"); +Clazz_defineMethod (c$, "getFont", +function () { +return this.font; +}); +Clazz_defineMethod (c$, "getFontRenderContext", +function () { +return java.awt.FontMetrics.DEFAULT_FRC; +}); +Clazz_defineMethod (c$, "getLeading", +function () { +return 0; +}); +Clazz_defineMethod (c$, "getAscent", +function () { +return this.font.getSize (); +}); +Clazz_defineMethod (c$, "getDescent", +function () { +return 0; +}); +Clazz_defineMethod (c$, "getHeight", +function () { +return this.getLeading () + this.getAscent () + this.getDescent (); +}); +Clazz_defineMethod (c$, "getMaxAscent", +function () { +return this.getAscent (); +}); +Clazz_defineMethod (c$, "getMaxDescent", +function () { +return this.getDescent (); +}); +Clazz_defineMethod (c$, "getMaxDecent", +function () { +return this.getMaxDescent (); +}); +Clazz_defineMethod (c$, "getMaxAdvance", +function () { +return -1; +}); +Clazz_defineMethod (c$, "charWidth", +function (codePoint) { +if (!Character.isValidCodePoint (codePoint)) { +codePoint = 0xffff; +}if (codePoint < 256) { +return this.getWidths ()[codePoint]; +} else { +var buffer = Clazz_newCharArray (2, '\0'); +var len = Character.toChars (codePoint, buffer, 0); +return this.charsWidth (buffer, 0, len); +}}, "~N"); +Clazz_defineMethod (c$, "charWidth", +function (ch) { +if (ch.charCodeAt (0) < 256) { +return this.getWidths ()[ch.charCodeAt (0)]; +}var data = Clazz_newCharArray (-1, [ch]); +return this.charsWidth (data, 0, 1); +}, "~S"); +Clazz_defineMethod (c$, "stringWidth", +function (str) { +var len = str.length; +var data = Clazz_newCharArray (len, '\0'); +str.getChars (0, len, data, 0); +return this.charsWidth (data, 0, len); +}, "~S"); +Clazz_defineMethod (c$, "charsWidth", +function (data, off, len) { +return this.stringWidth ( String.instantialize (data, off, len)); +}, "~A,~N,~N"); +Clazz_defineMethod (c$, "bytesWidth", +function (data, off, len) { +return this.stringWidth ( String.instantialize (data, 0, off, len)); +}, "~A,~N,~N"); +Clazz_defineMethod (c$, "getWidths", +function () { +var widths = Clazz_newIntArray (256, 0); +for (var ch = String.fromCharCode (0); ch.charCodeAt (0) < 256; ch = String.fromCharCode (ch.charCodeAt (0) + 1)) { +widths[ch.charCodeAt (0)] = this.charWidth (ch); +} +return widths; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[font=" + this.getFont () + "ascent=" + this.getAscent () + ", descent=" + this.getDescent () + ", height=" + this.getHeight () + "]"; +}); +c$.DEFAULT_FRC = c$.prototype.DEFAULT_FRC = new java.awt.font.FontRenderContext (null, false, false); +}); +Clazz_declarePackage ("JU"); +Clazz_load (null, "JU.PT", ["java.lang.Boolean", "$.Double", "$.Float", "$.Number", "java.util.Map", "javajs.api.JSONEncodable", "JU.AU", "$.DF", "$.Lst", "$.M34", "$.M4", "$.SB"], function () { +c$ = Clazz_declareType (JU, "PT"); +c$.parseInt = Clazz_defineMethod (c$, "parseInt", +function (str) { +return JU.PT.parseIntNext (str, Clazz_newIntArray (-1, [0])); +}, "~S"); +c$.parseIntNext = Clazz_defineMethod (c$, "parseIntNext", +function (str, next) { +var cch = str.length; +if (next[0] < 0 || next[0] >= cch) return -2147483648; +return JU.PT.parseIntChecked (str, cch, next); +}, "~S,~A"); +c$.parseIntChecked = Clazz_defineMethod (c$, "parseIntChecked", +function (str, ichMax, next) { +var digitSeen = false; +var value = 0; +var ich = next[0]; +if (ich < 0) return -2147483648; +var ch; +while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; + +var negative = false; +if (ich < ichMax && str.charCodeAt (ich) == 45) { +negative = true; +++ich; +}while (ich < ichMax && (ch = str.charCodeAt (ich)) >= 48 && ch <= 57) { +value = value * 10 + (ch - 48); +digitSeen = true; +++ich; +} +if (!digitSeen) value = -2147483648; + else if (negative) value = -value; +next[0] = ich; +return value; +}, "~S,~N,~A"); +c$.isWhiteSpace = Clazz_defineMethod (c$, "isWhiteSpace", +function (str, ich) { +var ch; +return (ich >= 0 && ((ch = str.charAt (ich)) == ' ' || ch == '\t' || ch == '\n')); +}, "~S,~N"); +c$.parseFloatChecked = Clazz_defineMethod (c$, "parseFloatChecked", +function (str, ichMax, next, isStrict) { +var digitSeen = false; +var ich = next[0]; +if (isStrict && str.indexOf ('\n') != str.lastIndexOf ('\n')) return NaN; +while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; + +var negative = false; +if (ich < ichMax && str.charAt (ich) == '-') { +++ich; +negative = true; +}var ch = 0; +var ival = 0; +var ival2 = 0; +while (ich < ichMax && (ch = str.charCodeAt (ich)) >= 48 && ch <= 57) { +ival = (ival * 10) + (ch - 48) * 1; +++ich; +digitSeen = true; +} +var isDecimal = false; +var iscale = 0; +var nzero = (ival == 0 ? -1 : 0); +if (ch == 46) { +isDecimal = true; +while (++ich < ichMax && (ch = str.charCodeAt (ich)) >= 48 && ch <= 57) { +digitSeen = true; +if (nzero < 0) { +if (ch == 48) { +nzero--; +continue; +}nzero = -nzero; +}if (iscale < JU.PT.decimalScale.length) { +ival2 = (ival2 * 10) + (ch - 48) * 1; +iscale++; +}} +}var value; +if (!digitSeen) { +value = NaN; +} else if (ival2 > 0) { +value = ival2 * JU.PT.decimalScale[iscale - 1]; +if (nzero > 1) { +if (nzero - 2 < JU.PT.decimalScale.length) { +value *= JU.PT.decimalScale[nzero - 2]; +} else { +value *= Math.pow (10, 1 - nzero); +}} else { +value += ival; +}} else { +value = ival; +}var isExponent = false; +if (ich < ichMax && (ch == 69 || ch == 101 || ch == 68)) { +isExponent = true; +if (++ich >= ichMax) return NaN; +ch = str.charCodeAt (ich); +if ((ch == 43) && (++ich >= ichMax)) return NaN; +next[0] = ich; +var exponent = JU.PT.parseIntChecked (str, ichMax, next); +if (exponent == -2147483648) return NaN; +if (exponent > 0 && exponent <= JU.PT.tensScale.length) value *= JU.PT.tensScale[exponent - 1]; + else if (exponent < 0 && -exponent <= JU.PT.decimalScale.length) value *= JU.PT.decimalScale[-exponent - 1]; + else if (exponent != 0) value *= Math.pow (10, exponent); +} else { +next[0] = ich; +}if (negative) value = -value; +if (value == Infinity) value = 3.4028235E38; +return (!isStrict || (!isExponent || isDecimal) && JU.PT.checkTrailingText (str, next[0], ichMax) ? value : NaN); +}, "~S,~N,~A,~B"); +c$.checkTrailingText = Clazz_defineMethod (c$, "checkTrailingText", +function (str, ich, ichMax) { +var ch; +while (ich < ichMax && (JU.PT.isWhitespace (ch = str.charAt (ich)) || ch == ';')) ++ich; + +return (ich == ichMax); +}, "~S,~N,~N"); +c$.parseFloatArray = Clazz_defineMethod (c$, "parseFloatArray", +function (str) { +return JU.PT.parseFloatArrayNext (str, Clazz_newIntArray (1, 0), null, null, null); +}, "~S"); +c$.parseFloatArrayInfested = Clazz_defineMethod (c$, "parseFloatArrayInfested", +function (tokens, data) { +var len = data.length; +var nTokens = tokens.length; +var n = 0; +var max = 0; +for (var i = 0; i >= 0 && i < len && n < nTokens; i++) { +var f; +while (Float.isNaN (f = JU.PT.parseFloat (tokens[n++])) && n < nTokens) { +} +if (!Float.isNaN (f)) data[(max = i)] = f; +if (n == nTokens) break; +} +return max + 1; +}, "~A,~A"); +c$.parseFloatArrayNext = Clazz_defineMethod (c$, "parseFloatArrayNext", +function (str, next, f, strStart, strEnd) { +var n = 0; +var pt = next[0]; +if (pt >= 0) { +if (strStart != null) { +var p = str.indexOf (strStart, pt); +if (p >= 0) next[0] = p + strStart.length; +}str = str.substring (next[0]); +pt = (strEnd == null ? -1 : str.indexOf (strEnd)); +if (pt < 0) pt = str.length; + else str = str.substring (0, pt); +next[0] += pt + 1; +var tokens = JU.PT.getTokens (str); +if (f == null) f = Clazz_newFloatArray (tokens.length, 0); +n = JU.PT.parseFloatArrayInfested (tokens, f); +}if (f == null) return Clazz_newFloatArray (0, 0); +for (var i = n; i < f.length; i++) f[i] = NaN; + +return f; +}, "~S,~A,~A,~S,~S"); +c$.parseFloatRange = Clazz_defineMethod (c$, "parseFloatRange", +function (str, ichMax, next) { +var cch = str.length; +if (ichMax > cch) ichMax = cch; +if (next[0] < 0 || next[0] >= ichMax) return NaN; +return JU.PT.parseFloatChecked (str, ichMax, next, false); +}, "~S,~N,~A"); +c$.parseFloatNext = Clazz_defineMethod (c$, "parseFloatNext", +function (str, next) { +var cch = (str == null ? -1 : str.length); +return (next[0] < 0 || next[0] >= cch ? NaN : JU.PT.parseFloatChecked (str, cch, next, false)); +}, "~S,~A"); +c$.parseFloatStrict = Clazz_defineMethod (c$, "parseFloatStrict", +function (str) { +var cch = str.length; +if (cch == 0) return NaN; +return JU.PT.parseFloatChecked (str, cch, Clazz_newIntArray (-1, [0]), true); +}, "~S"); +c$.parseFloat = Clazz_defineMethod (c$, "parseFloat", +function (str) { +return JU.PT.parseFloatNext (str, Clazz_newIntArray (-1, [0])); +}, "~S"); +c$.parseIntRadix = Clazz_defineMethod (c$, "parseIntRadix", +function (s, i) { +{ +return Integer.parseIntRadix(s, i); +}}, "~S,~N"); +c$.getTokens = Clazz_defineMethod (c$, "getTokens", +function (line) { +return JU.PT.getTokensAt (line, 0); +}, "~S"); +c$.parseToken = Clazz_defineMethod (c$, "parseToken", +function (str) { +return JU.PT.parseTokenNext (str, Clazz_newIntArray (-1, [0])); +}, "~S"); +c$.parseTrimmed = Clazz_defineMethod (c$, "parseTrimmed", +function (str) { +return JU.PT.parseTrimmedRange (str, 0, str.length); +}, "~S"); +c$.parseTrimmedAt = Clazz_defineMethod (c$, "parseTrimmedAt", +function (str, ichStart) { +return JU.PT.parseTrimmedRange (str, ichStart, str.length); +}, "~S,~N"); +c$.parseTrimmedRange = Clazz_defineMethod (c$, "parseTrimmedRange", +function (str, ichStart, ichMax) { +var cch = str.length; +if (ichMax < cch) cch = ichMax; +if (cch < ichStart) return ""; +return JU.PT.parseTrimmedChecked (str, ichStart, cch); +}, "~S,~N,~N"); +c$.getTokensAt = Clazz_defineMethod (c$, "getTokensAt", +function (line, ich) { +if (line == null) return null; +var cchLine = line.length; +if (ich < 0 || ich > cchLine) return null; +var tokenCount = JU.PT.countTokens (line, ich); +var tokens = new Array (tokenCount); +var next = Clazz_newIntArray (1, 0); +next[0] = ich; +for (var i = 0; i < tokenCount; ++i) tokens[i] = JU.PT.parseTokenChecked (line, cchLine, next); + +return tokens; +}, "~S,~N"); +c$.countTokens = Clazz_defineMethod (c$, "countTokens", +function (line, ich) { +var tokenCount = 0; +if (line != null) { +var ichMax = line.length; +while (true) { +while (ich < ichMax && JU.PT.isWhiteSpace (line, ich)) ++ich; + +if (ich == ichMax) break; +++tokenCount; +do { +++ich; +} while (ich < ichMax && !JU.PT.isWhiteSpace (line, ich)); +} +}return tokenCount; +}, "~S,~N"); +c$.parseTokenNext = Clazz_defineMethod (c$, "parseTokenNext", +function (str, next) { +var cch = str.length; +return (next[0] < 0 || next[0] >= cch ? null : JU.PT.parseTokenChecked (str, cch, next)); +}, "~S,~A"); +c$.parseTokenRange = Clazz_defineMethod (c$, "parseTokenRange", +function (str, ichMax, next) { +var cch = str.length; +if (ichMax > cch) ichMax = cch; +return (next[0] < 0 || next[0] >= ichMax ? null : JU.PT.parseTokenChecked (str, ichMax, next)); +}, "~S,~N,~A"); +c$.parseTokenChecked = Clazz_defineMethod (c$, "parseTokenChecked", +function (str, ichMax, next) { +var ich = next[0]; +while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; + +var ichNonWhite = ich; +while (ich < ichMax && !JU.PT.isWhiteSpace (str, ich)) ++ich; + +next[0] = ich; +return (ichNonWhite == ich ? null : str.substring (ichNonWhite, ich)); +}, "~S,~N,~A"); +c$.parseTrimmedChecked = Clazz_defineMethod (c$, "parseTrimmedChecked", +function (str, ich, ichMax) { +while (ich < ichMax && JU.PT.isWhiteSpace (str, ich)) ++ich; + +var ichLast = ichMax - 1; +while (ichLast >= ich && JU.PT.isWhiteSpace (str, ichLast)) --ichLast; + +return (ichLast < ich ? "" : str.substring (ich, ichLast + 1)); +}, "~S,~N,~N"); +c$.dVal = Clazz_defineMethod (c$, "dVal", +function (s) { +{ +if(s==null) +throw new NumberFormatException("null"); +var d=parseFloat(s); +if(isNaN(d)) +throw new NumberFormatException("Not a Number : "+s); +return d +}}, "~S"); +c$.fVal = Clazz_defineMethod (c$, "fVal", +function (s) { +{ +return this.dVal(s); +}}, "~S"); +c$.parseIntRange = Clazz_defineMethod (c$, "parseIntRange", +function (str, ichMax, next) { +var cch = str.length; +if (ichMax > cch) ichMax = cch; +return (next[0] < 0 || next[0] >= ichMax ? -2147483648 : JU.PT.parseIntChecked (str, ichMax, next)); +}, "~S,~N,~A"); +c$.parseFloatArrayData = Clazz_defineMethod (c$, "parseFloatArrayData", +function (tokens, data) { +JU.PT.parseFloatArrayDataN (tokens, data, data.length); +}, "~A,~A"); +c$.parseFloatArrayDataN = Clazz_defineMethod (c$, "parseFloatArrayDataN", +function (tokens, data, nData) { +for (var i = nData; --i >= 0; ) data[i] = (i >= tokens.length ? NaN : JU.PT.parseFloat (tokens[i])); + +}, "~A,~A,~N"); +c$.split = Clazz_defineMethod (c$, "split", +function (text, run) { +if (text.length == 0) return new Array (0); +var n = 1; +var i = text.indexOf (run); +var lines; +var runLen = run.length; +if (i < 0 || runLen == 0) { +lines = new Array (1); +lines[0] = text; +return lines; +}var len = text.length - runLen; +for (; i >= 0 && i < len; n++) i = text.indexOf (run, i + runLen); + +lines = new Array (n); +i = 0; +var ipt = 0; +var pt = 0; +for (; (ipt = text.indexOf (run, i)) >= 0 && pt + 1 < n; ) { +lines[pt++] = text.substring (i, ipt); +i = ipt + runLen; +} +if (text.indexOf (run, len) != len) len += runLen; +lines[pt] = text.substring (i, len); +return lines; +}, "~S,~S"); +c$.getQuotedStringAt = Clazz_defineMethod (c$, "getQuotedStringAt", +function (line, ipt0) { +var next = Clazz_newIntArray (-1, [ipt0]); +return JU.PT.getQuotedStringNext (line, next); +}, "~S,~N"); +c$.getQuotedStringNext = Clazz_defineMethod (c$, "getQuotedStringNext", +function (line, next) { +var i = next[0]; +if (i < 0 || (i = line.indexOf ("\"", i)) < 0) return ""; +var pt = i + 1; +var len = line.length; +while (++i < len && line.charAt (i) != '"') if (line.charAt (i) == '\\') i++; + +next[0] = i + 1; +return line.substring (pt, i); +}, "~S,~A"); +c$.getCSVString = Clazz_defineMethod (c$, "getCSVString", +function (line, next) { +var i = next[1]; +if (i < 0 || (i = line.indexOf ("\"", i)) < 0) return null; +var pt = next[0] = i; +var len = line.length; +var escaped = false; +var haveEscape = false; +while (++i < len && (line.charAt (i) != '"' || (escaped = (i + 1 < len && line.charAt (i + 1) == '"')))) if (escaped) { +escaped = false; +haveEscape = true; +i++; +} +if (i >= len) { +next[1] = -1; +return null; +}next[1] = i + 1; +var s = line.substring (pt + 1, i); +return (haveEscape ? JU.PT.rep (JU.PT.rep (s, "\"\"", "\0"), "\0", "\"") : s); +}, "~S,~A"); +c$.isOneOf = Clazz_defineMethod (c$, "isOneOf", +function (key, semiList) { +if (semiList.length == 0) return false; +if (semiList.charAt (0) != ';') semiList = ";" + semiList + ";"; +return key.indexOf (";") < 0 && semiList.indexOf (';' + key + ';') >= 0; +}, "~S,~S"); +c$.getQuotedAttribute = Clazz_defineMethod (c$, "getQuotedAttribute", +function (info, name) { +var i = info.indexOf (name + "="); +return (i < 0 ? null : JU.PT.getQuotedStringAt (info, i)); +}, "~S,~S"); +c$.approx = Clazz_defineMethod (c$, "approx", +function (f, n) { +return Math.round (f * n) / n; +}, "~N,~N"); +c$.rep = Clazz_defineMethod (c$, "rep", +function (str, strFrom, strTo) { +if (str == null || strFrom.length == 0 || str.indexOf (strFrom) < 0) return str; +var isOnce = (strTo.indexOf (strFrom) >= 0); +do { +str = str.$replace (strFrom, strTo); +} while (!isOnce && str.indexOf (strFrom) >= 0); +return str; +}, "~S,~S,~S"); +c$.formatF = Clazz_defineMethod (c$, "formatF", +function (value, width, precision, alignLeft, zeroPad) { +return JU.PT.formatS (JU.DF.formatDecimal (value, precision), width, 0, alignLeft, zeroPad); +}, "~N,~N,~N,~B,~B"); +c$.formatD = Clazz_defineMethod (c$, "formatD", +function (value, width, precision, alignLeft, zeroPad, allowOverflow) { +return JU.PT.formatS (JU.DF.formatDecimal (value, -1 - precision), width, 0, alignLeft, zeroPad); +}, "~N,~N,~N,~B,~B,~B"); +c$.formatS = Clazz_defineMethod (c$, "formatS", +function (value, width, precision, alignLeft, zeroPad) { +if (value == null) return ""; +var len = value.length; +if (precision != 2147483647 && precision > 0 && precision < len) value = value.substring (0, precision); + else if (precision < 0 && len + precision >= 0) value = value.substring (len + precision + 1); +var padLength = width - value.length; +if (padLength <= 0) return value; +var isNeg = (zeroPad && !alignLeft && value.charAt (0) == '-'); +var padChar = (zeroPad ? '0' : ' '); +var padChar0 = (isNeg ? '-' : padChar); +var sb = new JU.SB (); +if (alignLeft) sb.append (value); +sb.appendC (padChar0); +for (var i = padLength; --i > 0; ) sb.appendC (padChar); + +if (!alignLeft) sb.append (isNeg ? padChar + value.substring (1) : value); +return sb.toString (); +}, "~S,~N,~N,~B,~B"); +c$.replaceWithCharacter = Clazz_defineMethod (c$, "replaceWithCharacter", +function (str, strFrom, chTo) { +if (str == null) return null; +for (var i = strFrom.length; --i >= 0; ) str = str.$replace (strFrom.charAt (i), chTo); + +return str; +}, "~S,~S,~S"); +c$.replaceAllCharacters = Clazz_defineMethod (c$, "replaceAllCharacters", +function (str, strFrom, strTo) { +for (var i = strFrom.length; --i >= 0; ) { +var chFrom = strFrom.substring (i, i + 1); +str = JU.PT.rep (str, chFrom, strTo); +} +return str; +}, "~S,~S,~S"); +c$.trim = Clazz_defineMethod (c$, "trim", +function (str, chars) { +if (chars.length == 0) return str.trim (); +var len = str.length; +var k = 0; +while (k < len && chars.indexOf (str.charAt (k)) >= 0) k++; + +var m = str.length - 1; +while (m > k && chars.indexOf (str.charAt (m)) >= 0) m--; + +return str.substring (k, m + 1); +}, "~S,~S"); +c$.trimQuotes = Clazz_defineMethod (c$, "trimQuotes", +function (value) { +return (value != null && value.length > 1 && value.startsWith ("\"") && value.endsWith ("\"") ? value.substring (1, value.length - 1) : value); +}, "~S"); +c$.isNonStringPrimitive = Clazz_defineMethod (c$, "isNonStringPrimitive", +function (info) { +return Clazz_instanceOf (info, Number) || Clazz_instanceOf (info, Boolean); +}, "~O"); +c$.arrayGet = Clazz_defineMethod (c$, "arrayGet", + function (info, i) { +{ +return info[i]; +}}, "~O,~N"); +c$.toJSON = Clazz_defineMethod (c$, "toJSON", +function (infoType, info) { +if (info == null) return JU.PT.packageJSON (infoType, null); +if (JU.PT.isNonStringPrimitive (info)) return JU.PT.packageJSON (infoType, info.toString ()); +var s = null; +var sb = null; +while (true) { +if (Clazz_instanceOf (info, String)) { +s = info; +{ +if (typeof s == "undefined") s = "null" +}if (s.indexOf ("{\"") != 0) { +s = JU.PT.rep (s, "\"", "\\\""); +s = JU.PT.rep (s, "\n", "\\n"); +s = "\"" + s + "\""; +}break; +}if (Clazz_instanceOf (info, javajs.api.JSONEncodable)) { +if ((s = (info).toJSON ()) == null) s = "null"; +break; +}sb = new JU.SB (); +if (Clazz_instanceOf (info, java.util.Map)) { +sb.append ("{ "); +var sep = ""; +for (var key, $key = (info).keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) { +sb.append (sep).append (JU.PT.packageJSON (key, JU.PT.toJSON (null, (info).get (key)))); +sep = ","; +} +sb.append (" }"); +break; +}if (Clazz_instanceOf (info, JU.Lst)) { +sb.append ("[ "); +var n = (info).size (); +for (var i = 0; i < n; i++) { +if (i > 0) sb.appendC (','); +sb.append (JU.PT.toJSON (null, (info).get (i))); +} +sb.append (" ]"); +break; +}if (Clazz_instanceOf (info, JU.M34)) { +var len = (Clazz_instanceOf (info, JU.M4) ? 4 : 3); +var x = Clazz_newFloatArray (len, 0); +var m = info; +sb.appendC ('['); +for (var i = 0; i < len; i++) { +if (i > 0) sb.appendC (','); +m.getRow (i, x); +sb.append (JU.PT.toJSON (null, x)); +} +sb.appendC (']'); +break; +}s = JU.PT.nonArrayString (info); +if (s == null) { +sb.append ("["); +var n = JU.AU.getLength (info); +for (var i = 0; i < n; i++) { +if (i > 0) sb.appendC (','); +sb.append (JU.PT.toJSON (null, JU.PT.arrayGet (info, i))); +} +sb.append ("]"); +break; +}info = info.toString (); +} +return JU.PT.packageJSON (infoType, (s == null ? sb.toString () : s)); +}, "~S,~O"); +c$.nonArrayString = Clazz_defineMethod (c$, "nonArrayString", +function (x) { +{ +var s = x.toString(); return (s.startsWith("[object") && +s.endsWith("Array]") ? null : s); +}}, "~O"); +c$.byteArrayToJSON = Clazz_defineMethod (c$, "byteArrayToJSON", +function (data) { +var sb = new JU.SB (); +sb.append ("["); +var n = data.length; +for (var i = 0; i < n; i++) { +if (i > 0) sb.appendC (','); +sb.appendI (data[i] & 0xFF); +} +sb.append ("]"); +return sb.toString (); +}, "~A"); +c$.packageJSON = Clazz_defineMethod (c$, "packageJSON", +function (infoType, info) { +return (infoType == null ? info : "\"" + infoType + "\": " + info); +}, "~S,~S"); +c$.isAS = Clazz_defineMethod (c$, "isAS", +function (x) { +{ +return Clazz_isAS(x); +}}, "~O"); +c$.isASS = Clazz_defineMethod (c$, "isASS", +function (x) { +{ +return Clazz_isASS(x); +}}, "~O"); +c$.isAP = Clazz_defineMethod (c$, "isAP", +function (x) { +{ +return Clazz_isAP(x); +}}, "~O"); +c$.isAF = Clazz_defineMethod (c$, "isAF", +function (x) { +{ +return Clazz_isAF(x); +}}, "~O"); +c$.isAFloat = Clazz_defineMethod (c$, "isAFloat", +function (x) { +{ +return Clazz_isAFloat(x); +}}, "~O"); +c$.isAD = Clazz_defineMethod (c$, "isAD", +function (x) { +{ +return Clazz_isAF(x); +}}, "~O"); +c$.isADD = Clazz_defineMethod (c$, "isADD", +function (x) { +{ +return Clazz_isAFF(x); +}}, "~O"); +c$.isAB = Clazz_defineMethod (c$, "isAB", +function (x) { +{ +return Clazz_isAI(x); +}}, "~O"); +c$.isAI = Clazz_defineMethod (c$, "isAI", +function (x) { +{ +return Clazz_isAI(x); +}}, "~O"); +c$.isAII = Clazz_defineMethod (c$, "isAII", +function (x) { +{ +return Clazz_isAII(x); +}}, "~O"); +c$.isAFF = Clazz_defineMethod (c$, "isAFF", +function (x) { +{ +return Clazz_isAFF(x); +}}, "~O"); +c$.isAFFF = Clazz_defineMethod (c$, "isAFFF", +function (x) { +{ +return Clazz_isAFFF(x); +}}, "~O"); +c$.escapeUrl = Clazz_defineMethod (c$, "escapeUrl", +function (url) { +url = JU.PT.rep (url, "\n", ""); +url = JU.PT.rep (url, "%", "%25"); +url = JU.PT.rep (url, "#", "%23"); +url = JU.PT.rep (url, "[", "%5B"); +url = JU.PT.rep (url, "]", "%5D"); +url = JU.PT.rep (url, " ", "%20"); +return url; +}, "~S"); +c$.esc = Clazz_defineMethod (c$, "esc", +function (str) { +if (str == null || str.length == 0) return "\"\""; +var haveEscape = false; +var i = 0; +for (; i < "\\\\\tt\rr\nn\"\"".length; i += 2) if (str.indexOf ("\\\\\tt\rr\nn\"\"".charAt (i)) >= 0) { +haveEscape = true; +break; +} +if (haveEscape) while (i < "\\\\\tt\rr\nn\"\"".length) { +var pt = -1; +var ch = "\\\\\tt\rr\nn\"\"".charAt (i++); +var ch2 = "\\\\\tt\rr\nn\"\"".charAt (i++); +var sb = new JU.SB (); +var pt0 = 0; +while ((pt = str.indexOf (ch, pt + 1)) >= 0) { +sb.append (str.substring (pt0, pt)).appendC ('\\').appendC (ch2); +pt0 = pt + 1; +} +sb.append (str.substring (pt0, str.length)); +str = sb.toString (); +} +return "\"" + JU.PT.escUnicode (str) + "\""; +}, "~S"); +c$.escUnicode = Clazz_defineMethod (c$, "escUnicode", +function (str) { +for (var i = str.length; --i >= 0; ) if (str.charCodeAt (i) > 0x7F) { +var s = "0000" + Integer.toHexString (str.charCodeAt (i)); +str = str.substring (0, i) + "\\u" + s.substring (s.length - 4) + str.substring (i + 1); +} +return str; +}, "~S"); +c$.escF = Clazz_defineMethod (c$, "escF", +function (f) { +var sf = "" + f; +{ +if (sf.indexOf(".") < 0 && sf.indexOf("e") < 0) +sf += ".0"; +}return sf; +}, "~N"); +c$.join = Clazz_defineMethod (c$, "join", +function (s, c, i0) { +if (s.length < i0) return null; +var sb = new JU.SB (); +sb.append (s[i0++]); +for (var i = i0; i < s.length; i++) sb.appendC (c).append (s[i]); + +return sb.toString (); +}, "~A,~S,~N"); +c$.isLike = Clazz_defineMethod (c$, "isLike", +function (a, b) { +var areEqual = a.equals (b); +if (areEqual) return true; +var isStart = b.startsWith ("*"); +var isEnd = b.endsWith ("*"); +return (!isStart && !isEnd) ? areEqual : isStart && isEnd ? b.length == 1 || a.contains (b.substring (1, b.length - 1)) : isStart ? a.endsWith (b.substring (1)) : a.startsWith (b.substring (0, b.length - 1)); +}, "~S,~S"); +c$.getMapValueNoCase = Clazz_defineMethod (c$, "getMapValueNoCase", +function (h, key) { +if ("this".equals (key)) return h; +var val = h.get (key); +if (val == null) for (var e, $e = h.entrySet ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) if (e.getKey ().equalsIgnoreCase (key)) return e.getValue (); + +return val; +}, "java.util.Map,~S"); +c$.getMapSubset = Clazz_defineMethod (c$, "getMapSubset", +function (h, key, h2) { +var val = h.get (key); +if (val != null) { +h2.put (key, val); +return; +}for (var e, $e = h.entrySet ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) { +var k = e.getKey (); +if (JU.PT.isLike (k, key)) h2.put (k, e.getValue ()); +} +}, "java.util.Map,~S,java.util.Map"); +c$.clean = Clazz_defineMethod (c$, "clean", +function (s) { +return JU.PT.rep (JU.PT.replaceAllCharacters (s, " \t\n\r", " "), " ", " ").trim (); +}, "~S"); +c$.fdup = Clazz_defineMethod (c$, "fdup", +function (f, pt, n) { +var ch; +var count = 0; +for (var i = pt; --i >= 1; ) { +if (JU.PT.isDigit (ch = f.charAt (i))) continue; +switch (ch) { +case '.': +if (count++ != 0) return f; +continue; +case '-': +if (i != 1 && f.charAt (i - 1) != '.') return f; +continue; +default: +return f; +} +} +var s = f.substring (0, pt + 1); +var sb = new JU.SB (); +for (var i = 0; i < n; i++) sb.append (s); + +sb.append (f.substring (pt + 1)); +return sb.toString (); +}, "~S,~N,~N"); +c$.formatString = Clazz_defineMethod (c$, "formatString", +function (strFormat, key, strT, floatT, doubleT, doOne) { +if (strFormat == null) return null; +if ("".equals (strFormat)) return ""; +var len = key.length; +if (strFormat.indexOf ("%") < 0 || len == 0 || strFormat.indexOf (key) < 0) return strFormat; +var strLabel = ""; +var ich; +var ichPercent; +var ichKey; +for (ich = 0; (ichPercent = strFormat.indexOf ('%', ich)) >= 0 && (ichKey = strFormat.indexOf (key, ichPercent + 1)) >= 0; ) { +if (ich != ichPercent) strLabel += strFormat.substring (ich, ichPercent); +ich = ichPercent + 1; +if (ichKey > ichPercent + 6) { +strLabel += '%'; +continue; +}try { +var alignLeft = false; +if (strFormat.charAt (ich) == '-') { +alignLeft = true; +++ich; +}var zeroPad = false; +if (strFormat.charAt (ich) == '0') { +zeroPad = true; +++ich; +}var ch; +var width = 0; +while ((ch = strFormat.charAt (ich)) >= '0' && (ch <= '9')) { +width = (10 * width) + (ch.charCodeAt (0) - 48); +++ich; +} +var precision = 2147483647; +var isExponential = false; +if (strFormat.charAt (ich) == '.') { +++ich; +if ((ch = strFormat.charAt (ich)) == '-') { +isExponential = true; +++ich; +}if ((ch = strFormat.charAt (ich)) >= '0' && ch <= '9') { +precision = ch.charCodeAt (0) - 48; +++ich; +}if (isExponential) precision = -precision - (strT == null ? 1 : 0); +}var st = strFormat.substring (ich, ich + len); +if (!st.equals (key)) { +ich = ichPercent + 1; +strLabel += '%'; +continue; +}ich += len; +if (!Float.isNaN (floatT)) strLabel += JU.PT.formatF (floatT, width, precision, alignLeft, zeroPad); + else if (strT != null) strLabel += JU.PT.formatS (strT, width, precision, alignLeft, zeroPad); + else if (!Double.isNaN (doubleT)) strLabel += JU.PT.formatD (doubleT, width, precision, alignLeft, zeroPad, true); +if (doOne) break; +} catch (ioobe) { +if (Clazz_exceptionOf (ioobe, IndexOutOfBoundsException)) { +ich = ichPercent; +break; +} else { +throw ioobe; +} +} +} +strLabel += strFormat.substring (ich); +return strLabel; +}, "~S,~S,~S,~N,~N,~B"); +c$.formatStringS = Clazz_defineMethod (c$, "formatStringS", +function (strFormat, key, strT) { +return JU.PT.formatString (strFormat, key, strT, NaN, NaN, false); +}, "~S,~S,~S"); +c$.formatStringF = Clazz_defineMethod (c$, "formatStringF", +function (strFormat, key, floatT) { +return JU.PT.formatString (strFormat, key, null, floatT, NaN, false); +}, "~S,~S,~N"); +c$.formatStringI = Clazz_defineMethod (c$, "formatStringI", +function (strFormat, key, intT) { +return JU.PT.formatString (strFormat, key, "" + intT, NaN, NaN, false); +}, "~S,~S,~N"); +c$.sprintf = Clazz_defineMethod (c$, "sprintf", +function (strFormat, list, values) { +if (values == null) return strFormat; +var n = list.length; +if (n == values.length) try { +for (var o = 0; o < n; o++) { +if (values[o] == null) continue; +switch (list.charAt (o)) { +case 's': +strFormat = JU.PT.formatString (strFormat, "s", values[o], NaN, NaN, true); +break; +case 'f': +strFormat = JU.PT.formatString (strFormat, "f", null, (values[o]).floatValue (), NaN, true); +break; +case 'i': +strFormat = JU.PT.formatString (strFormat, "d", "" + values[o], NaN, NaN, true); +strFormat = JU.PT.formatString (strFormat, "i", "" + values[o], NaN, NaN, true); +break; +case 'd': +strFormat = JU.PT.formatString (strFormat, "e", null, NaN, (values[o]).doubleValue (), true); +break; +case 'p': +var pVal = values[o]; +strFormat = JU.PT.formatString (strFormat, "p", null, pVal.x, NaN, true); +strFormat = JU.PT.formatString (strFormat, "p", null, pVal.y, NaN, true); +strFormat = JU.PT.formatString (strFormat, "p", null, pVal.z, NaN, true); +break; +case 'q': +var qVal = values[o]; +strFormat = JU.PT.formatString (strFormat, "q", null, qVal.x, NaN, true); +strFormat = JU.PT.formatString (strFormat, "q", null, qVal.y, NaN, true); +strFormat = JU.PT.formatString (strFormat, "q", null, qVal.z, NaN, true); +strFormat = JU.PT.formatString (strFormat, "q", null, qVal.w, NaN, true); +break; +case 'S': +var sVal = values[o]; +for (var i = 0; i < sVal.length; i++) strFormat = JU.PT.formatString (strFormat, "s", sVal[i], NaN, NaN, true); + +break; +case 'F': +var fVal = values[o]; +for (var i = 0; i < fVal.length; i++) strFormat = JU.PT.formatString (strFormat, "f", null, fVal[i], NaN, true); + +break; +case 'I': +var iVal = values[o]; +for (var i = 0; i < iVal.length; i++) strFormat = JU.PT.formatString (strFormat, "d", "" + iVal[i], NaN, NaN, true); + +for (var i = 0; i < iVal.length; i++) strFormat = JU.PT.formatString (strFormat, "i", "" + iVal[i], NaN, NaN, true); + +break; +case 'D': +var dVal = values[o]; +for (var i = 0; i < dVal.length; i++) strFormat = JU.PT.formatString (strFormat, "e", null, NaN, dVal[i], true); + +} +} +return JU.PT.rep (strFormat, "%%", "%"); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +} else { +throw e; +} +} +System.out.println ("TextFormat.sprintf error " + list + " " + strFormat); +return JU.PT.rep (strFormat, "%", "?"); +}, "~S,~S,~A"); +c$.formatCheck = Clazz_defineMethod (c$, "formatCheck", +function (strFormat) { +if (strFormat == null || strFormat.indexOf ('p') < 0 && strFormat.indexOf ('q') < 0) return strFormat; +strFormat = JU.PT.rep (strFormat, "%%", "\1"); +strFormat = JU.PT.rep (strFormat, "%p", "%6.2p"); +strFormat = JU.PT.rep (strFormat, "%q", "%6.2q"); +var format = JU.PT.split (strFormat, "%"); +var sb = new JU.SB (); +sb.append (format[0]); +for (var i = 1; i < format.length; i++) { +var f = "%" + format[i]; +var pt; +if (f.length >= 3) { +if ((pt = f.indexOf ('p')) >= 0) f = JU.PT.fdup (f, pt, 3); +if ((pt = f.indexOf ('q')) >= 0) f = JU.PT.fdup (f, pt, 4); +}sb.append (f); +} +return sb.toString ().$replace ('\1', '%'); +}, "~S"); +c$.leftJustify = Clazz_defineMethod (c$, "leftJustify", +function (s, s1, s2) { +s.append (s2); +var n = s1.length - s2.length; +if (n > 0) s.append (s1.substring (0, n)); +}, "JU.SB,~S,~S"); +c$.rightJustify = Clazz_defineMethod (c$, "rightJustify", +function (s, s1, s2) { +var n = s1.length - s2.length; +if (n > 0) s.append (s1.substring (0, n)); +s.append (s2); +}, "JU.SB,~S,~S"); +c$.safeTruncate = Clazz_defineMethod (c$, "safeTruncate", +function (f, n) { +if (f > -0.001 && f < 0.001) f = 0; +return (f + " ").substring (0, n); +}, "~N,~N"); +c$.isWild = Clazz_defineMethod (c$, "isWild", +function (s) { +return s != null && (s.indexOf ("*") >= 0 || s.indexOf ("?") >= 0); +}, "~S"); +c$.isMatch = Clazz_defineMethod (c$, "isMatch", +function (search, match, checkStar, allowInitialStar) { +if (search.equals (match)) return true; +var mLen = match.length; +if (mLen == 0) return false; +var isStar0 = (checkStar && allowInitialStar ? match.charAt (0) == '*' : false); +if (mLen == 1 && isStar0) return true; +var isStar1 = (checkStar && match.endsWith ("*")); +var haveQ = (match.indexOf ('?') >= 0); +if (!haveQ) { +if (isStar0) return (isStar1 ? (mLen < 3 || search.indexOf (match.substring (1, mLen - 1)) >= 0) : search.endsWith (match.substring (1))); + else if (isStar1) return search.startsWith (match.substring (0, mLen - 1)); +}var sLen = search.length; +var qqqq = "????"; +var nq = 4; +while (nq < sLen) { +qqqq += qqqq; +nq += 4; +} +if (checkStar) { +if (isStar0) { +match = qqqq + match.substring (1); +mLen += nq - 1; +}if (isStar1) { +match = match.substring (0, mLen - 1) + qqqq; +mLen += nq - 1; +}}if (mLen < sLen) return false; +var ich = 0; +while (mLen > sLen) { +if (allowInitialStar && match.charAt (ich) == '?') { +++ich; +} else if (match.charAt (ich + mLen - 1) != '?') { +return false; +}--mLen; +} +for (var i = sLen; --i >= 0; ) { +var chm = match.charAt (ich + i); +if (chm == '?') continue; +var chs = search.charAt (i); +if (chm != chs && (chm != '\1' || chs != '?')) return false; +} +return true; +}, "~S,~S,~B,~B"); +c$.replaceQuotedStrings = Clazz_defineMethod (c$, "replaceQuotedStrings", +function (s, list, newList) { +var n = list.size (); +for (var i = 0; i < n; i++) { +var name = list.get (i); +var newName = newList.get (i); +if (!newName.equals (name)) s = JU.PT.rep (s, "\"" + name + "\"", "\"" + newName + "\""); +} +return s; +}, "~S,JU.Lst,JU.Lst"); +c$.replaceStrings = Clazz_defineMethod (c$, "replaceStrings", +function (s, list, newList) { +var n = list.size (); +for (var i = 0; i < n; i++) { +var name = list.get (i); +var newName = newList.get (i); +if (!newName.equals (name)) s = JU.PT.rep (s, name, newName); +} +return s; +}, "~S,JU.Lst,JU.Lst"); +c$.isDigit = Clazz_defineMethod (c$, "isDigit", +function (ch) { +var c = (ch).charCodeAt (0); +return (48 <= c && c <= 57); +}, "~S"); +c$.isUpperCase = Clazz_defineMethod (c$, "isUpperCase", +function (ch) { +var c = (ch).charCodeAt (0); +return (65 <= c && c <= 90); +}, "~S"); +c$.isLowerCase = Clazz_defineMethod (c$, "isLowerCase", +function (ch) { +var c = (ch).charCodeAt (0); +return (97 <= c && c <= 122); +}, "~S"); +c$.isLetter = Clazz_defineMethod (c$, "isLetter", +function (ch) { +var c = (ch).charCodeAt (0); +return (65 <= c && c <= 90 || 97 <= c && c <= 122); +}, "~S"); +c$.isLetterOrDigit = Clazz_defineMethod (c$, "isLetterOrDigit", +function (ch) { +var c = (ch).charCodeAt (0); +return (65 <= c && c <= 90 || 97 <= c && c <= 122 || 48 <= c && c <= 57); +}, "~S"); +c$.isWhitespace = Clazz_defineMethod (c$, "isWhitespace", +function (ch) { +var c = (ch).charCodeAt (0); +return (c >= 0x1c && c <= 0x20 || c >= 0x9 && c <= 0xd); +}, "~S"); +c$.fixPtFloats = Clazz_defineMethod (c$, "fixPtFloats", +function (pt, f) { +pt.x = Math.round (pt.x * f) / f; +pt.y = Math.round (pt.y * f) / f; +pt.z = Math.round (pt.z * f) / f; +}, "JU.T3,~N"); +c$.fixDouble = Clazz_defineMethod (c$, "fixDouble", +function (d, f) { +return Math.round (d * f) / f; +}, "~N,~N"); +c$.parseFloatFraction = Clazz_defineMethod (c$, "parseFloatFraction", +function (s) { +var pt = s.indexOf ("/"); +return (pt < 0 ? JU.PT.parseFloat (s) : JU.PT.parseFloat (s.substring (0, pt)) / JU.PT.parseFloat (s.substring (pt + 1))); +}, "~S"); +Clazz_defineStatics (c$, +"tensScale", Clazz_newFloatArray (-1, [10, 100, 1000, 10000, 100000, 1000000]), +"decimalScale", Clazz_newFloatArray (-1, [0.1, 0.01, 0.001, 0.0001, 0.00001, 0.000001, 0.0000001, 0.00000001, 0.000000001]), +"FLOAT_MIN_SAFE", 2E-45, +"escapable", "\\\\\tt\rr\nn\"\"", +"FRACTIONAL_PRECISION", 100000, +"CARTESIAN_PRECISION", 10000); +}); +Clazz_declarePackage ("javajs.api"); +Clazz_declareInterface (javajs.api, "JSONEncodable"); +Clazz_declarePackage ("JU"); +Clazz_load (null, "JU.AU", ["java.util.Arrays", "JU.Lst"], function () { +c$ = Clazz_declareType (JU, "AU"); +c$.ensureLength = Clazz_defineMethod (c$, "ensureLength", +function (array, minimumLength) { +if (array != null && JU.AU.getLength (array) >= minimumLength) return array; +return JU.AU.arrayCopyObject (array, minimumLength); +}, "~O,~N"); +c$.ensureLengthS = Clazz_defineMethod (c$, "ensureLengthS", +function (array, minimumLength) { +if (array != null && array.length >= minimumLength) return array; +return JU.AU.arrayCopyS (array, minimumLength); +}, "~A,~N"); +c$.ensureLengthA = Clazz_defineMethod (c$, "ensureLengthA", +function (array, minimumLength) { +if (array != null && array.length >= minimumLength) return array; +return JU.AU.arrayCopyF (array, minimumLength); +}, "~A,~N"); +c$.ensureLengthI = Clazz_defineMethod (c$, "ensureLengthI", +function (array, minimumLength) { +if (array != null && array.length >= minimumLength) return array; +return JU.AU.arrayCopyI (array, minimumLength); +}, "~A,~N"); +c$.ensureLengthShort = Clazz_defineMethod (c$, "ensureLengthShort", +function (array, minimumLength) { +if (array != null && array.length >= minimumLength) return array; +return JU.AU.arrayCopyShort (array, minimumLength); +}, "~A,~N"); +c$.ensureLengthByte = Clazz_defineMethod (c$, "ensureLengthByte", +function (array, minimumLength) { +if (array != null && array.length >= minimumLength) return array; +return JU.AU.arrayCopyByte (array, minimumLength); +}, "~A,~N"); +c$.doubleLength = Clazz_defineMethod (c$, "doubleLength", +function (array) { +return JU.AU.arrayCopyObject (array, (array == null ? 16 : 2 * JU.AU.getLength (array))); +}, "~O"); +c$.doubleLengthS = Clazz_defineMethod (c$, "doubleLengthS", +function (array) { +return JU.AU.arrayCopyS (array, (array == null ? 16 : 2 * array.length)); +}, "~A"); +c$.doubleLengthF = Clazz_defineMethod (c$, "doubleLengthF", +function (array) { +return JU.AU.arrayCopyF (array, (array == null ? 16 : 2 * array.length)); +}, "~A"); +c$.doubleLengthI = Clazz_defineMethod (c$, "doubleLengthI", +function (array) { +return JU.AU.arrayCopyI (array, (array == null ? 16 : 2 * array.length)); +}, "~A"); +c$.doubleLengthShort = Clazz_defineMethod (c$, "doubleLengthShort", +function (array) { +return JU.AU.arrayCopyShort (array, (array == null ? 16 : 2 * array.length)); +}, "~A"); +c$.doubleLengthByte = Clazz_defineMethod (c$, "doubleLengthByte", +function (array) { +return JU.AU.arrayCopyByte (array, (array == null ? 16 : 2 * array.length)); +}, "~A"); +c$.doubleLengthBool = Clazz_defineMethod (c$, "doubleLengthBool", +function (array) { +return JU.AU.arrayCopyBool (array, (array == null ? 16 : 2 * array.length)); +}, "~A"); +c$.deleteElements = Clazz_defineMethod (c$, "deleteElements", +function (array, firstElement, nElements) { +if (nElements == 0 || array == null) return array; +var oldLength = JU.AU.getLength (array); +if (firstElement >= oldLength) return array; +var n = oldLength - (firstElement + nElements); +if (n < 0) n = 0; +var t = JU.AU.newInstanceO (array, firstElement + n); +if (firstElement > 0) System.arraycopy (array, 0, t, 0, firstElement); +if (n > 0) System.arraycopy (array, firstElement + nElements, t, firstElement, n); +return t; +}, "~O,~N,~N"); +c$.arrayCopyObject = Clazz_defineMethod (c$, "arrayCopyObject", +function (array, newLength) { +if (array == null) { +return null; +}var oldLength = JU.AU.getLength (array); +if (newLength == oldLength) return array; +var t = JU.AU.newInstanceO (array, newLength); +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +return t; +}, "~O,~N"); +c$.newInstanceO = Clazz_defineMethod (c$, "newInstanceO", + function (array, n) { +{ +if (!array.getClass().getComponentType) +return new Array(n); +}}, "~O,~N"); +c$.getLength = Clazz_defineMethod (c$, "getLength", +function (array) { +{ +return array.length +}}, "~O"); +c$.arrayCopyS = Clazz_defineMethod (c$, "arrayCopyS", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = new Array (newLength); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyII = Clazz_defineMethod (c$, "arrayCopyII", +function (array, newLength) { +var t = JU.AU.newInt2 (newLength); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyPt = Clazz_defineMethod (c$, "arrayCopyPt", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = new Array (newLength); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyF = Clazz_defineMethod (c$, "arrayCopyF", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = Clazz_newFloatArray (newLength, 0); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyI = Clazz_defineMethod (c$, "arrayCopyI", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = Clazz_newIntArray (newLength, 0); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyRangeI = Clazz_defineMethod (c$, "arrayCopyRangeI", +function (array, i0, n) { +if (array == null) return null; +var oldLength = array.length; +if (n == -1) n = oldLength; +if (n == -2) n = Clazz_doubleToInt (oldLength / 2); +n = n - i0; +var t = Clazz_newIntArray (n, 0); +System.arraycopy (array, i0, t, 0, n); +return t; +}, "~A,~N,~N"); +c$.arrayCopyRangeRevI = Clazz_defineMethod (c$, "arrayCopyRangeRevI", +function (array, i0, n) { +if (array == null) return null; +var t = JU.AU.arrayCopyRangeI (array, i0, n); +if (n < 0) n = array.length; +for (var i = Clazz_doubleToInt (n / 2); --i >= 0; ) JU.AU.swapInt (t, i, n - 1 - i); + +return t; +}, "~A,~N,~N"); +c$.arrayCopyShort = Clazz_defineMethod (c$, "arrayCopyShort", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = Clazz_newShortArray (newLength, 0); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyByte = Clazz_defineMethod (c$, "arrayCopyByte", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = Clazz_newByteArray (newLength, 0); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.arrayCopyBool = Clazz_defineMethod (c$, "arrayCopyBool", +function (array, newLength) { +if (newLength < 0) newLength = array.length; +var t = Clazz_newBooleanArray (newLength, false); +if (array != null) { +var oldLength = array.length; +System.arraycopy (array, 0, t, 0, oldLength < newLength ? oldLength : newLength); +}return t; +}, "~A,~N"); +c$.swapInt = Clazz_defineMethod (c$, "swapInt", +function (array, indexA, indexB) { +var t = array[indexA]; +array[indexA] = array[indexB]; +array[indexB] = t; +}, "~A,~N,~N"); +c$.dumpArray = Clazz_defineMethod (c$, "dumpArray", +function (msg, A, x1, x2, y1, y2) { +var s = "dumpArray: " + msg + "\n"; +for (var x = x1; x <= x2; x++) s += "\t*" + x + "*"; + +for (var y = y2; y >= y1; y--) { +s += "\n*" + y + "*"; +for (var x = x1; x <= x2; x++) s += "\t" + (x < A.length && y < A[x].length ? A[x][y] : NaN); + +} +return s; +}, "~S,~A,~N,~N,~N,~N"); +c$.dumpIntArray = Clazz_defineMethod (c$, "dumpIntArray", +function (A, n) { +var str = ""; +for (var i = 0; i < n; i++) str += " " + A[i]; + +return str; +}, "~A,~N"); +c$.sortedItem = Clazz_defineMethod (c$, "sortedItem", +function (v, n) { +if (v.size () == 0) return null; +if (v.size () == 1) return v.get (0); +var keys = v.toArray ( new Array (v.size ())); +java.util.Arrays.sort (keys); +return keys[n % keys.length]; +}, "JU.Lst,~N"); +c$.createArrayOfArrayList = Clazz_defineMethod (c$, "createArrayOfArrayList", +function (size) { +return new Array (size); +}, "~N"); +c$.createArrayOfHashtable = Clazz_defineMethod (c$, "createArrayOfHashtable", +function (size) { +return new Array (size); +}, "~N"); +c$.swap = Clazz_defineMethod (c$, "swap", +function (o, i, j) { +var oi = o[i]; +o[i] = o[j]; +o[j] = oi; +}, "~A,~N,~N"); +c$.newFloat2 = Clazz_defineMethod (c$, "newFloat2", +function (n) { +{ +return Clazz_newArray(n, null); +}}, "~N"); +c$.newInt2 = Clazz_defineMethod (c$, "newInt2", +function (n) { +{ +return Clazz_newArray(n, null); +}}, "~N"); +c$.newInt3 = Clazz_defineMethod (c$, "newInt3", +function (nx, ny) { +{ +return Clazz_newArray(nx, null); +}}, "~N,~N"); +c$.newFloat3 = Clazz_defineMethod (c$, "newFloat3", +function (nx, ny) { +{ +return Clazz_newArray(nx, null); +}}, "~N,~N"); +c$.newInt4 = Clazz_defineMethod (c$, "newInt4", +function (n) { +{ +return Clazz_newArray(n, null); +}}, "~N"); +c$.newShort2 = Clazz_defineMethod (c$, "newShort2", +function (n) { +{ +return Clazz_newArray(n, null); +}}, "~N"); +c$.newByte2 = Clazz_defineMethod (c$, "newByte2", +function (n) { +{ +return Clazz_newArray(n, null); +}}, "~N"); +c$.newDouble2 = Clazz_defineMethod (c$, "newDouble2", +function (n) { +{ +return Clazz_newArray(n, null); +}}, "~N"); +c$.removeMapKeys = Clazz_defineMethod (c$, "removeMapKeys", +function (map, root) { +var list = new JU.Lst (); +for (var key, $key = map.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) if (key.startsWith (root)) list.addLast (key); + +for (var i = list.size (); --i >= 0; ) map.remove (list.get (i)); + +return list.size (); +}, "java.util.Map,~S"); +c$.isAS = Clazz_defineMethod (c$, "isAS", +function (x) { +{ +return Clazz_isAS(x); +}}, "~O"); +c$.isASS = Clazz_defineMethod (c$, "isASS", +function (x) { +{ +return Clazz_isASS(x); +}}, "~O"); +c$.isAP = Clazz_defineMethod (c$, "isAP", +function (x) { +{ +return Clazz_isAP(x); +}}, "~O"); +c$.isAF = Clazz_defineMethod (c$, "isAF", +function (x) { +{ +return Clazz_isAF(x); +}}, "~O"); +c$.isAFloat = Clazz_defineMethod (c$, "isAFloat", +function (x) { +{ +return Clazz_isAFloat(x); +}}, "~O"); +c$.isAD = Clazz_defineMethod (c$, "isAD", +function (x) { +{ +return Clazz_isAF(x); +}}, "~O"); +c$.isADD = Clazz_defineMethod (c$, "isADD", +function (x) { +{ +return Clazz_isAFF(x); +}}, "~O"); +c$.isAB = Clazz_defineMethod (c$, "isAB", +function (x) { +{ +return Clazz_isAI(x); +}}, "~O"); +c$.isAI = Clazz_defineMethod (c$, "isAI", +function (x) { +{ +return Clazz_isAI(x); +}}, "~O"); +c$.isAII = Clazz_defineMethod (c$, "isAII", +function (x) { +{ +return Clazz_isAII(x); +}}, "~O"); +c$.isAFF = Clazz_defineMethod (c$, "isAFF", +function (x) { +{ +return Clazz_isAFF(x); +}}, "~O"); +c$.isAFFF = Clazz_defineMethod (c$, "isAFFF", +function (x) { +{ +return Clazz_isAFFF(x); +}}, "~O"); +c$.ensureSignedBytes = Clazz_defineMethod (c$, "ensureSignedBytes", +function (b) { +if (b != null) { +{ +for (var i = b.length; --i >= 0;) { var j = b[i] & 0xFF; if +(j >= 0x80) j -= 0x100; b[i] = j; } +}}return b; +}, "~A"); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["java.util.ArrayList"], "JU.Lst", null, function () { +c$ = Clazz_declareType (JU, "Lst", java.util.ArrayList); +Clazz_defineMethod (c$, "addLast", +function (v) { +{ +return this.add1(v); +}}, "~O"); +Clazz_defineMethod (c$, "removeObj", +function (v) { +{ +return this.removeObject(v); +}}, "~O"); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["java.lang.Boolean"], "JU.DF", ["java.lang.Double", "$.Float", "JU.PT", "$.SB"], function () { +c$ = Clazz_declareType (JU, "DF"); +c$.setUseNumberLocalization = Clazz_defineMethod (c$, "setUseNumberLocalization", +function (TF) { +JU.DF.useNumberLocalization[0] = (TF ? Boolean.TRUE : Boolean.FALSE); +}, "~B"); +c$.formatDecimalDbl = Clazz_defineMethod (c$, "formatDecimalDbl", +function (value, decimalDigits) { +if (decimalDigits == 2147483647 || value == -Infinity || value == Infinity || Double.isNaN (value)) return "" + value; +return JU.DF.formatDecimal (value, decimalDigits); +}, "~N,~N"); +c$.formatDecimal = Clazz_defineMethod (c$, "formatDecimal", +function (value, decimalDigits) { +if (decimalDigits == 2147483647 || value == -Infinity || value == Infinity || Float.isNaN (value)) return "" + value; +var n; +if (decimalDigits < 0) { +decimalDigits = -decimalDigits; +if (decimalDigits > JU.DF.formattingStrings.length) decimalDigits = JU.DF.formattingStrings.length; +if (value == 0) return JU.DF.formattingStrings[decimalDigits] + "E+0"; +n = 0; +var d; +if (Math.abs (value) < 1) { +n = 10; +d = value * 1e-10; +} else { +n = -10; +d = value * 1e10; +}var s = ("" + d).toUpperCase (); +var i = s.indexOf ("E"); +n = JU.PT.parseInt (s.substring (i + 1)) + n; +return (i < 0 ? "" + value : JU.DF.formatDecimal (JU.PT.parseFloat (s.substring (0, i)), decimalDigits - 1) + "E" + (n >= 0 ? "+" : "") + n); +}if (decimalDigits >= JU.DF.formattingStrings.length) decimalDigits = JU.DF.formattingStrings.length - 1; +var s1 = ("" + value).toUpperCase (); +var pt = s1.indexOf ("."); +if (pt < 0) return s1 + JU.DF.formattingStrings[decimalDigits].substring (1); +var isNeg = s1.startsWith ("-"); +if (isNeg) { +s1 = s1.substring (1); +pt--; +}var pt1 = s1.indexOf ("E-"); +if (pt1 > 0) { +n = JU.PT.parseInt (s1.substring (pt1 + 1)); +s1 = "0." + "0000000000000000000000000000000000000000".substring (0, -n - 1) + s1.substring (0, 1) + s1.substring (2, pt1); +pt = 1; +}pt1 = s1.indexOf ("E"); +if (pt1 > 0) { +n = JU.PT.parseInt (s1.substring (pt1 + 1)); +s1 = s1.substring (0, 1) + s1.substring (2, pt1) + "0000000000000000000000000000000000000000"; +s1 = s1.substring (0, n + 1) + "." + s1.substring (n + 1); +pt = s1.indexOf ("."); +}var len = s1.length; +var pt2 = decimalDigits + pt + 1; +if (pt2 < len && s1.charAt (pt2) >= '5') { +return JU.DF.formatDecimal (value + (isNeg ? -1 : 1) * JU.DF.formatAdds[decimalDigits], decimalDigits); +}var sb = JU.SB.newS (s1.substring (0, (decimalDigits == 0 ? pt : ++pt))); +for (var i = 0; i < decimalDigits; i++, pt++) { +if (pt < len) sb.appendC (s1.charAt (pt)); + else sb.appendC ('0'); +} +s1 = (isNeg ? "-" : "") + sb; +return (Boolean.TRUE.equals (JU.DF.useNumberLocalization[0]) ? s1 : s1.$replace (',', '.')); +}, "~N,~N"); +c$.formatDecimalTrimmed = Clazz_defineMethod (c$, "formatDecimalTrimmed", +function (x, precision) { +var str = JU.DF.formatDecimalDbl (x, precision); +var m = str.length - 1; +var zero = '0'; +while (m >= 0 && str.charAt (m) == zero) m--; + +return str.substring (0, m + 1); +}, "~N,~N"); +Clazz_defineStatics (c$, +"formattingStrings", Clazz_newArray (-1, ["0", "0.0", "0.00", "0.000", "0.0000", "0.00000", "0.000000", "0.0000000", "0.00000000", "0.000000000"]), +"zeros", "0000000000000000000000000000000000000000", +"formatAdds", Clazz_newFloatArray (-1, [0.5, 0.05, 0.005, 0.0005, 0.00005, 0.000005, 0.0000005, 0.00000005, 0.000000005, 0.0000000005])); +c$.useNumberLocalization = c$.prototype.useNumberLocalization = Clazz_newArray (-1, [Boolean.TRUE]); +}); +Clazz_declarePackage ("JU"); +c$ = Clazz_decorateAsClass (function () { +this.sb = null; +this.s = null; +Clazz_instantialize (this, arguments); +}, JU, "SB"); +Clazz_makeConstructor (c$, +function () { +{ +this.s = ""; +}}); +c$.newN = Clazz_defineMethod (c$, "newN", +function (n) { +{ +return new JU.SB(); +}}, "~N"); +c$.newS = Clazz_defineMethod (c$, "newS", +function (s) { +{ +var sb = new JU.SB(); +sb.s = s; +return sb; +}}, "~S"); +Clazz_defineMethod (c$, "append", +function (s) { +{ +this.s += s +}return this; +}, "~S"); +Clazz_defineMethod (c$, "appendC", +function (c) { +{ +this.s += c; +}return this; +}, "~S"); +Clazz_defineMethod (c$, "appendI", +function (i) { +{ +this.s += i +}return this; +}, "~N"); +Clazz_defineMethod (c$, "appendB", +function (b) { +{ +this.s += b +}return this; +}, "~B"); +Clazz_defineMethod (c$, "appendF", +function (f) { +{ +var sf = "" + f; +if (sf.indexOf(".") < 0 && sf.indexOf("e") < 0) +sf += ".0" ; +this.s += sf; +}return this; +}, "~N"); +Clazz_defineMethod (c$, "appendD", +function (d) { +{ +var sf = "" + d; +if (sf.indexOf(".") < 0 && sf.indexOf("e") < 0) +sf += ".0" ; +this.s += sf; +}return this; +}, "~N"); +Clazz_defineMethod (c$, "appendSB", +function (buf) { +{ +this.s += buf.s; +}return this; +}, "JU.SB"); +Clazz_defineMethod (c$, "appendO", +function (data) { +if (data != null) { +{ +this.s += data.toString(); +}}return this; +}, "~O"); +Clazz_defineMethod (c$, "appendCB", +function (cb, off, len) { +{ +for (var i = len,j=off; --i >= 0;) +this.s += cb[j++]; +}}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "toString", +function () { +{ +return this.s; +}}); +Clazz_defineMethod (c$, "length", +function () { +{ +return this.s.length; +}}); +Clazz_defineMethod (c$, "indexOf", +function (s) { +{ +return this.s.indexOf(s); +}}, "~S"); +Clazz_defineMethod (c$, "charAt", +function (i) { +{ +return this.s.charAt(i); +}}, "~N"); +Clazz_defineMethod (c$, "charCodeAt", +function (i) { +{ +return this.s.charCodeAt(i); +}}, "~N"); +Clazz_defineMethod (c$, "setLength", +function (n) { +{ +this.s = this.s.substring(0, n); +}}, "~N"); +Clazz_defineMethod (c$, "lastIndexOf", +function (s) { +{ +return this.s.lastIndexOf(s); +}}, "~S"); +Clazz_defineMethod (c$, "indexOf2", +function (s, i) { +{ +return this.s.indexOf(s, i); +}}, "~S,~N"); +Clazz_defineMethod (c$, "substring", +function (i) { +{ +return this.s.substring(i); +}}, "~N"); +Clazz_defineMethod (c$, "substring2", +function (i, j) { +{ +return this.s.substring(i, j); +}}, "~N,~N"); +Clazz_defineMethod (c$, "toBytes", +function (off, len) { +if (len < 0) len = this.length () - off; +var b = Clazz_newByteArray (len, 0); +for (var i = off + len, j = i - off; --i >= off; ) b[--j] = (this.charAt (i)).charCodeAt (0); + +return b; +}, "~N,~N"); +Clazz_defineMethod (c$, "replace", +function (start, end, str) { +{ +this.s = this.s.substring(0, start) + str + this.s.substring(end); +}}, "~N,~N,~S"); +Clazz_defineMethod (c$, "insert", +function (offset, str) { +this.replace (offset, offset, str); +}, "~N,~S"); +Clazz_declarePackage ("JU"); +Clazz_load (null, "JU.M34", ["java.lang.ArrayIndexOutOfBoundsException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.m00 = 0; +this.m01 = 0; +this.m02 = 0; +this.m10 = 0; +this.m11 = 0; +this.m12 = 0; +this.m20 = 0; +this.m21 = 0; +this.m22 = 0; +Clazz_instantialize (this, arguments); +}, JU, "M34"); +Clazz_defineMethod (c$, "setAA33", +function (a) { +var x = a.x; +var y = a.y; +var z = a.z; +var angle = a.angle; +var n = Math.sqrt (x * x + y * y + z * z); +n = 1 / n; +x *= n; +y *= n; +z *= n; +var c = Math.cos (angle); +var s = Math.sin (angle); +var omc = 1.0 - c; +this.m00 = (c + x * x * omc); +this.m11 = (c + y * y * omc); +this.m22 = (c + z * z * omc); +var tmp1 = x * y * omc; +var tmp2 = z * s; +this.m01 = (tmp1 - tmp2); +this.m10 = (tmp1 + tmp2); +tmp1 = x * z * omc; +tmp2 = y * s; +this.m02 = (tmp1 + tmp2); +this.m20 = (tmp1 - tmp2); +tmp1 = y * z * omc; +tmp2 = x * s; +this.m12 = (tmp1 - tmp2); +this.m21 = (tmp1 + tmp2); +}, "JU.A4"); +Clazz_defineMethod (c$, "rotate", +function (t) { +this.rotate2 (t, t); +}, "JU.T3"); +Clazz_defineMethod (c$, "rotate2", +function (t, result) { +result.set (this.m00 * t.x + this.m01 * t.y + this.m02 * t.z, this.m10 * t.x + this.m11 * t.y + this.m12 * t.z, this.m20 * t.x + this.m21 * t.y + this.m22 * t.z); +}, "JU.T3,JU.T3"); +Clazz_defineMethod (c$, "setM33", +function (m1) { +this.m00 = m1.m00; +this.m01 = m1.m01; +this.m02 = m1.m02; +this.m10 = m1.m10; +this.m11 = m1.m11; +this.m12 = m1.m12; +this.m20 = m1.m20; +this.m21 = m1.m21; +this.m22 = m1.m22; +}, "JU.M34"); +Clazz_defineMethod (c$, "clear33", +function () { +this.m00 = this.m01 = this.m02 = this.m10 = this.m11 = this.m12 = this.m20 = this.m21 = this.m22 = 0.0; +}); +Clazz_defineMethod (c$, "set33", +function (row, col, v) { +switch (row) { +case 0: +switch (col) { +case 0: +this.m00 = v; +return; +case 1: +this.m01 = v; +return; +case 2: +this.m02 = v; +return; +} +break; +case 1: +switch (col) { +case 0: +this.m10 = v; +return; +case 1: +this.m11 = v; +return; +case 2: +this.m12 = v; +return; +} +break; +case 2: +switch (col) { +case 0: +this.m20 = v; +return; +case 1: +this.m21 = v; +return; +case 2: +this.m22 = v; +return; +} +break; +} +this.err (); +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "get33", +function (row, col) { +switch (row) { +case 0: +switch (col) { +case 0: +return this.m00; +case 1: +return this.m01; +case 2: +return this.m02; +} +break; +case 1: +switch (col) { +case 0: +return this.m10; +case 1: +return this.m11; +case 2: +return this.m12; +} +break; +case 2: +switch (col) { +case 0: +return this.m20; +case 1: +return this.m21; +case 2: +return this.m22; +} +break; +} +this.err (); +return 0; +}, "~N,~N"); +Clazz_defineMethod (c$, "setRow33", +function (row, v) { +switch (row) { +case 0: +this.m00 = v[0]; +this.m01 = v[1]; +this.m02 = v[2]; +return; +case 1: +this.m10 = v[0]; +this.m11 = v[1]; +this.m12 = v[2]; +return; +case 2: +this.m20 = v[0]; +this.m21 = v[1]; +this.m22 = v[2]; +return; +default: +this.err (); +} +}, "~N,~A"); +Clazz_defineMethod (c$, "getRow33", +function (row, v) { +switch (row) { +case 0: +v[0] = this.m00; +v[1] = this.m01; +v[2] = this.m02; +return; +case 1: +v[0] = this.m10; +v[1] = this.m11; +v[2] = this.m12; +return; +case 2: +v[0] = this.m20; +v[1] = this.m21; +v[2] = this.m22; +return; +} +this.err (); +}, "~N,~A"); +Clazz_defineMethod (c$, "setColumn33", +function (column, v) { +switch (column) { +case 0: +this.m00 = v[0]; +this.m10 = v[1]; +this.m20 = v[2]; +break; +case 1: +this.m01 = v[0]; +this.m11 = v[1]; +this.m21 = v[2]; +break; +case 2: +this.m02 = v[0]; +this.m12 = v[1]; +this.m22 = v[2]; +break; +default: +this.err (); +} +}, "~N,~A"); +Clazz_defineMethod (c$, "getColumn33", +function (column, v) { +switch (column) { +case 0: +v[0] = this.m00; +v[1] = this.m10; +v[2] = this.m20; +break; +case 1: +v[0] = this.m01; +v[1] = this.m11; +v[2] = this.m21; +break; +case 2: +v[0] = this.m02; +v[1] = this.m12; +v[2] = this.m22; +break; +default: +this.err (); +} +}, "~N,~A"); +Clazz_defineMethod (c$, "add33", +function (m1) { +this.m00 += m1.m00; +this.m01 += m1.m01; +this.m02 += m1.m02; +this.m10 += m1.m10; +this.m11 += m1.m11; +this.m12 += m1.m12; +this.m20 += m1.m20; +this.m21 += m1.m21; +this.m22 += m1.m22; +}, "JU.M34"); +Clazz_defineMethod (c$, "sub33", +function (m1) { +this.m00 -= m1.m00; +this.m01 -= m1.m01; +this.m02 -= m1.m02; +this.m10 -= m1.m10; +this.m11 -= m1.m11; +this.m12 -= m1.m12; +this.m20 -= m1.m20; +this.m21 -= m1.m21; +this.m22 -= m1.m22; +}, "JU.M34"); +Clazz_defineMethod (c$, "mul33", +function (x) { +this.m00 *= x; +this.m01 *= x; +this.m02 *= x; +this.m10 *= x; +this.m11 *= x; +this.m12 *= x; +this.m20 *= x; +this.m21 *= x; +this.m22 *= x; +}, "~N"); +Clazz_defineMethod (c$, "transpose33", +function () { +var tmp = this.m01; +this.m01 = this.m10; +this.m10 = tmp; +tmp = this.m02; +this.m02 = this.m20; +this.m20 = tmp; +tmp = this.m12; +this.m12 = this.m21; +this.m21 = tmp; +}); +Clazz_defineMethod (c$, "setXRot", +function (angle) { +var c = Math.cos (angle); +var s = Math.sin (angle); +this.m00 = 1.0; +this.m01 = 0.0; +this.m02 = 0.0; +this.m10 = 0.0; +this.m11 = c; +this.m12 = -s; +this.m20 = 0.0; +this.m21 = s; +this.m22 = c; +}, "~N"); +Clazz_defineMethod (c$, "setYRot", +function (angle) { +var c = Math.cos (angle); +var s = Math.sin (angle); +this.m00 = c; +this.m01 = 0.0; +this.m02 = s; +this.m10 = 0.0; +this.m11 = 1.0; +this.m12 = 0.0; +this.m20 = -s; +this.m21 = 0.0; +this.m22 = c; +}, "~N"); +Clazz_defineMethod (c$, "setZRot", +function (angle) { +var c = Math.cos (angle); +var s = Math.sin (angle); +this.m00 = c; +this.m01 = -s; +this.m02 = 0.0; +this.m10 = s; +this.m11 = c; +this.m12 = 0.0; +this.m20 = 0.0; +this.m21 = 0.0; +this.m22 = 1.0; +}, "~N"); +Clazz_defineMethod (c$, "determinant3", +function () { +return this.m00 * (this.m11 * this.m22 - this.m21 * this.m12) - this.m01 * (this.m10 * this.m22 - this.m20 * this.m12) + this.m02 * (this.m10 * this.m21 - this.m20 * this.m11); +}); +Clazz_defineMethod (c$, "err", +function () { +throw new ArrayIndexOutOfBoundsException ("matrix column/row out of bounds"); +}); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["JU.M34"], "JU.M4", ["JU.T3"], function () { +c$ = Clazz_decorateAsClass (function () { +this.m03 = 0; +this.m13 = 0; +this.m23 = 0; +this.m30 = 0; +this.m31 = 0; +this.m32 = 0; +this.m33 = 0; +Clazz_instantialize (this, arguments); +}, JU, "M4", JU.M34); +c$.newA16 = Clazz_defineMethod (c$, "newA16", +function (v) { +var m = new JU.M4 (); +m.m00 = v[0]; +m.m01 = v[1]; +m.m02 = v[2]; +m.m03 = v[3]; +m.m10 = v[4]; +m.m11 = v[5]; +m.m12 = v[6]; +m.m13 = v[7]; +m.m20 = v[8]; +m.m21 = v[9]; +m.m22 = v[10]; +m.m23 = v[11]; +m.m30 = v[12]; +m.m31 = v[13]; +m.m32 = v[14]; +m.m33 = v[15]; +return m; +}, "~A"); +c$.newM4 = Clazz_defineMethod (c$, "newM4", +function (m1) { +var m = new JU.M4 (); +if (m1 == null) { +m.setIdentity (); +return m; +}m.setToM3 (m1); +m.m03 = m1.m03; +m.m13 = m1.m13; +m.m23 = m1.m23; +m.m30 = m1.m30; +m.m31 = m1.m31; +m.m32 = m1.m32; +m.m33 = m1.m33; +return m; +}, "JU.M4"); +c$.newMV = Clazz_defineMethod (c$, "newMV", +function (m1, t) { +var m = new JU.M4 (); +m.setMV (m1, t); +return m; +}, "JU.M3,JU.T3"); +Clazz_defineMethod (c$, "setZero", +function () { +this.clear33 (); +this.m03 = this.m13 = this.m23 = this.m30 = this.m31 = this.m32 = this.m33 = 0.0; +}); +Clazz_defineMethod (c$, "setIdentity", +function () { +this.setZero (); +this.m00 = this.m11 = this.m22 = this.m33 = 1.0; +}); +Clazz_defineMethod (c$, "setM4", +function (m1) { +this.setM33 (m1); +this.m03 = m1.m03; +this.m13 = m1.m13; +this.m23 = m1.m23; +this.m30 = m1.m30; +this.m31 = m1.m31; +this.m32 = m1.m32; +this.m33 = m1.m33; +return this; +}, "JU.M4"); +Clazz_defineMethod (c$, "setMV", +function (m1, t) { +this.setM33 (m1); +this.setTranslation (t); +this.m33 = 1; +}, "JU.M3,JU.T3"); +Clazz_defineMethod (c$, "setToM3", +function (m1) { +this.setM33 (m1); +this.m03 = this.m13 = this.m23 = this.m30 = this.m31 = this.m32 = 0.0; +this.m33 = 1.0; +}, "JU.M34"); +Clazz_defineMethod (c$, "setToAA", +function (a) { +this.setIdentity (); +this.setAA33 (a); +}, "JU.A4"); +Clazz_defineMethod (c$, "setA", +function (m) { +this.m00 = m[0]; +this.m01 = m[1]; +this.m02 = m[2]; +this.m03 = m[3]; +this.m10 = m[4]; +this.m11 = m[5]; +this.m12 = m[6]; +this.m13 = m[7]; +this.m20 = m[8]; +this.m21 = m[9]; +this.m22 = m[10]; +this.m23 = m[11]; +this.m30 = m[12]; +this.m31 = m[13]; +this.m32 = m[14]; +this.m33 = m[15]; +}, "~A"); +Clazz_defineMethod (c$, "setTranslation", +function (trans) { +this.m03 = trans.x; +this.m13 = trans.y; +this.m23 = trans.z; +}, "JU.T3"); +Clazz_defineMethod (c$, "setElement", +function (row, col, v) { +if (row < 3 && col < 3) { +this.set33 (row, col, v); +return; +}if (row > 3 || col > 3) this.err (); +switch (row) { +case 0: +this.m03 = v; +return; +case 1: +this.m13 = v; +return; +case 2: +this.m23 = v; +return; +} +switch (col) { +case 0: +this.m30 = v; +return; +case 1: +this.m31 = v; +return; +case 2: +this.m32 = v; +return; +case 3: +this.m33 = v; +return; +} +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "getElement", +function (row, col) { +if (row < 3 && col < 3) return this.get33 (row, col); +if (row > 3 || col > 3) { +this.err (); +return 0; +}switch (row) { +case 0: +return this.m03; +case 1: +return this.m13; +case 2: +return this.m23; +default: +switch (col) { +case 0: +return this.m30; +case 1: +return this.m31; +case 2: +return this.m32; +default: +return this.m33; +} +} +}, "~N,~N"); +Clazz_defineMethod (c$, "getTranslation", +function (trans) { +trans.x = this.m03; +trans.y = this.m13; +trans.z = this.m23; +}, "JU.T3"); +Clazz_defineMethod (c$, "getRotationScale", +function (m1) { +m1.m00 = this.m00; +m1.m01 = this.m01; +m1.m02 = this.m02; +m1.m10 = this.m10; +m1.m11 = this.m11; +m1.m12 = this.m12; +m1.m20 = this.m20; +m1.m21 = this.m21; +m1.m22 = this.m22; +}, "JU.M3"); +Clazz_defineMethod (c$, "setRotationScale", +function (m1) { +this.m00 = m1.m00; +this.m01 = m1.m01; +this.m02 = m1.m02; +this.m10 = m1.m10; +this.m11 = m1.m11; +this.m12 = m1.m12; +this.m20 = m1.m20; +this.m21 = m1.m21; +this.m22 = m1.m22; +}, "JU.M3"); +Clazz_defineMethod (c$, "setRowA", +function (row, v) { +if (row < 3) this.setRow33 (row, v); +switch (row) { +case 0: +this.m03 = v[3]; +return; +case 1: +this.m13 = v[3]; +return; +case 2: +this.m23 = v[3]; +return; +case 3: +this.m30 = v[0]; +this.m31 = v[1]; +this.m32 = v[2]; +this.m33 = v[3]; +return; +} +this.err (); +}, "~N,~A"); +Clazz_overrideMethod (c$, "getRow", +function (row, v) { +if (row < 3) this.getRow33 (row, v); +switch (row) { +case 0: +v[3] = this.m03; +return; +case 1: +v[3] = this.m13; +return; +case 2: +v[3] = this.m23; +return; +case 3: +v[0] = this.m30; +v[1] = this.m31; +v[2] = this.m32; +v[3] = this.m33; +return; +} +this.err (); +}, "~N,~A"); +Clazz_defineMethod (c$, "setColumn4", +function (column, x, y, z, w) { +if (column == 0) { +this.m00 = x; +this.m10 = y; +this.m20 = z; +this.m30 = w; +} else if (column == 1) { +this.m01 = x; +this.m11 = y; +this.m21 = z; +this.m31 = w; +} else if (column == 2) { +this.m02 = x; +this.m12 = y; +this.m22 = z; +this.m32 = w; +} else if (column == 3) { +this.m03 = x; +this.m13 = y; +this.m23 = z; +this.m33 = w; +} else { +this.err (); +}}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setColumnA", +function (column, v) { +if (column < 3) this.setColumn33 (column, v); +switch (column) { +case 0: +this.m30 = v[3]; +return; +case 1: +this.m31 = v[3]; +return; +case 2: +this.m32 = v[3]; +return; +case 3: +this.m03 = v[0]; +this.m13 = v[1]; +this.m23 = v[2]; +this.m33 = v[3]; +return; +default: +this.err (); +} +}, "~N,~A"); +Clazz_defineMethod (c$, "getColumn", +function (column, v) { +if (column < 3) this.getColumn33 (column, v); +switch (column) { +case 0: +v[3] = this.m30; +return; +case 1: +v[3] = this.m31; +return; +case 2: +v[3] = this.m32; +return; +case 3: +v[0] = this.m03; +v[1] = this.m13; +v[2] = this.m23; +v[3] = this.m33; +return; +default: +this.err (); +} +}, "~N,~A"); +Clazz_defineMethod (c$, "sub", +function (m1) { +this.sub33 (m1); +this.m03 -= m1.m03; +this.m13 -= m1.m13; +this.m23 -= m1.m23; +this.m30 -= m1.m30; +this.m31 -= m1.m31; +this.m32 -= m1.m32; +this.m33 -= m1.m33; +}, "JU.M4"); +Clazz_defineMethod (c$, "transpose", +function () { +this.transpose33 (); +var tmp = this.m03; +this.m03 = this.m30; +this.m30 = tmp; +tmp = this.m13; +this.m13 = this.m31; +this.m31 = tmp; +tmp = this.m23; +this.m23 = this.m32; +this.m32 = tmp; +}); +Clazz_defineMethod (c$, "invert", +function () { +var s = this.determinant4 (); +if (s == 0.0) return this; +s = 1 / s; +this.set (this.m11 * (this.m22 * this.m33 - this.m23 * this.m32) + this.m12 * (this.m23 * this.m31 - this.m21 * this.m33) + this.m13 * (this.m21 * this.m32 - this.m22 * this.m31), this.m21 * (this.m02 * this.m33 - this.m03 * this.m32) + this.m22 * (this.m03 * this.m31 - this.m01 * this.m33) + this.m23 * (this.m01 * this.m32 - this.m02 * this.m31), this.m31 * (this.m02 * this.m13 - this.m03 * this.m12) + this.m32 * (this.m03 * this.m11 - this.m01 * this.m13) + this.m33 * (this.m01 * this.m12 - this.m02 * this.m11), this.m01 * (this.m13 * this.m22 - this.m12 * this.m23) + this.m02 * (this.m11 * this.m23 - this.m13 * this.m21) + this.m03 * (this.m12 * this.m21 - this.m11 * this.m22), this.m12 * (this.m20 * this.m33 - this.m23 * this.m30) + this.m13 * (this.m22 * this.m30 - this.m20 * this.m32) + this.m10 * (this.m23 * this.m32 - this.m22 * this.m33), this.m22 * (this.m00 * this.m33 - this.m03 * this.m30) + this.m23 * (this.m02 * this.m30 - this.m00 * this.m32) + this.m20 * (this.m03 * this.m32 - this.m02 * this.m33), this.m32 * (this.m00 * this.m13 - this.m03 * this.m10) + this.m33 * (this.m02 * this.m10 - this.m00 * this.m12) + this.m30 * (this.m03 * this.m12 - this.m02 * this.m13), this.m02 * (this.m13 * this.m20 - this.m10 * this.m23) + this.m03 * (this.m10 * this.m22 - this.m12 * this.m20) + this.m00 * (this.m12 * this.m23 - this.m13 * this.m22), this.m13 * (this.m20 * this.m31 - this.m21 * this.m30) + this.m10 * (this.m21 * this.m33 - this.m23 * this.m31) + this.m11 * (this.m23 * this.m30 - this.m20 * this.m33), this.m23 * (this.m00 * this.m31 - this.m01 * this.m30) + this.m20 * (this.m01 * this.m33 - this.m03 * this.m31) + this.m21 * (this.m03 * this.m30 - this.m00 * this.m33), this.m33 * (this.m00 * this.m11 - this.m01 * this.m10) + this.m30 * (this.m01 * this.m13 - this.m03 * this.m11) + this.m31 * (this.m03 * this.m10 - this.m00 * this.m13), this.m03 * (this.m11 * this.m20 - this.m10 * this.m21) + this.m00 * (this.m13 * this.m21 - this.m11 * this.m23) + this.m01 * (this.m10 * this.m23 - this.m13 * this.m20), this.m10 * (this.m22 * this.m31 - this.m21 * this.m32) + this.m11 * (this.m20 * this.m32 - this.m22 * this.m30) + this.m12 * (this.m21 * this.m30 - this.m20 * this.m31), this.m20 * (this.m02 * this.m31 - this.m01 * this.m32) + this.m21 * (this.m00 * this.m32 - this.m02 * this.m30) + this.m22 * (this.m01 * this.m30 - this.m00 * this.m31), this.m30 * (this.m02 * this.m11 - this.m01 * this.m12) + this.m31 * (this.m00 * this.m12 - this.m02 * this.m10) + this.m32 * (this.m01 * this.m10 - this.m00 * this.m11), this.m00 * (this.m11 * this.m22 - this.m12 * this.m21) + this.m01 * (this.m12 * this.m20 - this.m10 * this.m22) + this.m02 * (this.m10 * this.m21 - this.m11 * this.m20)); +this.scale (s); +return this; +}); +Clazz_defineMethod (c$, "set", + function (m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { +this.m00 = m00; +this.m01 = m01; +this.m02 = m02; +this.m03 = m03; +this.m10 = m10; +this.m11 = m11; +this.m12 = m12; +this.m13 = m13; +this.m20 = m20; +this.m21 = m21; +this.m22 = m22; +this.m23 = m23; +this.m30 = m30; +this.m31 = m31; +this.m32 = m32; +this.m33 = m33; +}, "~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "determinant4", +function () { +return (this.m00 * this.m11 - this.m01 * this.m10) * (this.m22 * this.m33 - this.m23 * this.m32) - (this.m00 * this.m12 - this.m02 * this.m10) * (this.m21 * this.m33 - this.m23 * this.m31) + (this.m00 * this.m13 - this.m03 * this.m10) * (this.m21 * this.m32 - this.m22 * this.m31) + (this.m01 * this.m12 - this.m02 * this.m11) * (this.m20 * this.m33 - this.m23 * this.m30) - (this.m01 * this.m13 - this.m03 * this.m11) * (this.m20 * this.m32 - this.m22 * this.m30) + (this.m02 * this.m13 - this.m03 * this.m12) * (this.m20 * this.m31 - this.m21 * this.m30); +}); +Clazz_defineMethod (c$, "scale", + function (scalar) { +this.mul33 (scalar); +this.m03 *= scalar; +this.m13 *= scalar; +this.m23 *= scalar; +this.m30 *= scalar; +this.m31 *= scalar; +this.m32 *= scalar; +this.m33 *= scalar; +}, "~N"); +Clazz_defineMethod (c$, "mul", +function (m1) { +this.mul2 (this, m1); +}, "JU.M4"); +Clazz_defineMethod (c$, "mul2", +function (m1, m2) { +this.set (m1.m00 * m2.m00 + m1.m01 * m2.m10 + m1.m02 * m2.m20 + m1.m03 * m2.m30, m1.m00 * m2.m01 + m1.m01 * m2.m11 + m1.m02 * m2.m21 + m1.m03 * m2.m31, m1.m00 * m2.m02 + m1.m01 * m2.m12 + m1.m02 * m2.m22 + m1.m03 * m2.m32, m1.m00 * m2.m03 + m1.m01 * m2.m13 + m1.m02 * m2.m23 + m1.m03 * m2.m33, m1.m10 * m2.m00 + m1.m11 * m2.m10 + m1.m12 * m2.m20 + m1.m13 * m2.m30, m1.m10 * m2.m01 + m1.m11 * m2.m11 + m1.m12 * m2.m21 + m1.m13 * m2.m31, m1.m10 * m2.m02 + m1.m11 * m2.m12 + m1.m12 * m2.m22 + m1.m13 * m2.m32, m1.m10 * m2.m03 + m1.m11 * m2.m13 + m1.m12 * m2.m23 + m1.m13 * m2.m33, m1.m20 * m2.m00 + m1.m21 * m2.m10 + m1.m22 * m2.m20 + m1.m23 * m2.m30, m1.m20 * m2.m01 + m1.m21 * m2.m11 + m1.m22 * m2.m21 + m1.m23 * m2.m31, m1.m20 * m2.m02 + m1.m21 * m2.m12 + m1.m22 * m2.m22 + m1.m23 * m2.m32, m1.m20 * m2.m03 + m1.m21 * m2.m13 + m1.m22 * m2.m23 + m1.m23 * m2.m33, m1.m30 * m2.m00 + m1.m31 * m2.m10 + m1.m32 * m2.m20 + m1.m33 * m2.m30, m1.m30 * m2.m01 + m1.m31 * m2.m11 + m1.m32 * m2.m21 + m1.m33 * m2.m31, m1.m30 * m2.m02 + m1.m31 * m2.m12 + m1.m32 * m2.m22 + m1.m33 * m2.m32, m1.m30 * m2.m03 + m1.m31 * m2.m13 + m1.m32 * m2.m23 + m1.m33 * m2.m33); +}, "JU.M4,JU.M4"); +Clazz_defineMethod (c$, "transform", +function (vec) { +this.transform2 (vec, vec); +}, "JU.T4"); +Clazz_defineMethod (c$, "transform2", +function (vec, vecOut) { +vecOut.set4 (this.m00 * vec.x + this.m01 * vec.y + this.m02 * vec.z + this.m03 * vec.w, this.m10 * vec.x + this.m11 * vec.y + this.m12 * vec.z + this.m13 * vec.w, this.m20 * vec.x + this.m21 * vec.y + this.m22 * vec.z + this.m23 * vec.w, this.m30 * vec.x + this.m31 * vec.y + this.m32 * vec.z + this.m33 * vec.w); +}, "JU.T4,JU.T4"); +Clazz_defineMethod (c$, "rotTrans", +function (point) { +this.rotTrans2 (point, point); +}, "JU.T3"); +Clazz_defineMethod (c$, "rotTrans2", +function (point, pointOut) { +pointOut.set (this.m00 * point.x + this.m01 * point.y + this.m02 * point.z + this.m03, this.m10 * point.x + this.m11 * point.y + this.m12 * point.z + this.m13, this.m20 * point.x + this.m21 * point.y + this.m22 * point.z + this.m23); +return pointOut; +}, "JU.T3,JU.T3"); +Clazz_defineMethod (c$, "setAsXYRotation", +function (angle) { +this.setIdentity (); +var c = Math.cos (angle); +var s = Math.sin (angle); +this.m22 = c; +this.m23 = -s; +this.m32 = s; +this.m33 = c; +return this; +}, "~N"); +Clazz_defineMethod (c$, "setAsYZRotation", +function (angle) { +this.setIdentity (); +var c = Math.cos (angle); +var s = Math.sin (angle); +this.m00 = c; +this.m03 = -s; +this.m30 = s; +this.m33 = c; +return this; +}, "~N"); +Clazz_defineMethod (c$, "setAsXZRotation", +function (angle) { +this.setIdentity (); +var c = Math.cos (angle); +var s = Math.sin (angle); +this.m11 = c; +this.m13 = -s; +this.m31 = s; +this.m33 = c; +return this; +}, "~N"); +Clazz_overrideMethod (c$, "equals", +function (o) { +if (!(Clazz_instanceOf (o, JU.M4))) return false; +var m = o; +return (this.m00 == m.m00 && this.m01 == m.m01 && this.m02 == m.m02 && this.m03 == m.m03 && this.m10 == m.m10 && this.m11 == m.m11 && this.m12 == m.m12 && this.m13 == m.m13 && this.m20 == m.m20 && this.m21 == m.m21 && this.m22 == m.m22 && this.m23 == m.m23 && this.m30 == m.m30 && this.m31 == m.m31 && this.m32 == m.m32 && this.m33 == m.m33); +}, "~O"); +Clazz_overrideMethod (c$, "hashCode", +function () { +return JU.T3.floatToIntBits0 (this.m00) ^ JU.T3.floatToIntBits0 (this.m01) ^ JU.T3.floatToIntBits0 (this.m02) ^ JU.T3.floatToIntBits0 (this.m03) ^ JU.T3.floatToIntBits0 (this.m10) ^ JU.T3.floatToIntBits0 (this.m11) ^ JU.T3.floatToIntBits0 (this.m12) ^ JU.T3.floatToIntBits0 (this.m13) ^ JU.T3.floatToIntBits0 (this.m20) ^ JU.T3.floatToIntBits0 (this.m21) ^ JU.T3.floatToIntBits0 (this.m22) ^ JU.T3.floatToIntBits0 (this.m23) ^ JU.T3.floatToIntBits0 (this.m30) ^ JU.T3.floatToIntBits0 (this.m31) ^ JU.T3.floatToIntBits0 (this.m32) ^ JU.T3.floatToIntBits0 (this.m33); +}); +Clazz_overrideMethod (c$, "toString", +function () { +return "[\n [" + this.m00 + "\t" + this.m01 + "\t" + this.m02 + "\t" + this.m03 + "]" + "\n [" + this.m10 + "\t" + this.m11 + "\t" + this.m12 + "\t" + this.m13 + "]" + "\n [" + this.m20 + "\t" + this.m21 + "\t" + this.m22 + "\t" + this.m23 + "]" + "\n [" + this.m30 + "\t" + this.m31 + "\t" + this.m32 + "\t" + this.m33 + "] ]"; +}); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["javajs.api.JSONEncodable"], "JU.T3", ["java.lang.Float"], function () { +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.z = 0; +Clazz_instantialize (this, arguments); +}, JU, "T3", null, [javajs.api.JSONEncodable, java.io.Serializable]); +Clazz_defineMethod (c$, "set", +function (x, y, z) { +this.x = x; +this.y = y; +this.z = z; +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "setA", +function (t) { +this.x = t[0]; +this.y = t[1]; +this.z = t[2]; +}, "~A"); +Clazz_defineMethod (c$, "setT", +function (t1) { +this.x = t1.x; +this.y = t1.y; +this.z = t1.z; +}, "JU.T3"); +Clazz_defineMethod (c$, "add2", +function (t1, t2) { +this.x = t1.x + t2.x; +this.y = t1.y + t2.y; +this.z = t1.z + t2.z; +}, "JU.T3,JU.T3"); +Clazz_defineMethod (c$, "add", +function (t1) { +this.x += t1.x; +this.y += t1.y; +this.z += t1.z; +}, "JU.T3"); +Clazz_defineMethod (c$, "distanceSquared", +function (p1) { +var dx = this.x - p1.x; +var dy = this.y - p1.y; +var dz = this.z - p1.z; +return (dx * dx + dy * dy + dz * dz); +}, "JU.T3"); +Clazz_defineMethod (c$, "distance", +function (p1) { +return Math.sqrt (this.distanceSquared (p1)); +}, "JU.T3"); +Clazz_defineMethod (c$, "sub2", +function (t1, t2) { +this.x = t1.x - t2.x; +this.y = t1.y - t2.y; +this.z = t1.z - t2.z; +}, "JU.T3,JU.T3"); +Clazz_defineMethod (c$, "sub", +function (t1) { +this.x -= t1.x; +this.y -= t1.y; +this.z -= t1.z; +}, "JU.T3"); +Clazz_defineMethod (c$, "scale", +function (s) { +this.x *= s; +this.y *= s; +this.z *= s; +}, "~N"); +Clazz_defineMethod (c$, "add3", +function (a, b, c) { +this.x += a; +this.y += b; +this.z += c; +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "scaleT", +function (p) { +this.x *= p.x; +this.y *= p.y; +this.z *= p.z; +}, "JU.T3"); +Clazz_defineMethod (c$, "scaleAdd2", +function (s, t1, t2) { +this.x = s * t1.x + t2.x; +this.y = s * t1.y + t2.y; +this.z = s * t1.z + t2.z; +}, "~N,JU.T3,JU.T3"); +Clazz_defineMethod (c$, "ave", +function (a, b) { +this.x = (a.x + b.x) / 2; +this.y = (a.y + b.y) / 2; +this.z = (a.z + b.z) / 2; +}, "JU.T3,JU.T3"); +Clazz_defineMethod (c$, "dot", +function (v) { +return this.x * v.x + this.y * v.y + this.z * v.z; +}, "JU.T3"); +Clazz_defineMethod (c$, "lengthSquared", +function () { +return this.x * this.x + this.y * this.y + this.z * this.z; +}); +Clazz_defineMethod (c$, "length", +function () { +return Math.sqrt (this.lengthSquared ()); +}); +Clazz_defineMethod (c$, "normalize", +function () { +var d = this.length (); +this.x /= d; +this.y /= d; +this.z /= d; +}); +Clazz_defineMethod (c$, "cross", +function (v1, v2) { +this.set (v1.y * v2.z - v1.z * v2.y, v1.z * v2.x - v1.x * v2.z, v1.x * v2.y - v1.y * v2.x); +}, "JU.T3,JU.T3"); +Clazz_overrideMethod (c$, "hashCode", +function () { +var bits = 1; +bits = 31 * bits + JU.T3.floatToIntBits0 (this.x); +bits = 31 * bits + JU.T3.floatToIntBits0 (this.y); +bits = 31 * bits + JU.T3.floatToIntBits0 (this.z); +return (bits ^ (bits >> 32)); +}); +c$.floatToIntBits0 = Clazz_defineMethod (c$, "floatToIntBits0", +function (f) { +return (f == 0 ? 0 : Float.floatToIntBits (f)); +}, "~N"); +Clazz_overrideMethod (c$, "equals", +function (t1) { +if (!(Clazz_instanceOf (t1, JU.T3))) return false; +var t2 = t1; +return (this.x == t2.x && this.y == t2.y && this.z == t2.z); +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +return "{" + this.x + ", " + this.y + ", " + this.z + "}"; +}); +Clazz_overrideMethod (c$, "toJSON", +function () { +return "[" + this.x + "," + this.y + "," + this.z + "]"; +}); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.LayoutManager2", "javax.swing.AbstractAction", "$.JComponent"], "javax.swing.JRootPane", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.BorderLayout", "$.Dimension", "$.IllegalComponentStateException", "javax.swing.JLayeredPane", "$.JPanel", "$.SwingUtilities", "$.UIManager", "jssun.awt.AppContext"], function () { +c$ = Clazz_decorateAsClass (function () { +this.windowDecorationStyle = 0; +this.menuBar = null; +this.contentPane = null; +this.layeredPane = null; +this.glassPane = null; +this.defaultButton = null; +this.defaultPressAction = null; +this.defaultReleaseAction = null; +this.useTrueDoubleBuffering = true; +if (!Clazz_isClassDefined ("javax.swing.JRootPane.RootLayout")) { +javax.swing.JRootPane.$JRootPane$RootLayout$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "JRootPane", javax.swing.JComponent); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JRootPane, []); +var appletName = jssun.awt.AppContext.getAppContext ().getThreadGroup ().getName (); +this.setName (appletName + ".JRootPane"); +this.setGlassPane (this.createGlassPane ()); +this.setLayeredPane (this.createLayeredPane ()); +this.setContentPane (this.createContentPane ()); +this.setLayout (this.createRootLayout ()); +this.updateUI (); +}); +Clazz_overrideMethod (c$, "setDoubleBuffered", +function (aFlag) { +}, "~B"); +Clazz_defineMethod (c$, "getWindowDecorationStyle", +function () { +return this.windowDecorationStyle; +}); +Clazz_defineMethod (c$, "setWindowDecorationStyle", +function (windowDecorationStyle) { +if (windowDecorationStyle < 0 || windowDecorationStyle > 8) { +throw new IllegalArgumentException ("Invalid decoration style"); +}var oldWindowDecorationStyle = this.getWindowDecorationStyle (); +this.windowDecorationStyle = windowDecorationStyle; +this.firePropertyChangeInt ("windowDecorationStyle", oldWindowDecorationStyle, windowDecorationStyle); +}, "~N"); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "RootPaneUI"; +}); +Clazz_defineMethod (c$, "createLayeredPane", +function () { +var p = new javax.swing.JLayeredPane (); +p.setName (this.getName () + ".layeredPane"); +return p; +}); +Clazz_defineMethod (c$, "createContentPane", +function () { +var c = new javax.swing.JPanel (); +c.setName (this.getName () + ".contentPane"); +c.setLayout (((Clazz_isClassDefined ("javax.swing.JRootPane$1") ? 0 : javax.swing.JRootPane.$JRootPane$1$ ()), Clazz_innerTypeInstance (javax.swing.JRootPane$1, this, null))); +return c; +}); +Clazz_defineMethod (c$, "createGlassPane", +function () { +var c = new javax.swing.JPanel (); +c.setName (this.getName () + ".glassPane"); +c.setVisible (false); +(c).setOpaque (false); +return c; +}); +Clazz_defineMethod (c$, "createRootLayout", +function () { +return Clazz_innerTypeInstance (javax.swing.JRootPane.RootLayout, this, null); +}); +Clazz_defineMethod (c$, "setJMenuBar", +function (menu) { +if (this.menuBar != null && this.menuBar.getParent () === this.layeredPane) this.layeredPane.remove (this.menuBar); +this.menuBar = menu; +if (this.menuBar != null) this.layeredPane.add (this.menuBar, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER); +}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "setMenuBar", +function (menu) { +if (this.menuBar != null && this.menuBar.getParent () === this.layeredPane) this.layeredPane.remove (this.menuBar); +this.menuBar = menu; +if (this.menuBar != null) this.layeredPane.add (this.menuBar, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER); +}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "getJMenuBar", +function () { +return this.menuBar; +}); +Clazz_defineMethod (c$, "getMenuBar", +function () { +return this.menuBar; +}); +Clazz_defineMethod (c$, "setContentPane", +function (content) { +if (content == null) throw new java.awt.IllegalComponentStateException ("contentPane cannot be set to null."); +if (this.contentPane != null && this.contentPane.getParent () === this.layeredPane) this.layeredPane.remove (this.contentPane); +this.contentPane = content; +this.layeredPane.add (this.contentPane, javax.swing.JLayeredPane.FRAME_CONTENT_LAYER); +}, "java.awt.Container"); +Clazz_defineMethod (c$, "getContentPane", +function () { +return this.contentPane; +}); +Clazz_defineMethod (c$, "setLayeredPane", +function (layered) { +if (layered == null) throw new java.awt.IllegalComponentStateException ("layeredPane cannot be set to null."); +if (this.layeredPane != null && this.layeredPane.getParent () === this) this.remove (this.layeredPane); +this.layeredPane = layered; +this.add (this.layeredPane, -1); +}, "javax.swing.JLayeredPane"); +Clazz_defineMethod (c$, "getLayeredPane", +function () { +return this.layeredPane; +}); +Clazz_defineMethod (c$, "setGlassPane", +function (glass) { +if (glass == null) { +throw new NullPointerException ("glassPane cannot be set to null."); +}var visible = false; +if (this.glassPane != null && this.glassPane.getParent () === this) { +this.remove (this.glassPane); +visible = this.glassPane.isVisible (); +}glass.setVisible (visible); +this.glassPane = glass; +this.add (this.glassPane, 0); +if (visible) { +this.repaint (); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "getGlassPane", +function () { +return this.glassPane; +}); +Clazz_overrideMethod (c$, "isValidateRoot", +function () { +return true; +}); +Clazz_overrideMethod (c$, "isOptimizedDrawingEnabled", +function () { +return !this.glassPane.isVisible (); +}); +Clazz_defineMethod (c$, "addNotify", +function () { +Clazz_superCall (this, javax.swing.JRootPane, "addNotify", []); +this.enableEvents (8); +}); +Clazz_defineMethod (c$, "setDefaultButton", +function (defaultButton) { +var oldDefault = this.defaultButton; +if (oldDefault !== defaultButton) { +this.defaultButton = defaultButton; +if (oldDefault != null) { +oldDefault.repaint (); +}if (defaultButton != null) { +defaultButton.repaint (); +}}this.firePropertyChangeObject ("defaultButton", oldDefault, defaultButton); +}, "javax.swing.JButton"); +Clazz_defineMethod (c$, "getDefaultButton", +function () { +return this.defaultButton; +}); +Clazz_defineMethod (c$, "setUseTrueDoubleBuffering", +function (useTrueDoubleBuffering) { +this.useTrueDoubleBuffering = useTrueDoubleBuffering; +}, "~B"); +Clazz_defineMethod (c$, "getUseTrueDoubleBuffering", +function () { +return this.useTrueDoubleBuffering; +}); +Clazz_defineMethod (c$, "disableTrueDoubleBuffering", +function () { +}); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +this.addImplSAEM (comp, constraints, index); +if (this.glassPane != null && this.glassPane.getParent () === this && this.getComponent (0) !== this.glassPane) { +this.add (this.glassPane, 0); +}return comp; +}, "java.awt.Component,~O,~N"); +c$.$JRootPane$RootLayout$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, javax.swing.JRootPane, "RootLayout", null, java.awt.LayoutManager2); +Clazz_overrideMethod (c$, "preferredLayoutSize", +function (a) { +var b; +var c; +var d = this.b$["javax.swing.JRootPane"].getInsets (); +if (this.b$["javax.swing.JRootPane"].contentPane != null) { +b = this.b$["javax.swing.JRootPane"].contentPane.getPreferredSize (); +} else { +b = a.getSize (); +}if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { +c = this.b$["javax.swing.JRootPane"].menuBar.getPreferredSize (); +} else { +c = new java.awt.Dimension (0, 0); +}return new java.awt.Dimension (Math.max (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "minimumLayoutSize", +function (a) { +var b; +var c; +var d = this.b$["javax.swing.JRootPane"].getInsets (); +if (this.b$["javax.swing.JRootPane"].contentPane != null) { +b = this.b$["javax.swing.JRootPane"].contentPane.getMinimumSize (); +} else { +b = a.getSize (); +}if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { +c = this.b$["javax.swing.JRootPane"].menuBar.getMinimumSize (); +} else { +c = new java.awt.Dimension (0, 0); +}return new java.awt.Dimension (Math.max (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "maximumLayoutSize", +function (a) { +var b; +var c; +var d = this.b$["javax.swing.JRootPane"].getInsets (); +if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { +c = this.b$["javax.swing.JRootPane"].menuBar.getMaximumSize (); +} else { +c = new java.awt.Dimension (0, 0); +}if (this.b$["javax.swing.JRootPane"].contentPane != null) { +b = this.b$["javax.swing.JRootPane"].contentPane.getMaximumSize (); +} else { +b = new java.awt.Dimension (2147483647, 2147483647 - d.top - d.bottom - c.height - 1); +}return new java.awt.Dimension (Math.min (b.width, c.width) + d.left + d.right, b.height + c.height + d.top + d.bottom); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "layoutContainer", +function (a) { +var b = a.getBounds (); +var c = this.b$["javax.swing.JRootPane"].getInsets (); +var d = 0; +var e = b.width - c.right - c.left; +var f = b.height - c.top - c.bottom; +if (this.b$["javax.swing.JRootPane"].layeredPane != null) { +this.b$["javax.swing.JRootPane"].layeredPane.setBounds (c.left, c.top, e, f); +}if (this.b$["javax.swing.JRootPane"].glassPane != null) { +this.b$["javax.swing.JRootPane"].glassPane.setBounds (c.left, c.top, e, f); +}if (this.b$["javax.swing.JRootPane"].menuBar != null && this.b$["javax.swing.JRootPane"].menuBar.isVisible ()) { +var g = this.b$["javax.swing.JRootPane"].menuBar.getPreferredSize (); +this.b$["javax.swing.JRootPane"].menuBar.setBounds (0, 0, e, g.height); +d += g.height; +}if (this.b$["javax.swing.JRootPane"].contentPane != null) { +this.b$["javax.swing.JRootPane"].contentPane.setBounds (0, d, e, f - d); +}}, "java.awt.Container"); +Clazz_defineMethod (c$, "addLayoutComponent", +function (a, b) { +}, "~S,java.awt.Component"); +Clazz_overrideMethod (c$, "removeLayoutComponent", +function (a) { +}, "java.awt.Component"); +Clazz_defineMethod (c$, "addLayoutComponent", +function (a, b) { +}, "java.awt.Component,~O"); +Clazz_overrideMethod (c$, "getLayoutAlignmentX", +function (a) { +return 0.0; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayoutAlignmentY", +function (a) { +return 0.0; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "invalidateLayout", +function (a) { +}, "java.awt.Container"); +c$ = Clazz_p0p (); +}; +c$.$JRootPane$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing, "JRootPane$1", java.awt.BorderLayout); +Clazz_defineMethod (c$, "addLayoutComponent", +function (comp, constraints) { +if (constraints == null) { +constraints = "Center"; +}Clazz_superCall (this, javax.swing.JRootPane$1, "addLayoutComponent", [comp, constraints]); +}, "java.awt.Component,~O"); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.owner = null; +this.root = null; +this.press = false; +Clazz_instantialize (this, arguments); +}, javax.swing.JRootPane, "DefaultAction", javax.swing.AbstractAction); +Clazz_makeConstructor (c$, +function (a, b) { +Clazz_superConstructor (this, javax.swing.JRootPane.DefaultAction, []); +this.root = a; +this.press = b; +}, "javax.swing.JRootPane,~B"); +Clazz_defineMethod (c$, "setOwner", +function (a) { +this.owner = a; +}, "javax.swing.JButton"); +Clazz_overrideMethod (c$, "actionPerformed", +function (a) { +if (this.owner != null && javax.swing.SwingUtilities.getRootPane (this.owner) === this.root) { +var b = this.owner.getModel (); +if (this.press) { +b.setArmed (true); +b.setPressed (true); +} else { +b.setPressed (false); +}}}, "java.awt.event.ActionEvent"); +Clazz_overrideMethod (c$, "isEnabled", +function () { +return this.owner.getModel ().isEnabled (); +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"$uiClassID", "RootPaneUI", +"NONE", 0, +"FRAME", 1, +"PLAIN_DIALOG", 2, +"INFORMATION_DIALOG", 3, +"ERROR_DIALOG", 4, +"COLOR_CHOOSER_DIALOG", 5, +"FILE_CHOOSER_DIALOG", 6, +"QUESTION_DIALOG", 7, +"WARNING_DIALOG", 8); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.AbstractButton", "$.DefaultButtonModel"], "javax.swing.JToggleButton", ["java.awt.EventQueue", "java.awt.event.ActionEvent", "$.InputEvent", "$.ItemEvent", "javax.swing.UIManager"], function () { +c$ = Clazz_declareType (javax.swing, "JToggleButton", javax.swing.AbstractButton); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, false); +}); +Clazz_makeConstructor (c$, +function (icon) { +this.construct (null, icon, false); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (icon, selected) { +this.construct (null, icon, selected); +}, "javax.swing.Icon,~B"); +Clazz_makeConstructor (c$, +function (text) { +this.construct (text, null, false); +}, "~S"); +Clazz_makeConstructor (c$, +function (text, selected) { +this.construct (text, null, selected); +}, "~S,~B"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (text, icon) { +this.construct (text, icon, false); +}, "~S,javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text, icon, selected) { +Clazz_superConstructor (this, javax.swing.JToggleButton, []); +this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ()); +this.model.setSelected (selected); +this.init (text, icon); +}, "~S,javax.swing.Icon,~B"); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "ToggleButtonUI"; +}); +Clazz_overrideMethod (c$, "shouldUpdateSelectedStateFromAction", +function () { +return true; +}); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.JToggleButton, "ToggleButtonModel", javax.swing.DefaultButtonModel); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JToggleButton.ToggleButtonModel, []); +}); +Clazz_overrideMethod (c$, "isSelected", +function () { +return (this.stateMask & 2) != 0; +}); +Clazz_overrideMethod (c$, "setSelected", +function (a) { +var b = this.getGroup (); +if (b != null) { +b.setSelected (this, a); +a = b.isSelected (this); +}if (this.isSelected () == a) { +return; +}if (a) { +this.stateMask |= 2; +} else { +this.stateMask &= -3; +}this.fireStateChanged (); +this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this, this.isSelected () ? 1 : 2)); +}, "~B"); +Clazz_overrideMethod (c$, "setPressed", +function (a) { +if ((this.isPressed () == a) || !this.isEnabled ()) { +return; +}if (a == false && this.isArmed ()) { +this.setSelected (!this.isSelected ()); +}if (a) { +this.stateMask |= 4; +} else { +this.stateMask &= -5; +}this.fireStateChanged (); +if (!this.isPressed () && this.isArmed ()) { +var b = 0; +var c = java.awt.EventQueue.getCurrentEvent (); +if (Clazz_instanceOf (c, java.awt.event.InputEvent)) { +b = (c).getModifiers (); +} else if (Clazz_instanceOf (c, java.awt.event.ActionEvent)) { +b = (c).getModifiers (); +}this.fireActionPerformed ( new java.awt.event.ActionEvent (this, 1001, this.getActionCommand (), java.awt.EventQueue.getMostRecentEventTime (), b)); +}}, "~B"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"$uiClassID", "ToggleButtonUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.ItemSelectable"], "javax.swing.ButtonModel", null, function () { +Clazz_declareInterface (javax.swing, "ButtonModel", java.awt.ItemSelectable); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JToggleButton"], "javax.swing.JRadioButton", ["javax.swing.UIManager"], function () { +c$ = Clazz_declareType (javax.swing, "JRadioButton", javax.swing.JToggleButton); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, false); +}); +Clazz_makeConstructor (c$, +function (icon) { +this.construct (null, icon, false); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (icon, selected) { +this.construct (null, icon, selected); +}, "javax.swing.Icon,~B"); +Clazz_makeConstructor (c$, +function (text) { +this.construct (text, null, false); +}, "~S"); +Clazz_makeConstructor (c$, +function (text, selected) { +this.construct (text, null, selected); +}, "~S,~B"); +Clazz_makeConstructor (c$, +function (text, icon) { +this.construct (text, icon, false); +}, "~S,javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text, icon, selected) { +Clazz_superConstructor (this, javax.swing.JRadioButton, [text, icon, selected]); +this.setBorderPainted (false); +this.setHorizontalAlignment (10); +}, "~S,javax.swing.Icon,~B"); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "RadioButtonUI"; +}); +Clazz_overrideMethod (c$, "setIconFromAction", +function (a) { +}, "javax.swing.Action"); +Clazz_defineStatics (c$, +"$$uiClassID", "RadioButtonUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.applet.Applet", "javax.swing.RootPaneContainer"], "javax.swing.JApplet", ["java.awt.BorderLayout", "$.Color", "javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities"], function () { +c$ = Clazz_decorateAsClass (function () { +this.rootPane = null; +this.rootPaneCheckingEnabled = false; +this.transferHandler = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JApplet", java.applet.Applet, javax.swing.RootPaneContainer); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JApplet, []); +this.setJApplet (); +}); +Clazz_defineMethod (c$, "setJApplet", + function () { +this.setPanel (); +this.setForeground (java.awt.Color.black); +this.setBackground (java.awt.Color.white); +this.setLocale (javax.swing.JComponent.getDefaultLocale ()); +this.setLayout ( new java.awt.BorderLayout ()); +this.setRootPane (this.createRootPane ()); +this.setRootPaneCheckingEnabled (true); +this.setFocusTraversalPolicyProvider (true); +this.enableEvents (8); +}); +Clazz_defineMethod (c$, "createRootPane", +function () { +var rp = new javax.swing.JRootPane (); +rp.setOpaque (true); +return rp; +}); +Clazz_defineMethod (c$, "setTransferHandler", +function (newHandler) { +var oldHandler = this.transferHandler; +this.transferHandler = newHandler; +javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); +this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); +}, "javax.swing.TransferHandler"); +Clazz_defineMethod (c$, "getTransferHandler", +function () { +return this.transferHandler; +}); +Clazz_defineMethod (c$, "paint", +function (g) { +this.getContentPane ().paint (g); +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "setJMenuBar", +function (menuBar) { +this.getRootPane ().setMenuBar (menuBar); +}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "getJMenuBar", +function () { +return this.getRootPane ().getMenuBar (); +}); +Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", +function () { +return this.rootPaneCheckingEnabled; +}); +Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", +function (enabled) { +this.rootPaneCheckingEnabled = enabled; +}, "~B"); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +if (this.isRootPaneCheckingEnabled ()) { +return this.getContentPane ().add (comp, constraints, index); +}return this.addImplSAEM (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "remove", +function (comp) { +if (comp === this.rootPane) { +this.removeChild (comp); +} else { +this.getContentPane ().removeChild (comp); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "setLayout", +function (manager) { +if (this.isRootPaneCheckingEnabled ()) { +this.getContentPane ().setLayout (manager); +} else { +Clazz_superCall (this, javax.swing.JApplet, "setLayout", [manager]); +}}, "java.awt.LayoutManager"); +Clazz_overrideMethod (c$, "getRootPane", +function () { +return this.rootPane; +}); +Clazz_defineMethod (c$, "setRootPane", +function (root) { +if (this.rootPane != null) { +this.remove (this.rootPane); +}this.rootPane = root; +if (this.rootPane != null) { +var checkingEnabled = this.isRootPaneCheckingEnabled (); +try { +this.setRootPaneCheckingEnabled (false); +this.add (this.rootPane, "Center"); +} finally { +this.setRootPaneCheckingEnabled (checkingEnabled); +} +}}, "javax.swing.JRootPane"); +Clazz_overrideMethod (c$, "getContentPane", +function () { +return this.getRootPane ().getContentPane (); +}); +Clazz_overrideMethod (c$, "setContentPane", +function (contentPane) { +this.getRootPane ().setContentPane (contentPane); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayeredPane", +function () { +return this.getRootPane ().getLayeredPane (); +}); +Clazz_overrideMethod (c$, "setLayeredPane", +function (layeredPane) { +this.getRootPane ().setLayeredPane (layeredPane); +}, "javax.swing.JLayeredPane"); +Clazz_overrideMethod (c$, "getGlassPane", +function () { +return this.getRootPane ().getGlassPane (); +}); +Clazz_overrideMethod (c$, "setGlassPane", +function (glassPane) { +this.getRootPane ().setGlassPane (glassPane); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getGraphics", +function () { +javax.swing.JComponent.getGraphicsInvoked (this); +return Clazz_superCall (this, javax.swing.JApplet, "getGraphics", []); +}); +Clazz_defineMethod (c$, "repaint", +function (time, x, y, width, height) { +if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { +System.out.println ("repaintNow " + this); +javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); +} else { +Clazz_superCall (this, javax.swing.JApplet, "repaint", [time, x, y, width, height]); +}}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "repaintNow", +function () { +this.repaint (100, 0, 0, this.getWidth (), this.getHeight ()); +}); +Clazz_defineMethod (c$, "paramString", +function () { +var rootPaneString = (this.rootPane != null ? this.rootPane.toString () : ""); +var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JApplet, "paramString", []) + ",rootPane=" + rootPaneString + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.lang.Thread"], ["java.awt.EventQueueItem", "$.EventQueue", "$.Queue"], ["java.lang.Error", "java.lang.reflect.InvocationTargetException", "java.util.EmptyStackException", "java.awt.ActiveEvent", "$.Component", "$.EventDispatchThread", "$.SentEvent", "$.SequencedEvent", "$.Toolkit", "java.awt.event.ActionEvent", "$.FocusEvent", "$.InputEvent", "$.InputMethodEvent", "$.InvocationEvent", "$.KeyEvent", "$.MouseEvent", "$.PaintEvent", "$.WindowEvent", "jssun.awt.AWTAutoShutdown", "$.AppContext", "$.PeerEvent", "$.SunToolkit", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.queues = null; +this.nextQueue = null; +this.previousQueue = null; +this.dispatchThread = null; +this.threadGroup = null; +this.mostRecentEventTime = 0; +this.currentEvent = null; +this.waitForID = 0; +this.name = null; +Clazz_instantialize (this, arguments); +}, java.awt, "EventQueue"); +Clazz_prepareFields (c$, function () { +this.queues = new Array (4); +this.threadGroup = Thread.currentThread ().getThreadGroup (); +this.mostRecentEventTime = System.currentTimeMillis (); +this.name = "AWT-EventQueue-" + java.awt.EventQueue.nextThreadNum (); +}); +c$.nextThreadNum = Clazz_defineMethod (c$, "nextThreadNum", + function () { +return java.awt.EventQueue.threadInitNumber++; +}); +c$.noEvents = Clazz_defineMethod (c$, "noEvents", +function (eventQueue) { +return eventQueue.noEvents (); +}, "java.awt.EventQueue"); +c$.getNextQueue = Clazz_defineMethod (c$, "getNextQueue", +function (eventQueue) { +return eventQueue.nextQueue; +}, "java.awt.EventQueue"); +c$.removeSourceEvents = Clazz_defineMethod (c$, "removeSourceEvents", +function (eventQueue, source, removeAllEvents) { +eventQueue.removeSourceEvents (source, removeAllEvents); +}, "java.awt.EventQueue,~O,~B"); +Clazz_makeConstructor (c$, +function () { +for (var i = 0; i < 4; i++) { +this.queues[i] = new java.awt.Queue (); +} +}); +Clazz_defineMethod (c$, "postEvent", +function (event) { +jssun.awt.SunToolkit.flushPendingEvents (); +this.postEventPrivate (event); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "postEventPrivate", +function (theEvent) { +theEvent.isPosted = true; +{ +if (this.dispatchThread == null && this.nextQueue == null) { +if (theEvent.getSource () === jssun.awt.AWTAutoShutdown.getInstance ()) { +return; +} else { +this.initDispatchThread (); +}}if (this.nextQueue != null) { +this.nextQueue.postEventPrivate (theEvent); +return; +}this.postEventNow (theEvent, java.awt.EventQueue.getPriority (theEvent)); +}}, "java.awt.AWTEvent"); +c$.getPriority = Clazz_defineMethod (c$, "getPriority", + function (theEvent) { +if (Clazz_instanceOf (theEvent, jssun.awt.PeerEvent)) { +var flags = (theEvent).getFlags (); +if ((flags & 2) != 0) return 3; +if ((flags & 1) != 0) return 2; +if ((flags & 4) != 0) return 0; +}switch (theEvent.getID ()) { +case 1201: +case 800: +case 801: +return 0; +default: +return 1; +} +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "postEventNow", + function (theEvent, priority) { +if (this.coalesceEvent (theEvent, priority)) { +return; +}var newItem = new java.awt.EventQueueItem (theEvent); +this.cacheEQItem (newItem); +if (this.queues[priority].head == null) { +var shouldNotify = this.noEvents (); +this.queues[priority].head = this.queues[priority].tail = newItem; +if (shouldNotify) { +if (theEvent.getSource () !== jssun.awt.AWTAutoShutdown.getInstance ()) { +jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadBusy (this.dispatchThread); +}}} else { +this.queues[priority].tail.next = newItem; +this.queues[priority].tail = newItem; +}}, "java.awt.AWTEvent,~N"); +Clazz_defineMethod (c$, "coalescePaintEvent", + function (e) { +var sourcePeer = (e.getSource ()).peer; +if (sourcePeer != null) { +sourcePeer.coalescePaintEvent (e); +}var cache = (e.getSource ()).eventCache; +if (cache == null) { +return false; +}var index = java.awt.EventQueue.eventToCacheIndex (e); +if (index != -1 && cache[index] != null) { +var merged = this.mergePaintEvents (e, cache[index].event); +if (merged != null) { +cache[index].event = merged; +return true; +}}return false; +}, "java.awt.event.PaintEvent"); +Clazz_defineMethod (c$, "mergePaintEvents", + function (a, b) { +var aRect = a.getUpdateRect (); +var bRect = b.getUpdateRect (); +if (bRect.contains (aRect)) { +return b; +}if (aRect.contains (bRect)) { +return a; +}return null; +}, "java.awt.event.PaintEvent,java.awt.event.PaintEvent"); +Clazz_defineMethod (c$, "coalesceMouseEvent", + function (e) { +var cache = (e.getSource ()).eventCache; +if (cache == null) { +return false; +}var index = java.awt.EventQueue.eventToCacheIndex (e); +if (index != -1 && cache[index] != null) { +cache[index].event = e; +return true; +}return false; +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "coalescePeerEvent", + function (e) { +var cache = (e.getSource ()).eventCache; +if (cache == null) { +return false; +}var index = java.awt.EventQueue.eventToCacheIndex (e); +if (index != -1 && cache[index] != null) { +e = e.coalesceEvents (cache[index].event); +if (e != null) { +cache[index].event = e; +return true; +} else { +cache[index] = null; +}}return false; +}, "jssun.awt.PeerEvent"); +Clazz_defineMethod (c$, "coalesceOtherEvent", + function (e, priority) { +var id = e.getID (); +var source = e.getSource (); +for (var entry = this.queues[priority].head; entry != null; entry = entry.next) { +if (entry.event.getSource () === source && entry.id == id) { +var coalescedEvent = source.coalesceEvents (entry.event, e); +if (coalescedEvent != null) { +entry.event = coalescedEvent; +return true; +}}} +return false; +}, "java.awt.AWTEvent,~N"); +Clazz_defineMethod (c$, "coalesceEvent", + function (e, priority) { +if (!(Clazz_instanceOf (e.getSource (), java.awt.Component))) { +return false; +}if (Clazz_instanceOf (e, jssun.awt.PeerEvent)) { +return this.coalescePeerEvent (e); +}if ((e.getSource ()).isCoalescingEnabled () && this.coalesceOtherEvent (e, priority)) { +return true; +}if (Clazz_instanceOf (e, java.awt.event.PaintEvent)) { +return this.coalescePaintEvent (e); +}if (Clazz_instanceOf (e, java.awt.event.MouseEvent)) { +return this.coalesceMouseEvent (e); +}return false; +}, "java.awt.AWTEvent,~N"); +Clazz_defineMethod (c$, "cacheEQItem", + function (entry) { +var index = java.awt.EventQueue.eventToCacheIndex (entry.event); +if (index != -1 && Clazz_instanceOf (entry.event.getSource (), java.awt.Component)) { +var source = entry.event.getSource (); +if (source.eventCache == null) { +source.eventCache = new Array (5); +}source.eventCache[index] = entry; +}}, "java.awt.EventQueueItem"); +Clazz_defineMethod (c$, "uncacheEQItem", + function (entry) { +var index = java.awt.EventQueue.eventToCacheIndex (entry.event); +if (index != -1 && Clazz_instanceOf (entry.event.getSource (), java.awt.Component)) { +var source = entry.event.getSource (); +if (source.eventCache == null) { +return; +}source.eventCache[index] = null; +}}, "java.awt.EventQueueItem"); +c$.eventToCacheIndex = Clazz_defineMethod (c$, "eventToCacheIndex", + function (e) { +switch (e.getID ()) { +case 800: +return 0; +case 801: +return 1; +case 503: +return 2; +case 506: +return 3; +default: +return -1; +} +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "noEvents", + function () { +for (var i = 0; i < 4; i++) { +if (this.queues[i].head != null) { +return false; +}} +return true; +}); +Clazz_defineMethod (c$, "getNextEvent", +function () { +jssun.awt.SunToolkit.flushPendingEvents (); +{ +for (var i = 3; i >= 0; i--) { +if (this.queues[i].head != null) { +var entry = this.queues[i].head; +this.queues[i].head = entry.next; +if (entry.next == null) { +this.queues[i].tail = null; +}this.uncacheEQItem (entry); +return entry.event; +}} +jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadFree (this.dispatchThread); +}return null; +}); +Clazz_defineMethod (c$, "getNextEventForID", +function (id) { +jssun.awt.SunToolkit.flushPendingEvents (); +{ +for (var i = 0; i < 4; i++) { +for (var entry = this.queues[i].head, prev = null; entry != null; prev = entry, entry = entry.next) { +if (entry.id == id) { +if (prev == null) { +this.queues[i].head = entry.next; +} else { +prev.next = entry.next; +}if (this.queues[i].tail === entry) { +this.queues[i].tail = prev; +}this.uncacheEQItem (entry); +return entry.event; +}} +} +this.waitForID = id; +this.waitForID = 0; +}return null; +}, "~N"); +Clazz_defineMethod (c$, "peekEvent", +function () { +for (var i = 3; i >= 0; i--) { +if (this.queues[i].head != null) { +return this.queues[i].head.event; +}} +return null; +}); +Clazz_defineMethod (c$, "peekEvent", +function (id) { +for (var i = 3; i >= 0; i--) { +var q = this.queues[i].head; +for (; q != null; q = q.next) { +if (q.id == id) { +return q.event; +}} +} +return null; +}, "~N"); +Clazz_defineMethod (c$, "dispatchEvent", +function (event) { +var src = event.getSource (); +this.dispatchEventImpl (event, src, false); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "dispatchEventAndWait", +function (event, src) { +this.dispatchEventImpl (event, src, true); +}, "java.awt.AWTEvent,~O"); +Clazz_defineMethod (c$, "dispatchEventImpl", + function (event, src, andWait) { +event.isPosted = true; +if (Clazz_instanceOf (event, java.awt.ActiveEvent)) { +this.setCurrentEventAndMostRecentTimeImpl (event); +swingjs.JSToolkit.dispatchEvent (event, null, andWait); +} else if (Clazz_instanceOf (src, java.awt.Component)) { +swingjs.JSToolkit.dispatchEvent (event, src, andWait); +event.dispatched (); +} else if (Clazz_instanceOf (src, jssun.awt.AWTAutoShutdown)) { +if (this.noEvents ()) { +this.dispatchThread.stopDispatching (); +}} else { +System.err.println ("unable to dispatch event: " + event); +}}, "java.awt.AWTEvent,~O,~B"); +c$.getMostRecentEventTime = Clazz_defineMethod (c$, "getMostRecentEventTime", +function () { +return 0; +}); +Clazz_defineMethod (c$, "getMostRecentEventTimeEx", +function () { +return this.mostRecentEventTime; +}); +c$.getCurrentEvent = Clazz_defineMethod (c$, "getCurrentEvent", +function () { +return java.awt.Toolkit.getEventQueue ().getCurrentEventImpl (); +}); +Clazz_defineMethod (c$, "getCurrentEventImpl", + function () { +return (swingjs.JSToolkit.isDispatchThread () ? (this.currentEvent) : null); +}); +Clazz_defineMethod (c$, "push", +function (newEventQueue) { +if (this.nextQueue != null) { +this.nextQueue.push (newEventQueue); +return; +}{ +while (this.peekEvent () != null) { +try { +newEventQueue.postEventPrivate (this.getNextEvent ()); +} catch (ie) { +if (Clazz_exceptionOf (ie, InterruptedException)) { +} else { +throw ie; +} +} +} +newEventQueue.previousQueue = this; +}if (this.dispatchThread != null) { +this.dispatchThread.stopDispatchingLater (); +}this.nextQueue = newEventQueue; +var appContext = jssun.awt.AppContext.getAppContext (); +if (appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY) === this) { +appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, newEventQueue); +}}, "java.awt.EventQueue"); +Clazz_defineMethod (c$, "pop", +function () { +var prev = this.previousQueue; +{ +{ +if (this.nextQueue != null) { +this.nextQueue.pop (); +return; +}if (this.previousQueue == null) { +throw new java.util.EmptyStackException (); +}this.previousQueue.nextQueue = null; +while (this.peekEvent () != null) { +try { +this.previousQueue.postEventPrivate (this.getNextEvent ()); +} catch (ie) { +if (Clazz_exceptionOf (ie, InterruptedException)) { +} else { +throw ie; +} +} +} +var appContext = jssun.awt.AppContext.getAppContext (); +if (appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY) === this) { +appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, this.previousQueue); +}this.previousQueue = null; +}}var dt = this.dispatchThread; +if (dt != null) { +dt.stopDispatching (); +}}); +c$.isDispatchThread = Clazz_defineMethod (c$, "isDispatchThread", +function () { +return swingjs.JSToolkit.isDispatchThread (); +}); +Clazz_defineMethod (c$, "initDispatchThread", +function () { +{ +if (this.dispatchThread == null) { +var t = new java.awt.EventDispatchThread (this.threadGroup, this.name, this); +jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadBusy (t); +this.dispatchThread = t; +this.dispatchThread.start (); +}}}); +Clazz_defineMethod (c$, "detachDispatchThread", +function () { +this.dispatchThread = null; +}); +Clazz_defineMethod (c$, "getDispatchThread", +function () { +return this.dispatchThread; +}); +Clazz_defineMethod (c$, "removeSourceEvents", +function (source, removeAllEvents) { +jssun.awt.SunToolkit.flushPendingEvents (); +{ +for (var i = 0; i < 4; i++) { +var entry = this.queues[i].head; +var prev = null; +while (entry != null) { +if ((entry.event.getSource () === source) && (removeAllEvents || !(Clazz_instanceOf (entry.event, java.awt.SequencedEvent) || Clazz_instanceOf (entry.event, java.awt.SentEvent) || Clazz_instanceOf (entry.event, java.awt.event.FocusEvent) || Clazz_instanceOf (entry.event, java.awt.event.WindowEvent) || Clazz_instanceOf (entry.event, java.awt.event.KeyEvent) || Clazz_instanceOf (entry.event, java.awt.event.InputMethodEvent)))) { +if (Clazz_instanceOf (entry.event, java.awt.SequencedEvent)) { +(entry.event).dispose (); +}if (Clazz_instanceOf (entry.event, java.awt.SentEvent)) { +(entry.event).dispose (); +}if (prev == null) { +this.queues[i].head = entry.next; +} else { +prev.next = entry.next; +}this.uncacheEQItem (entry); +} else { +prev = entry; +}entry = entry.next; +} +this.queues[i].tail = prev; +} +}}, "~O,~B"); +c$.setCurrentEventAndMostRecentTime = Clazz_defineMethod (c$, "setCurrentEventAndMostRecentTime", +function (e) { +java.awt.Toolkit.getEventQueue ().setCurrentEventAndMostRecentTimeImpl (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "setCurrentEventAndMostRecentTimeImpl", + function (e) { +if (swingjs.JSToolkit.isDispatchThread ()) { +return; +}this.currentEvent = e; +var mostRecentEventTime2 = -9223372036854775808; +if (Clazz_instanceOf (e, java.awt.event.InputEvent)) { +var ie = e; +mostRecentEventTime2 = ie.getWhen (); +} else if (Clazz_instanceOf (e, java.awt.event.InputMethodEvent)) { +var ime = e; +mostRecentEventTime2 = ime.getWhen (); +} else if (Clazz_instanceOf (e, java.awt.event.ActionEvent)) { +var ae = e; +mostRecentEventTime2 = ae.getWhen (); +} else if (Clazz_instanceOf (e, java.awt.event.InvocationEvent)) { +var ie = e; +mostRecentEventTime2 = ie.getWhen (); +}this.mostRecentEventTime = Math.max (this.mostRecentEventTime, mostRecentEventTime2); +}, "java.awt.AWTEvent"); +c$.invokeLater = Clazz_defineMethod (c$, "invokeLater", +function (runnable) { +java.awt.Toolkit.getEventQueue ().postEvent ( new java.awt.event.InvocationEvent (java.awt.Toolkit.getDefaultToolkit (), runnable)); +}, "Runnable"); +c$.invokeAndWait = Clazz_defineMethod (c$, "invokeAndWait", +function (runnable) { +java.awt.EventQueue.invokeAndWaitStatic (java.awt.Toolkit.getDefaultToolkit (), runnable); +}, "Runnable"); +c$.invokeAndWaitStatic = Clazz_defineMethod (c$, "invokeAndWaitStatic", + function (source, runnable) { +if (java.awt.EventQueue.isDispatchThread ()) { +throw new Error ("Cannot call invokeAndWait from the event dispatcher thread"); +}var event = new java.awt.event.InvocationEvent (source, runnable, null, true); +swingjs.JSToolkit.dispatchEvent (event, null, true); +var eventThrowable = event.getThrowable (); +if (eventThrowable != null) { +throw new java.lang.reflect.InvocationTargetException (eventThrowable); +}}, "~O,Runnable"); +Clazz_defineMethod (c$, "wakeup", +function (isShutdown) { +{ +if (this.nextQueue != null) { +this.nextQueue.wakeup (isShutdown); +} else if (this.dispatchThread != null) { +try { +this.dispatchThread.start (); +} catch (e) { +if (Clazz_exceptionOf (e, IllegalThreadStateException)) { +this.dispatchThread.run (); +} else { +throw e; +} +} +} else if (!isShutdown) { +this.initDispatchThread (); +}}}, "~B"); +Clazz_defineStatics (c$, +"threadInitNumber", 0, +"LOW_PRIORITY", 0, +"NORM_PRIORITY", 1, +"HIGH_PRIORITY", 2, +"ULTIMATE_PRIORITY", 3, +"NUM_PRIORITIES", 4, +"PAINT", 0, +"UPDATE", 1, +"MOVE", 2, +"DRAG", 3, +"PEER", 4, +"CACHE_LENGTH", 5); +c$ = Clazz_decorateAsClass (function () { +this.head = null; +this.tail = null; +Clazz_instantialize (this, arguments); +}, java.awt, "Queue"); +c$ = Clazz_decorateAsClass (function () { +this.event = null; +this.id = 0; +this.next = null; +Clazz_instantialize (this, arguments); +}, java.awt, "EventQueueItem"); +Clazz_makeConstructor (c$, +function (evt) { +this.event = evt; +this.id = evt.getID (); +}, "java.awt.AWTEvent"); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.event.ActionListener", "$.AdjustmentListener", "$.ComponentListener", "$.ContainerListener", "$.FocusListener", "$.HierarchyBoundsListener", "$.HierarchyListener", "$.InputMethodListener", "$.ItemListener", "$.KeyListener", "$.MouseListener", "$.MouseMotionListener", "$.MouseWheelListener", "$.TextListener", "$.WindowFocusListener", "$.WindowListener", "$.WindowStateListener"], "java.awt.AWTEventMulticaster", ["java.lang.NullPointerException", "java.lang.reflect.Array"], function () { +c$ = Clazz_decorateAsClass (function () { +this.a = null; +this.b = null; +Clazz_instantialize (this, arguments); +}, java.awt, "AWTEventMulticaster", null, [java.awt.event.ComponentListener, java.awt.event.ContainerListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.WindowListener, java.awt.event.WindowFocusListener, java.awt.event.WindowStateListener, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.event.AdjustmentListener, java.awt.event.TextListener, java.awt.event.InputMethodListener, java.awt.event.HierarchyListener, java.awt.event.HierarchyBoundsListener, java.awt.event.MouseWheelListener]); +Clazz_makeConstructor (c$, +function (a, b) { +this.a = a; +this.b = b; +}, "java.util.EventListener,java.util.EventListener"); +Clazz_defineMethod (c$, "remove", +function (oldl) { +if (oldl === this.a) return this.b; +if (oldl === this.b) return this.a; +var a2 = java.awt.AWTEventMulticaster.removeInternal (this.a, oldl); +var b2 = java.awt.AWTEventMulticaster.removeInternal (this.b, oldl); +if (a2 === this.a && b2 === this.b) { +return this; +}return java.awt.AWTEventMulticaster.addInternal (a2, b2); +}, "java.util.EventListener"); +Clazz_defineMethod (c$, "componentResized", +function (e) { +(this.a).componentResized (e); +(this.b).componentResized (e); +}, "java.awt.event.ComponentEvent"); +Clazz_defineMethod (c$, "componentMoved", +function (e) { +(this.a).componentMoved (e); +(this.b).componentMoved (e); +}, "java.awt.event.ComponentEvent"); +Clazz_defineMethod (c$, "componentShown", +function (e) { +(this.a).componentShown (e); +(this.b).componentShown (e); +}, "java.awt.event.ComponentEvent"); +Clazz_defineMethod (c$, "componentHidden", +function (e) { +(this.a).componentHidden (e); +(this.b).componentHidden (e); +}, "java.awt.event.ComponentEvent"); +Clazz_defineMethod (c$, "componentAdded", +function (e) { +(this.a).componentAdded (e); +(this.b).componentAdded (e); +}, "java.awt.event.ContainerEvent"); +Clazz_defineMethod (c$, "componentRemoved", +function (e) { +(this.a).componentRemoved (e); +(this.b).componentRemoved (e); +}, "java.awt.event.ContainerEvent"); +Clazz_defineMethod (c$, "focusGained", +function (e) { +(this.a).focusGained (e); +(this.b).focusGained (e); +}, "java.awt.event.FocusEvent"); +Clazz_defineMethod (c$, "focusLost", +function (e) { +(this.a).focusLost (e); +(this.b).focusLost (e); +}, "java.awt.event.FocusEvent"); +Clazz_defineMethod (c$, "keyTyped", +function (e) { +(this.a).keyTyped (e); +(this.b).keyTyped (e); +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "keyPressed", +function (e) { +(this.a).keyPressed (e); +(this.b).keyPressed (e); +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "keyReleased", +function (e) { +(this.a).keyReleased (e); +(this.b).keyReleased (e); +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "mouseClicked", +function (e) { +(this.a).mouseClicked (e); +(this.b).mouseClicked (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mousePressed", +function (e) { +(this.a).mousePressed (e); +(this.b).mousePressed (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseReleased", +function (e) { +(this.a).mouseReleased (e); +(this.b).mouseReleased (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseEntered", +function (e) { +(this.a).mouseEntered (e); +(this.b).mouseEntered (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseExited", +function (e) { +(this.a).mouseExited (e); +(this.b).mouseExited (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseDragged", +function (e) { +(this.a).mouseDragged (e); +(this.b).mouseDragged (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseMoved", +function (e) { +(this.a).mouseMoved (e); +(this.b).mouseMoved (e); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "windowOpened", +function (e) { +(this.a).windowOpened (e); +(this.b).windowOpened (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowClosing", +function (e) { +(this.a).windowClosing (e); +(this.b).windowClosing (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowClosed", +function (e) { +(this.a).windowClosed (e); +(this.b).windowClosed (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowIconified", +function (e) { +(this.a).windowIconified (e); +(this.b).windowIconified (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowDeiconified", +function (e) { +(this.a).windowDeiconified (e); +(this.b).windowDeiconified (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowActivated", +function (e) { +(this.a).windowActivated (e); +(this.b).windowActivated (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowDeactivated", +function (e) { +(this.a).windowDeactivated (e); +(this.b).windowDeactivated (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowStateChanged", +function (e) { +(this.a).windowStateChanged (e); +(this.b).windowStateChanged (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowGainedFocus", +function (e) { +(this.a).windowGainedFocus (e); +(this.b).windowGainedFocus (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowLostFocus", +function (e) { +(this.a).windowLostFocus (e); +(this.b).windowLostFocus (e); +}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "actionPerformed", +function (e) { +(this.a).actionPerformed (e); +(this.b).actionPerformed (e); +}, "java.awt.event.ActionEvent"); +Clazz_defineMethod (c$, "itemStateChanged", +function (e) { +(this.a).itemStateChanged (e); +(this.b).itemStateChanged (e); +}, "java.awt.event.ItemEvent"); +Clazz_defineMethod (c$, "adjustmentValueChanged", +function (e) { +(this.a).adjustmentValueChanged (e); +(this.b).adjustmentValueChanged (e); +}, "java.awt.event.AdjustmentEvent"); +Clazz_defineMethod (c$, "textValueChanged", +function (e) { +(this.a).textValueChanged (e); +(this.b).textValueChanged (e); +}, "java.awt.event.TextEvent"); +Clazz_defineMethod (c$, "inputMethodTextChanged", +function (e) { +(this.a).inputMethodTextChanged (e); +(this.b).inputMethodTextChanged (e); +}, "java.awt.event.InputMethodEvent"); +Clazz_defineMethod (c$, "caretPositionChanged", +function (e) { +(this.a).caretPositionChanged (e); +(this.b).caretPositionChanged (e); +}, "java.awt.event.InputMethodEvent"); +Clazz_defineMethod (c$, "hierarchyChanged", +function (e) { +(this.a).hierarchyChanged (e); +(this.b).hierarchyChanged (e); +}, "java.awt.event.HierarchyEvent"); +Clazz_defineMethod (c$, "ancestorMoved", +function (e) { +(this.a).ancestorMoved (e); +(this.b).ancestorMoved (e); +}, "java.awt.event.HierarchyEvent"); +Clazz_defineMethod (c$, "ancestorResized", +function (e) { +(this.a).ancestorResized (e); +(this.b).ancestorResized (e); +}, "java.awt.event.HierarchyEvent"); +Clazz_defineMethod (c$, "mouseWheelMoved", +function (e) { +(this.a).mouseWheelMoved (e); +(this.b).mouseWheelMoved (e); +}, "java.awt.event.MouseWheelEvent"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.ComponentListener,java.awt.event.ComponentListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.ContainerListener,java.awt.event.ContainerListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.FocusListener,java.awt.event.FocusListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.KeyListener,java.awt.event.KeyListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.MouseListener,java.awt.event.MouseListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.MouseMotionListener,java.awt.event.MouseMotionListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.WindowListener,java.awt.event.WindowListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.WindowStateListener,java.awt.event.WindowStateListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.WindowFocusListener,java.awt.event.WindowFocusListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.ActionListener,java.awt.event.ActionListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.ItemListener,java.awt.event.ItemListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.AdjustmentListener,java.awt.event.AdjustmentListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.TextListener,java.awt.event.TextListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.InputMethodListener,java.awt.event.InputMethodListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.HierarchyListener,java.awt.event.HierarchyListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.HierarchyBoundsListener,java.awt.event.HierarchyBoundsListener"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return java.awt.AWTEventMulticaster.addInternal (a, b); +}, "java.awt.event.MouseWheelListener,java.awt.event.MouseWheelListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.ComponentListener,java.awt.event.ComponentListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.ContainerListener,java.awt.event.ContainerListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.FocusListener,java.awt.event.FocusListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.KeyListener,java.awt.event.KeyListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.MouseListener,java.awt.event.MouseListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.MouseMotionListener,java.awt.event.MouseMotionListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.WindowListener,java.awt.event.WindowListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.WindowStateListener,java.awt.event.WindowStateListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.WindowFocusListener,java.awt.event.WindowFocusListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.ActionListener,java.awt.event.ActionListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.ItemListener,java.awt.event.ItemListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.AdjustmentListener,java.awt.event.AdjustmentListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.TextListener,java.awt.event.TextListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.InputMethodListener,java.awt.event.InputMethodListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.HierarchyListener,java.awt.event.HierarchyListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.HierarchyBoundsListener,java.awt.event.HierarchyBoundsListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return java.awt.AWTEventMulticaster.removeInternal (l, oldl); +}, "java.awt.event.MouseWheelListener,java.awt.event.MouseWheelListener"); +c$.addInternal = Clazz_defineMethod (c$, "addInternal", +function (a, b) { +if (a == null) return b; +if (b == null) return a; +return new java.awt.AWTEventMulticaster (a, b); +}, "java.util.EventListener,java.util.EventListener"); +c$.removeInternal = Clazz_defineMethod (c$, "removeInternal", +function (l, oldl) { +if (l === oldl || l == null) { +return null; +} else if (Clazz_instanceOf (l, java.awt.AWTEventMulticaster)) { +return (l).remove (oldl); +} else { +return l; +}}, "java.util.EventListener,java.util.EventListener"); +c$.getListenerCount = Clazz_defineMethod (c$, "getListenerCount", + function (l, listenerType) { +if (Clazz_instanceOf (l, java.awt.AWTEventMulticaster)) { +var mc = l; +return java.awt.AWTEventMulticaster.getListenerCount (mc.a, listenerType) + java.awt.AWTEventMulticaster.getListenerCount (mc.b, listenerType); +} else { +return listenerType.isInstance (l) ? 1 : 0; +}}, "java.util.EventListener,Class"); +c$.populateListenerArray = Clazz_defineMethod (c$, "populateListenerArray", + function (a, l, index) { +if (Clazz_instanceOf (l, java.awt.AWTEventMulticaster)) { +var mc = l; +var lhs = java.awt.AWTEventMulticaster.populateListenerArray (a, mc.a, index); +return java.awt.AWTEventMulticaster.populateListenerArray (a, mc.b, lhs); +} else if (a.getClass ().getComponentType ().isInstance (l)) { +a[index] = l; +return index + 1; +} else { +return index; +}}, "~A,java.util.EventListener,~N"); +c$.getListeners = Clazz_defineMethod (c$, "getListeners", +function (l, listenerType) { +if (listenerType == null) { +throw new NullPointerException ("Listener type should not be null"); +}var n = java.awt.AWTEventMulticaster.getListenerCount (l, listenerType); +var result = java.lang.reflect.Array.newInstance (listenerType, n); +java.awt.AWTEventMulticaster.populateListenerArray (result, l, 0); +return result; +}, "java.util.EventListener,Class"); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.util.EventObject"], "java.awt.AWTEvent", ["java.awt.Component", "java.awt.peer.LightweightPeer"], function () { +c$ = Clazz_decorateAsClass (function () { +this.bdata = null; +this.id = 0; +this.num = 0; +this.consumed = false; +this.focusManagerIsDispatching = false; +this.isPosted = false; +Clazz_instantialize (this, arguments); +}, java.awt, "AWTEvent", java.util.EventObject); +Clazz_makeConstructor (c$, +function (event) { +this.construct (event.target, event.id); +}, "java.awt.Event"); +Clazz_makeConstructor (c$, +function (source, id) { +Clazz_superConstructor (this, java.awt.AWTEvent, [source]); +this.id = id; +this.num = ++java.awt.AWTEvent.idnum; +switch (id) { +case 1001: +case 701: +case 601: +case 900: +this.consumed = true; +break; +default: +} +}, "~O,~N"); +Clazz_defineMethod (c$, "setSource", +function (newSource) { +if (this.source === newSource) { +return; +}var comp = null; +if (Clazz_instanceOf (newSource, java.awt.Component)) { +comp = newSource; +while (comp != null && comp.peer != null && (Clazz_instanceOf (comp.peer, java.awt.peer.LightweightPeer))) { +comp = comp.parent; +} +}this.source = newSource; +}, "~O"); +Clazz_defineMethod (c$, "getID", +function () { +return this.id; +}); +Clazz_overrideMethod (c$, "toString", +function () { +var srcName = null; +if (Clazz_instanceOf (this.source, java.awt.Component)) { +srcName = (this.source).getName (); +}return this.getClass ().getName () + "[" + this.paramString () + "] on " + (srcName != null ? srcName : this.source); +}); +Clazz_defineMethod (c$, "paramString", +function () { +return ""; +}); +Clazz_defineMethod (c$, "consume", +function () { +switch (this.id) { +case 401: +case 402: +case 501: +case 502: +case 503: +case 506: +case 504: +case 505: +case 507: +case 1100: +case 1101: +this.consumed = true; +break; +default: +} +}); +Clazz_defineMethod (c$, "isConsumed", +function () { +return this.consumed; +}); +Clazz_defineMethod (c$, "copyPrivateDataInto", +function (that) { +that.bdata = this.bdata; +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "dispatched", +function () { +}); +Clazz_defineStatics (c$, +"idnum", 0, +"COMPONENT_EVENT_MASK", 0x01, +"CONTAINER_EVENT_MASK", 0x02, +"FOCUS_EVENT_MASK", 0x04, +"KEY_EVENT_MASK", 0x08, +"MOUSE_EVENT_MASK", 0x10, +"MOUSE_MOTION_EVENT_MASK", 0x20, +"WINDOW_EVENT_MASK", 0x40, +"ACTION_EVENT_MASK", 0x80, +"ADJUSTMENT_EVENT_MASK", 0x100, +"ITEM_EVENT_MASK", 0x200, +"TEXT_EVENT_MASK", 0x400, +"INPUT_METHOD_EVENT_MASK", 0x800, +"INPUT_METHODS_ENABLED_MASK", 0x1000, +"PAINT_EVENT_MASK", 0x2000, +"INVOCATION_EVENT_MASK", 0x4000, +"HIERARCHY_EVENT_MASK", 0x8000, +"HIERARCHY_BOUNDS_EVENT_MASK", 0x10000, +"MOUSE_WHEEL_EVENT_MASK", 0x20000, +"WINDOW_STATE_EVENT_MASK", 0x40000, +"WINDOW_FOCUS_EVENT_MASK", 0x80000, +"RESERVED_ID_MAX", 1999); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.util.EventListener"], "java.awt.event.AWTEventListener", null, function () { +Clazz_declareInterface (java.awt.event, "AWTEventListener", java.util.EventListener); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "ActiveEvent"); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent"], "java.awt.event.InvocationEvent", ["java.lang.Exception"], function () { +c$ = Clazz_decorateAsClass (function () { +this.runnable = null; +this.notifier = null; +this.catchExceptions = false; +this.exception = null; +this.throwable = null; +this.when = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "InvocationEvent", java.awt.AWTEvent, java.awt.ActiveEvent); +Clazz_makeConstructor (c$, +function (source, runnable) { +this.construct (source, runnable, null, false); +}, "~O,Runnable"); +Clazz_makeConstructor (c$, +function (source, runnable, notifier, catchThrowables) { +this.construct (source, 1200, runnable, notifier, catchThrowables); +}, "~O,Runnable,~O,~B"); +Clazz_makeConstructor (c$, +function (source, id, runnable, notifier, catchThrowables) { +Clazz_superConstructor (this, java.awt.event.InvocationEvent, [source, id]); +this.runnable = runnable; +this.notifier = notifier; +this.catchExceptions = catchThrowables; +this.when = System.currentTimeMillis (); +}, "~O,~N,Runnable,~O,~B"); +Clazz_overrideMethod (c$, "dispatch", +function () { +if (this.catchExceptions) { +try { +this.runnable.run (); +} catch (t) { +if (Clazz_instanceOf (t, Exception)) { +this.exception = t; +}this.throwable = t; +} +} else { +this.runnable.run (); +}if (this.notifier != null) { +{ +this.notifier.notifyAll (); +}}}); +Clazz_defineMethod (c$, "getException", +function () { +return (this.catchExceptions) ? this.exception : null; +}); +Clazz_defineMethod (c$, "getThrowable", +function () { +return (this.catchExceptions) ? this.throwable : null; +}); +Clazz_defineMethod (c$, "getWhen", +function () { +return this.when; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 1200: +typeStr = "INVOCATION_DEFAULT"; +break; +default: +typeStr = "unknown type"; +} +return typeStr + ",runnable=" + this.runnable + ",notifier=" + this.notifier + ",catchExceptions=" + this.catchExceptions + ",when=" + this.when; +}); +Clazz_defineStatics (c$, +"SWINGJS_INVOCATION_LOW", 1201, +"INVOCATION_FIRST", 1200, +"INVOCATION_DEFAULT", 1200, +"INVOCATION_LAST", 1201); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.AWTEvent"], "java.awt.event.ComponentEvent", ["java.awt.Component"], function () { +c$ = Clazz_declareType (java.awt.event, "ComponentEvent", java.awt.AWTEvent); +Clazz_defineMethod (c$, "getComponent", +function () { +return (Clazz_instanceOf (this.source, java.awt.Component)) ? this.source : null; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +var b = (this.source != null ? (this.source).getBounds () : null); +switch (this.id) { +case 102: +typeStr = "COMPONENT_SHOWN"; +break; +case 103: +typeStr = "COMPONENT_HIDDEN"; +break; +case 100: +typeStr = "COMPONENT_MOVED (" + b.x + "," + b.y + " " + b.width + "x" + b.height + ")"; +break; +case 101: +typeStr = "COMPONENT_RESIZED (" + b.x + "," + b.y + " " + b.width + "x" + b.height + ")"; +break; +default: +typeStr = "unknown type"; +} +return typeStr; +}); +Clazz_defineStatics (c$, +"COMPONENT_FIRST", 100, +"COMPONENT_LAST", 103, +"COMPONENT_MOVED", 100, +"COMPONENT_RESIZED", 101, +"COMPONENT_SHOWN", 102, +"COMPONENT_HIDDEN", 103); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.InputEvent"], "java.awt.event.MouseEvent", ["java.lang.IllegalArgumentException", "$.StringBuilder", "java.awt.Point", "$.Toolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.x = 0; +this.y = 0; +this.xAbs = 0; +this.yAbs = 0; +this.clickCount = 0; +this.button = 0; +this.popupTrigger = false; +Clazz_instantialize (this, arguments); +}, java.awt.event, "MouseEvent", java.awt.event.InputEvent); +Clazz_defineMethod (c$, "getLocationOnScreen", +function () { +return new java.awt.Point (this.xAbs, this.yAbs); +}); +Clazz_defineMethod (c$, "getXOnScreen", +function () { +return this.xAbs; +}); +Clazz_defineMethod (c$, "getYOnScreen", +function () { +return this.yAbs; +}); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, clickCount, popupTrigger, button) { +this.construct (source, id, when, modifiers, x, y, 0, 0, clickCount, popupTrigger, button); +var eventLocationOnScreen = new java.awt.Point (0, 0); +try { +eventLocationOnScreen = source.getLocationOnScreen (); +this.xAbs = eventLocationOnScreen.x + x; +this.yAbs = eventLocationOnScreen.y + y; +} catch (e) { +if (Clazz_exceptionOf (e, java.awt.IllegalComponentStateException)) { +this.xAbs = 0; +this.yAbs = 0; +} else { +throw e; +} +} +}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B,~N"); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, clickCount, popupTrigger) { +this.construct (source, id, when, modifiers, x, y, clickCount, popupTrigger, 0); +}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B"); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, button) { +Clazz_superConstructor (this, java.awt.event.MouseEvent, [source, id, when, modifiers]); +this.x = x; +this.y = y; +this.xAbs = xAbs; +this.yAbs = yAbs; +this.clickCount = clickCount; +this.popupTrigger = popupTrigger; +if (button < 0 || button > 3) { +throw new IllegalArgumentException ("Invalid button value"); +}this.button = button; +if ((this.getModifiers () != 0) && (this.getModifiersEx () == 0)) { +this.setNewModifiers (); +} else if ((this.getModifiers () == 0) && (this.getModifiersEx () != 0 || button != 0)) { +this.setOldModifiers (); +}}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~N,~N,~B,~N"); +Clazz_defineMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_defineMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "getPoint", +function () { +var x; +var y; +{ +x = this.x; +y = this.y; +}return new java.awt.Point (x, y); +}); +Clazz_defineMethod (c$, "translatePoint", +function (x, y) { +this.x += x; +this.y += y; +}, "~N,~N"); +Clazz_defineMethod (c$, "getClickCount", +function () { +return this.clickCount; +}); +Clazz_defineMethod (c$, "getButton", +function () { +return this.button; +}); +Clazz_defineMethod (c$, "isPopupTrigger", +function () { +return this.popupTrigger; +}); +c$.getMouseModifiersText = Clazz_defineMethod (c$, "getMouseModifiersText", +function (modifiers) { +var buf = new StringBuilder (); +if ((modifiers & 8) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.alt", "Alt")); +buf.append ("+"); +}if ((modifiers & 4) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.meta", "Meta")); +buf.append ("+"); +}if ((modifiers & 2) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.control", "Ctrl")); +buf.append ("+"); +}if ((modifiers & 1) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.shift", "Shift")); +buf.append ("+"); +}if ((modifiers & 32) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph")); +buf.append ("+"); +}if ((modifiers & 16) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button1", "Button1")); +buf.append ("+"); +}if ((modifiers & 8) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button2", "Button2")); +buf.append ("+"); +}if ((modifiers & 4) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button3", "Button3")); +buf.append ("+"); +}if (buf.length () > 0) { +buf.setLength (buf.length () - 1); +}return buf.toString (); +}, "~N"); +Clazz_overrideMethod (c$, "paramString", +function () { +var str = new StringBuilder (80); +str.append (java.awt.event.MouseEvent.getIdString (this.id)); +str.append (",(" + this.x).append ("," + this.y).append ("," + this.when).append (")"); +str.append (",absolute(").append ("" + this.xAbs).append (",").append ("" + this.yAbs).append (")"); +str.append (",button=").append ("" + this.getButton ()); +if (this.getModifiers () != 0) { +str.append (",modifiers=").append (java.awt.event.MouseEvent.getMouseModifiersText (this.modifiers)); +}if (this.getModifiersEx () != 0) { +str.append (",extModifiers=").append (java.awt.event.InputEvent.getModifiersExText (this.modifiers)); +}str.append (",clickCount=").append ("" + this.clickCount); +return str.toString (); +}); +c$.getIdString = Clazz_defineMethod (c$, "getIdString", +function (id) { +switch (id) { +case 501: +return "MOUSE_PRESSED"; +case 502: +return "MOUSE_RELEASED"; +case 500: +return "MOUSE_CLICKED"; +case 504: +return "MOUSE_ENTERED"; +case 505: +return "MOUSE_EXITED"; +case 503: +return "MOUSE_MOVED"; +case 506: +return "MOUSE_DRAGGED"; +case 507: +return "MOUSE_WHEEL"; +default: +return "unknown type"; +} +}, "~N"); +Clazz_defineMethod (c$, "setNewModifiers", + function () { +if ((this.modifiers & 16) != 0) { +this.modifiers |= 1024; +}if ((this.modifiers & 8) != 0) { +this.modifiers |= 2048; +}if ((this.modifiers & 4) != 0) { +this.modifiers |= 4096; +}if (this.id == 501 || this.id == 502 || this.id == 500) { +if ((this.modifiers & 16) != 0) { +this.button = 1; +this.modifiers &= -13; +if (this.id != 501) { +this.modifiers &= -1025; +}} else if ((this.modifiers & 8) != 0) { +this.button = 2; +this.modifiers &= -21; +if (this.id != 501) { +this.modifiers &= -2049; +}} else if ((this.modifiers & 4) != 0) { +this.button = 3; +this.modifiers &= -25; +if (this.id != 501) { +this.modifiers &= -4097; +}}}if ((this.modifiers & 8) != 0) { +this.modifiers |= 512; +}if ((this.modifiers & 4) != 0) { +this.modifiers |= 256; +}if ((this.modifiers & 1) != 0) { +this.modifiers |= 64; +}if ((this.modifiers & 2) != 0) { +this.modifiers |= 128; +}if ((this.modifiers & 32) != 0) { +this.modifiers |= 8192; +}}); +Clazz_defineMethod (c$, "setOldModifiers", + function () { +if (this.id == 501 || this.id == 502 || this.id == 500) { +switch (this.button) { +case 1: +this.modifiers |= 16; +break; +case 2: +this.modifiers |= 8; +break; +case 3: +this.modifiers |= 4; +break; +} +} else { +if ((this.modifiers & 1024) != 0) { +this.modifiers |= 16; +}if ((this.modifiers & 2048) != 0) { +this.modifiers |= 8; +}if ((this.modifiers & 4096) != 0) { +this.modifiers |= 4; +}}if ((this.modifiers & 512) != 0) { +this.modifiers |= 8; +}if ((this.modifiers & 256) != 0) { +this.modifiers |= 4; +}if ((this.modifiers & 64) != 0) { +this.modifiers |= 1; +}if ((this.modifiers & 128) != 0) { +this.modifiers |= 2; +}if ((this.modifiers & 8192) != 0) { +this.modifiers |= 32; +}}); +Clazz_defineStatics (c$, +"MOUSE_FIRST", 500, +"MOUSE_LAST", 507, +"MOUSE_CLICKED", 500, +"MOUSE_PRESSED", 501, +"MOUSE_RELEASED", 502, +"MOUSE_MOVED", 503, +"MOUSE_ENTERED", 504, +"MOUSE_EXITED", 505, +"MOUSE_DRAGGED", 506, +"MOUSE_WHEEL", 507, +"NOBUTTON", 0, +"BUTTON1", 1, +"BUTTON2", 2, +"BUTTON3", 3); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.InputEvent", ["java.lang.StringBuilder", "java.awt.Toolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.when = 0; +this.modifiers = 0; +this.canAccessSystemClipboard = false; +Clazz_instantialize (this, arguments); +}, java.awt.event, "InputEvent", java.awt.event.ComponentEvent); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers) { +Clazz_superConstructor (this, java.awt.event.InputEvent, [source, id]); +this.when = when; +this.modifiers = modifiers; +this.canAccessSystemClipboard = false; +}, "java.awt.Component,~N,~N,~N"); +Clazz_defineMethod (c$, "isShiftDown", +function () { +return (this.modifiers & 1) != 0; +}); +Clazz_defineMethod (c$, "isControlDown", +function () { +return (this.modifiers & 2) != 0; +}); +Clazz_defineMethod (c$, "isMetaDown", +function () { +return (this.modifiers & 4) != 0; +}); +Clazz_defineMethod (c$, "isAltDown", +function () { +return (this.modifiers & 8) != 0; +}); +Clazz_defineMethod (c$, "isAltGraphDown", +function () { +return (this.modifiers & 32) != 0; +}); +Clazz_defineMethod (c$, "getWhen", +function () { +return this.when; +}); +Clazz_defineMethod (c$, "getModifiers", +function () { +return this.modifiers & (-16321); +}); +Clazz_defineMethod (c$, "getModifiersEx", +function () { +return this.modifiers & -64; +}); +Clazz_overrideMethod (c$, "consume", +function () { +this.consumed = true; +}); +Clazz_overrideMethod (c$, "isConsumed", +function () { +return this.consumed; +}); +c$.getModifiersExText = Clazz_defineMethod (c$, "getModifiersExText", +function (modifiers) { +var buf = new StringBuilder (); +if ((modifiers & 256) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.meta", "Meta")); +buf.append ("+"); +}if ((modifiers & 128) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.control", "Ctrl")); +buf.append ("+"); +}if ((modifiers & 512) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.alt", "Alt")); +buf.append ("+"); +}if ((modifiers & 64) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.shift", "Shift")); +buf.append ("+"); +}if ((modifiers & 8192) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.altGraph", "Alt Graph")); +buf.append ("+"); +}if ((modifiers & 1024) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button1", "Button1")); +buf.append ("+"); +}if ((modifiers & 2048) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button2", "Button2")); +buf.append ("+"); +}if ((modifiers & 4096) != 0) { +buf.append (java.awt.Toolkit.getProperty ("AWT.button3", "Button3")); +buf.append ("+"); +}if (buf.length () > 0) { +buf.setLength (buf.length () - 1); +}return buf.toString (); +}, "~N"); +Clazz_defineStatics (c$, +"SHIFT_MASK", 1, +"CTRL_MASK", 2, +"META_MASK", 4, +"ALT_MASK", 8, +"ALT_GRAPH_MASK", 32, +"BUTTON1_MASK", 16, +"BUTTON2_MASK", 8, +"BUTTON3_MASK", 4, +"SHIFT_DOWN_MASK", 64, +"CTRL_DOWN_MASK", 128, +"META_DOWN_MASK", 256, +"ALT_DOWN_MASK", 512, +"BUTTON1_DOWN_MASK", 1024, +"BUTTON2_DOWN_MASK", 2048, +"BUTTON3_DOWN_MASK", 4096, +"ALT_GRAPH_DOWN_MASK", 8192, +"FIRST_HIGH_BIT", 16384, +"JDK_1_3_MODIFIERS", 63, +"HIGH_MODIFIERS", -16384); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.AWTEventMulticaster", "java.awt.event.AWTEventListener", "java.util.HashMap"], "java.awt.Toolkit", ["java.util.ArrayList", "java.awt.Cursor", "$.Insets", "$.RenderingHints", "java.awt.event.AWTEventListenerProxy", "java.beans.PropertyChangeSupport", "jssun.awt.NullComponentPeer"], function () { +c$ = Clazz_decorateAsClass (function () { +this.desktopProperties = null; +this.desktopPropsSupport = null; +this.calls = null; +this.eventListener = null; +this.listener2SelectiveListener = null; +if (!Clazz_isClassDefined ("java.awt.Toolkit.SelectiveAWTEventListener")) { +java.awt.Toolkit.$Toolkit$SelectiveAWTEventListener$ (); +} +Clazz_instantialize (this, arguments); +}, java.awt, "Toolkit"); +Clazz_prepareFields (c$, function () { +this.desktopProperties = new java.util.HashMap (); +this.desktopPropsSupport = java.awt.Toolkit.createPropertyChangeSupport (this); +this.calls = Clazz_newIntArray (32, 0); +this.listener2SelectiveListener = new java.util.HashMap (); +}); +Clazz_defineMethod (c$, "createComponent", +function (target) { +if (java.awt.Toolkit.lightweightMarker == null) { +java.awt.Toolkit.lightweightMarker = new jssun.awt.NullComponentPeer (); +}return java.awt.Toolkit.lightweightMarker; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "loadSystemColors", +function (systemColors) { +}, "~A"); +Clazz_defineMethod (c$, "setDynamicLayout", +function (dynamic) { +}, "~B"); +Clazz_defineMethod (c$, "isDynamicLayoutSet", +function () { +if (this !== java.awt.Toolkit.getDefaultToolkit ()) { +return java.awt.Toolkit.getDefaultToolkit ().isDynamicLayoutSet (); +} else { +return false; +}}); +Clazz_defineMethod (c$, "isDynamicLayoutActive", +function () { +if (this !== java.awt.Toolkit.getDefaultToolkit ()) { +return java.awt.Toolkit.getDefaultToolkit ().isDynamicLayoutActive (); +} else { +return false; +}}); +Clazz_defineMethod (c$, "getScreenInsets", +function (gc) { +if (this !== java.awt.Toolkit.getDefaultToolkit ()) { +return java.awt.Toolkit.getDefaultToolkit ().getScreenInsets (gc); +} else { +return new java.awt.Insets (0, 0, 0, 0); +}}, "java.awt.GraphicsConfiguration"); +c$.getDefaultToolkit = Clazz_defineMethod (c$, "getDefaultToolkit", +function () { +return (java.awt.Toolkit.toolkit == null ? java.awt.Toolkit.toolkit = new swingjs.JSToolkit () : java.awt.Toolkit.toolkit); +}); +Clazz_defineMethod (c$, "createImage", +function (imagedata) { +return this.createImage (imagedata, 0, imagedata.length); +}, "~A"); +Clazz_defineMethod (c$, "getMenuShortcutKeyMask", +function () { +return 2; +}); +c$.getNativeContainer = Clazz_defineMethod (c$, "getNativeContainer", +function (c) { +return null; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "createCustomCursor", +function (cursor, hotSpot, name) { +return new java.awt.Cursor (0); +}, "java.awt.Image,java.awt.Point,~S"); +Clazz_defineMethod (c$, "isFrameStateSupported", +function (state) { +return (state == 0); +}, "~N"); +c$.getProperty = Clazz_defineMethod (c$, "getProperty", +function (key, defaultValue) { +if (java.awt.Toolkit.resources != null) { +try { +return java.awt.Toolkit.resources.getString (key); +} catch (e) { +if (Clazz_exceptionOf (e, java.util.MissingResourceException)) { +} else { +throw e; +} +} +}return defaultValue; +}, "~S,~S"); +Clazz_defineMethod (c$, "getSystemEventQueue", +function () { +return this.getSystemEventQueueImpl (); +}); +c$.getEventQueue = Clazz_defineMethod (c$, "getEventQueue", +function () { +return java.awt.Toolkit.getDefaultToolkit ().getSystemEventQueueImpl (); +}); +Clazz_defineMethod (c$, "getDesktopProperty", +function (propertyName) { +if (this.desktopProperties.isEmpty ()) { +this.initializeDesktopProperties (); +}var value; +if (propertyName.equals ("awt.dynamicLayoutSupported")) { +value = this.lazilyLoadDesktopProperty (propertyName); +return value; +}value = this.desktopProperties.get (propertyName); +if (value == null) { +value = this.lazilyLoadDesktopProperty (propertyName); +if (value != null) { +this.setDesktopProperty (propertyName, value); +}}if (Clazz_instanceOf (value, java.awt.RenderingHints)) { +value = (value).clone (); +}return value; +}, "~S"); +Clazz_defineMethod (c$, "setDesktopProperty", +function (name, newValue) { +var oldValue; +{ +oldValue = this.desktopProperties.get (name); +this.desktopProperties.put (name, newValue); +}this.desktopPropsSupport.firePropertyChange (name, oldValue, newValue); +}, "~S,~O"); +Clazz_defineMethod (c$, "lazilyLoadDesktopProperty", +function (name) { +return null; +}, "~S"); +Clazz_defineMethod (c$, "initializeDesktopProperties", +function () { +}); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (name, pcl) { +this.desktopPropsSupport.addPropertyChangeListener (name, pcl); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (name, pcl) { +this.desktopPropsSupport.removePropertyChangeListener (name, pcl); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +return this.desktopPropsSupport.getPropertyChangeListeners (); +}); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function (propertyName) { +return this.desktopPropsSupport.getPropertyChangeListeners (propertyName); +}, "~S"); +Clazz_defineMethod (c$, "isAlwaysOnTopSupported", +function () { +return true; +}); +c$.deProxyAWTEventListener = Clazz_defineMethod (c$, "deProxyAWTEventListener", + function (l) { +var localL = l; +if (localL == null) { +return null; +}if (Clazz_instanceOf (l, java.awt.event.AWTEventListenerProxy)) { +localL = (l).getListener (); +}return localL; +}, "java.awt.event.AWTEventListener"); +Clazz_defineMethod (c$, "addAWTEventListener", +function (listener, eventMask) { +var localL = java.awt.Toolkit.deProxyAWTEventListener (listener); +if (localL == null) { +return; +}{ +var selectiveListener = this.listener2SelectiveListener.get (localL); +if (selectiveListener == null) { +selectiveListener = Clazz_innerTypeInstance (java.awt.Toolkit.SelectiveAWTEventListener, this, null, localL, eventMask); +this.listener2SelectiveListener.put (localL, selectiveListener); +this.eventListener = java.awt.Toolkit.ToolkitEventMulticaster.add (this.eventListener, selectiveListener); +}selectiveListener.orEventMasks (eventMask); +java.awt.Toolkit.enabledOnToolkitMask |= eventMask; +var mask = eventMask; +for (var i = 0; i < 32; i++) { +if (mask == 0) { +break; +}if ((mask & 1) != 0) { +this.calls[i]++; +}mask >>>= 1; +} +}}, "java.awt.event.AWTEventListener,~N"); +Clazz_defineMethod (c$, "removeAWTEventListener", +function (listener) { +var localL = java.awt.Toolkit.deProxyAWTEventListener (listener); +if (listener == null) { +return; +}{ +var selectiveListener = this.listener2SelectiveListener.get (localL); +if (selectiveListener != null) { +this.listener2SelectiveListener.remove (localL); +var listenerCalls = selectiveListener.getCalls (); +for (var i = 0; i < 32; i++) { +this.calls[i] -= listenerCalls[i]; +if (this.calls[i] == 0) { +java.awt.Toolkit.enabledOnToolkitMask &= ~(1 << i); +}} +}this.eventListener = java.awt.Toolkit.ToolkitEventMulticaster.remove (this.eventListener, (selectiveListener == null) ? localL : selectiveListener); +}}, "java.awt.event.AWTEventListener"); +c$.enabledOnToolkit = Clazz_defineMethod (c$, "enabledOnToolkit", +function (eventMask) { +return (java.awt.Toolkit.enabledOnToolkitMask & eventMask) != 0; +}, "~N"); +Clazz_defineMethod (c$, "countAWTEventListeners", +function (eventMask) { +var ci = 0; +for (; eventMask != 0; eventMask >>>= 1, ci++) { +} +ci--; +return this.calls[ci]; +}, "~N"); +Clazz_defineMethod (c$, "getAWTEventListeners", +function () { +{ +var la = java.awt.Toolkit.ToolkitEventMulticaster.getListeners (this.eventListener, java.awt.event.AWTEventListener); +var ret = new Array (la.length); +for (var i = 0; i < la.length; i++) { +var sael = la[i]; +var tempL = sael.getListener (); +ret[i] = new java.awt.event.AWTEventListenerProxy (sael.getEventMask (), tempL); +} +return ret; +}}); +Clazz_defineMethod (c$, "getAWTEventListeners", +function (eventMask) { +{ +var la = java.awt.Toolkit.ToolkitEventMulticaster.getListeners (this.eventListener, java.awt.event.AWTEventListener); +var list = new java.util.ArrayList (la.length); +for (var i = 0; i < la.length; i++) { +var sael = la[i]; +if ((sael.getEventMask () & eventMask) == eventMask) { +list.add ( new java.awt.event.AWTEventListenerProxy (sael.getEventMask (), sael.getListener ())); +}} +return list.toArray ( new Array (0)); +}}, "~N"); +Clazz_defineMethod (c$, "notifyAWTEventListeners", +function (theEvent) { +var eventListener = this.eventListener; +if (eventListener != null) { +eventListener.eventDispatched (theEvent); +}}, "java.awt.AWTEvent"); +c$.createPropertyChangeSupport = Clazz_defineMethod (c$, "createPropertyChangeSupport", + function (toolkit) { +return new java.beans.PropertyChangeSupport (toolkit); +}, "java.awt.Toolkit"); +c$.$Toolkit$SelectiveAWTEventListener$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +this.listener = null; +this.eventMask = 0; +this.calls = null; +Clazz_instantialize (this, arguments); +}, java.awt.Toolkit, "SelectiveAWTEventListener", null, java.awt.event.AWTEventListener); +Clazz_prepareFields (c$, function () { +this.calls = Clazz_newIntArray (32, 0); +}); +Clazz_defineMethod (c$, "getListener", +function () { +return this.listener; +}); +Clazz_defineMethod (c$, "getEventMask", +function () { +return this.eventMask; +}); +Clazz_defineMethod (c$, "getCalls", +function () { +return this.calls; +}); +Clazz_defineMethod (c$, "orEventMasks", +function (a) { +this.eventMask |= a; +for (var b = 0; b < 32; b++) { +if (a == 0) { +break; +}if ((a & 1) != 0) { +this.calls[b]++; +}a >>>= 1; +} +}, "~N"); +Clazz_makeConstructor (c$, +function (a, b) { +this.listener = a; +this.eventMask = b; +}, "java.awt.event.AWTEventListener,~N"); +Clazz_defineMethod (c$, "eventDispatched", +function (a) { +var b = 0; +if (((b = this.eventMask & 1) != 0 && a.id >= 100 && a.id <= 103) || ((b = this.eventMask & 2) != 0 && a.id >= 300 && a.id <= 301) || ((b = this.eventMask & 4) != 0 && a.id >= 1004 && a.id <= 1005) || ((b = this.eventMask & 8) != 0 && a.id >= 400 && a.id <= 402) || ((b = this.eventMask & 131072) != 0 && a.id == 507) || ((b = this.eventMask & 32) != 0 && (a.id == 503 || a.id == 506)) || ((b = this.eventMask & 16) != 0 && a.id != 503 && a.id != 506 && a.id != 507 && a.id >= 500 && a.id <= 507) || ((b = this.eventMask & 64) != 0 && (a.id >= 200 && a.id <= 209)) || ((b = this.eventMask & 128) != 0 && a.id >= 1001 && a.id <= 1001) || ((b = this.eventMask & 256) != 0 && a.id >= 601 && a.id <= 601) || ((b = this.eventMask & 512) != 0 && a.id >= 701 && a.id <= 701) || ((b = this.eventMask & 1024) != 0 && a.id >= 900 && a.id <= 900) || ((b = this.eventMask & 2048) != 0 && a.id >= 1100 && a.id <= 1101) || ((b = this.eventMask & 8192) != 0 && a.id >= 800 && a.id <= 801) || ((b = this.eventMask & 16384) != 0 && a.id >= 1200 && a.id <= 1201) || ((b = this.eventMask & 32768) != 0 && a.id == 1400) || ((b = this.eventMask & 65536) != 0 && (a.id == 1401 || a.id == 1402)) || ((b = this.eventMask & 262144) != 0 && a.id == 209) || ((b = this.eventMask & 524288) != 0 && (a.id == 207 || a.id == 208))) { +var c = 0; +for (var d = b; d != 0; d >>>= 1, c++) { +} +c--; +for (var e = 0; e < this.calls[c]; e++) { +this.listener.eventDispatched (a); +} +}}, "java.awt.AWTEvent"); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.Toolkit, "ToolkitEventMulticaster", java.awt.AWTEventMulticaster, java.awt.event.AWTEventListener); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +if (a == null) return b; +if (b == null) return a; +return new java.awt.Toolkit.ToolkitEventMulticaster (a, b); +}, "java.awt.event.AWTEventListener,java.awt.event.AWTEventListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (a, b) { +return java.awt.AWTEventMulticaster.removeInternal (a, b); +}, "java.awt.event.AWTEventListener,java.awt.event.AWTEventListener"); +Clazz_defineMethod (c$, "remove", +function (a) { +if (a === this.a) return this.b; +if (a === this.b) return this.a; +var b = java.awt.AWTEventMulticaster.removeInternal (this.a, a); +var c = java.awt.AWTEventMulticaster.removeInternal (this.b, a); +if (b === this.a && c === this.b) { +return this; +}return java.awt.Toolkit.ToolkitEventMulticaster.add (b, c); +}, "java.util.EventListener"); +Clazz_defineMethod (c$, "eventDispatched", +function (a) { +(this.a).eventDispatched (a); +(this.b).eventDispatched (a); +}, "java.awt.AWTEvent"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"lightweightMarker", null, +"toolkit", null, +"resources", null, +"LONG_BITS", 32, +"enabledOnToolkitMask", 0); +}); +Clazz_declarePackage ("java.lang"); +Clazz_load (["java.lang.Enum"], "java.lang.Thread", ["java.lang.Exception", "$.IllegalArgumentException", "$.IllegalThreadStateException", "$.NoSuchMethodError", "$.NullPointerException", "$.ThreadDeath", "java.util.HashMap", "java.lang.ThreadGroup", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.name = null; +this.priority = 5; +this.daemon = false; +this.target = null; +this.group = null; +this.tid = 0; +this.threadStatus = 0; +this.parkBlocker = null; +this.stopBeforeStart = false; +this.throwableFromStop = null; +this.me = null; +this.uncaughtExceptionHandler = null; +this.$interrupted = false; +this.stopped = false; +Clazz_instantialize (this, arguments); +}, java.lang, "Thread", null, Runnable); +c$.nextThreadNum = Clazz_defineMethod (c$, "nextThreadNum", + function () { +return java.lang.Thread.threadInitNumber++; +}); +c$.nextThreadID = Clazz_defineMethod (c$, "nextThreadID", + function () { +return ++java.lang.Thread.threadSeqNumber; +}); +c$.currentThread = Clazz_defineMethod (c$, "currentThread", +function () { +if (java.lang.Thread.thisThread == null) { +java.lang.Thread.thisThread = new java.lang.Thread ("master"); +java.lang.Thread.thisThread.setPriority (5); +}return java.lang.Thread.thisThread; +}); +c$.yield = Clazz_defineMethod (c$, "yield", +function () { +}); +c$.sleep = Clazz_defineMethod (c$, "sleep", +function (millis) { +}, "~N"); +c$.sleep = Clazz_defineMethod (c$, "sleep", +function (millis, nanos) { +if (millis < 0) { +throw new IllegalArgumentException ("timeout value is negative"); +}if (nanos < 0 || nanos > 999999) { +throw new IllegalArgumentException ("nanosecond timeout value out of range"); +}if (nanos >= 500000 || (nanos != 0 && millis == 0)) { +millis++; +}java.lang.Thread.sleep (millis); +}, "~N,~N"); +Clazz_defineMethod (c$, "init", + function (g, target, name, stackSize) { +this.init (g, target, name, stackSize, null); +}, "java.lang.ThreadGroup,Runnable,~S,~N"); +Clazz_defineMethod (c$, "init", + function (g, target, name, stackSize, acc) { +var parent = (java.lang.Thread.thisThread == null ? null : java.lang.Thread.thisThread); +if (g == null) { +if (g == null && parent != null) { +g = parent.getThreadGroup (); +}}if (g == null) { +g = this.newThreadGroup (null, name); +parent = this; +}g.checkAccess (); +g.addUnstarted (); +this.group = g; +this.priority = parent.getPriority (); +this.name = name; +this.target = target; +this.setPriority (this.priority); +this.tid = java.lang.Thread.nextThreadID (); +this.me = this; +}, "java.lang.ThreadGroup,Runnable,~S,~N,~O"); +Clazz_defineMethod (c$, "newThreadGroup", +function (group, name) { +return new java.lang.ThreadGroup (group, name); +}, "java.lang.ThreadGroup,~S"); +Clazz_makeConstructor (c$, +function () { +this.init (null, null, "Thread-" + java.lang.Thread.nextThreadNum (), 0); +}); +Clazz_makeConstructor (c$, +function (target) { +this.init (null, target, "Thread-" + java.lang.Thread.nextThreadNum (), 0); +}, "Runnable"); +Clazz_makeConstructor (c$, +function (group, target) { +this.init (group, target, "Thread-" + java.lang.Thread.nextThreadNum (), 0); +}, "java.lang.ThreadGroup,Runnable"); +Clazz_makeConstructor (c$, +function (name) { +this.init (null, null, name, 0); +}, "~S"); +Clazz_makeConstructor (c$, +function (group, name) { +this.init (group, null, name, 0); +}, "java.lang.ThreadGroup,~S"); +Clazz_makeConstructor (c$, +function (target, name) { +this.init (null, target, name, 0); +}, "Runnable,~S"); +Clazz_makeConstructor (c$, +function (group, target, name) { +this.init (group, target, name, 0); +}, "java.lang.ThreadGroup,Runnable,~S"); +Clazz_makeConstructor (c$, +function (group, target, name, stackSize) { +this.init (group, target, name, stackSize); +}, "java.lang.ThreadGroup,Runnable,~S,~N"); +Clazz_defineMethod (c$, "start", +function () { +if (this.threadStatus != 0 || this !== this.me) throw new IllegalThreadStateException (); +this.group.add (this); +this.start0 (); +if (this.stopBeforeStart) { +this.stop0 (this.throwableFromStop); +}}); +Clazz_defineMethod (c$, "start0", + function () { +}); +Clazz_defineMethod (c$, "run", +function () { +if (this.target != null) { +this.target.run (); +}}); +Clazz_defineMethod (c$, "stop", +function () { +if ((this.threadStatus != 0) && !this.isAlive ()) { +return; +}this.stop1 ( new ThreadDeath ()); +}); +Clazz_defineMethod (c$, "stop", +function (obj) { +this.stop1 (obj); +}, "Throwable"); +Clazz_defineMethod (c$, "stop1", + function (th) { +if (this.threadStatus != 0) { +this.resume (); +this.stop0 (th); +} else { +if (th == null) { +throw new NullPointerException (); +}this.stopBeforeStart = true; +this.throwableFromStop = th; +}}, "Throwable"); +Clazz_defineMethod (c$, "interrupt", +function () { +this.interrupt0 (); +}); +c$.interrupted = Clazz_defineMethod (c$, "interrupted", +function () { +return java.lang.Thread.currentThread ().isInterruptedB (true); +}); +Clazz_defineMethod (c$, "isInterrupted", +function () { +return this.isInterruptedB (false); +}); +Clazz_defineMethod (c$, "isInterruptedB", + function (clearInterrupted) { +var wasInt = this.$interrupted; +if (clearInterrupted) this.$interrupted = false; +return wasInt; +}, "~B"); +Clazz_defineMethod (c$, "destroy", +function () { +throw new NoSuchMethodError (); +}); +Clazz_defineMethod (c$, "isAlive", +function () { +return true; +}); +Clazz_defineMethod (c$, "suspend", +function () { +this.checkAccess (); +this.suspend0 (); +}); +Clazz_defineMethod (c$, "resume", +function () { +this.checkAccess (); +this.resume0 (); +}); +Clazz_defineMethod (c$, "setPriority", +function (newPriority) { +var g; +this.checkAccess (); +if (newPriority > 10 || newPriority < 1) { +throw new IllegalArgumentException (); +}if ((g = this.getThreadGroup ()) != null) { +if (newPriority > g.getMaxPriority ()) { +newPriority = g.getMaxPriority (); +}this.setPriority0 (this.priority = newPriority); +}}, "~N"); +Clazz_defineMethod (c$, "getPriority", +function () { +return this.priority; +}); +Clazz_defineMethod (c$, "setName", +function (name) { +this.checkAccess (); +this.name = name; +}, "~S"); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getThreadGroup", +function () { +return this.group; +}); +c$.activeCount = Clazz_defineMethod (c$, "activeCount", +function () { +return java.lang.Thread.currentThread ().getThreadGroup ().activeCount (); +}); +c$.enumerate = Clazz_defineMethod (c$, "enumerate", +function (tarray) { +return java.lang.Thread.currentThread ().getThreadGroup ().enumerate (tarray); +}, "~A"); +Clazz_defineMethod (c$, "countStackFrames", +function () { +return 0; +}); +Clazz_defineMethod (c$, "join", +function (millis) { +var base = System.currentTimeMillis (); +var now = 0; +if (millis < 0) { +throw new IllegalArgumentException ("timeout value is negative"); +}swingjs.JSToolkit.warn ("Cannot wait in Thread"); +if (millis == 0) { +while (this.isAlive ()) { +this.wait (0); +} +} else { +while (this.isAlive ()) { +var delay = millis - now; +if (delay <= 0) { +break; +}this.wait (delay); +now = System.currentTimeMillis () - base; +} +}}, "~N"); +Clazz_defineMethod (c$, "join", +function (millis, nanos) { +if (millis < 0) { +throw new IllegalArgumentException ("timeout value is negative"); +}if (nanos < 0 || nanos > 999999) { +throw new IllegalArgumentException ("nanosecond timeout value out of range"); +}if (nanos >= 500000 || (nanos != 0 && millis == 0)) { +millis++; +}this.join (millis); +}, "~N,~N"); +Clazz_defineMethod (c$, "join", +function () { +this.join (0); +}); +c$.dumpStack = Clazz_defineMethod (c$, "dumpStack", +function () { + new Exception ("Stack trace").printStackTrace (); +}); +Clazz_defineMethod (c$, "setDaemon", +function (on) { +this.checkAccess (); +if (this.isAlive ()) { +throw new IllegalThreadStateException (); +}this.daemon = on; +}, "~B"); +Clazz_defineMethod (c$, "isDaemon", +function () { +return this.daemon; +}); +Clazz_defineMethod (c$, "checkAccess", +function () { +}); +Clazz_overrideMethod (c$, "toString", +function () { +var group = this.getThreadGroup (); +if (group != null) { +return "Thread[" + this.getName () + "," + this.getPriority () + "," + group.getName () + "]"; +} else { +return "Thread[" + this.getName () + "," + this.getPriority () + "," + "" + "]"; +}}); +Clazz_defineMethod (c$, "getContextClassLoader", +function () { +return null; +}); +Clazz_defineMethod (c$, "setContextClassLoader", +function (cl) { +}, "ClassLoader"); +c$.holdsLock = Clazz_defineMethod (c$, "holdsLock", +function (obj) { +return false; +}, "~O"); +Clazz_defineMethod (c$, "getStackTrace", +function () { +return ( new Exception ()).getStackTrace (); +}); +c$.getAllStackTraces = Clazz_defineMethod (c$, "getAllStackTraces", +function () { +var threads = java.lang.Thread.getThreads (); +var traces = java.lang.Thread.dumpThreads (threads); +var m = new java.util.HashMap (threads.length); +for (var i = 0; i < threads.length; i++) { +var stackTrace = traces[i]; +if (stackTrace != null) { +m.put (threads[i], stackTrace); +}} +return m; +}); +c$.dumpThreads = Clazz_defineMethod (c$, "dumpThreads", + function (threads) { +return null; +}, "~A"); +c$.getThreads = Clazz_defineMethod (c$, "getThreads", + function () { +return null; +}); +Clazz_defineMethod (c$, "getId", +function () { +return this.tid; +}); +Clazz_defineMethod (c$, "getState", +function () { +switch (this.threadStatus) { +case 0: +return java.lang.Thread.State.NEW; +case 1: +return java.lang.Thread.State.RUNNABLE; +case 2: +default: +return java.lang.Thread.State.TERMINATED; +case 3: +return java.lang.Thread.State.TIMED_WAITING; +case 4: +return java.lang.Thread.State.WAITING; +} +}); +c$.setDefaultUncaughtExceptionHandler = Clazz_defineMethod (c$, "setDefaultUncaughtExceptionHandler", +function (eh) { +java.lang.Thread.defaultUncaughtExceptionHandler = eh; +}, "java.lang.Thread.UncaughtExceptionHandler"); +c$.getDefaultUncaughtExceptionHandler = Clazz_defineMethod (c$, "getDefaultUncaughtExceptionHandler", +function () { +return java.lang.Thread.defaultUncaughtExceptionHandler; +}); +Clazz_defineMethod (c$, "getUncaughtExceptionHandler", +function () { +return this.uncaughtExceptionHandler != null ? this.uncaughtExceptionHandler : this.group; +}); +Clazz_defineMethod (c$, "setUncaughtExceptionHandler", +function (eh) { +this.checkAccess (); +this.uncaughtExceptionHandler = eh; +}, "java.lang.Thread.UncaughtExceptionHandler"); +Clazz_defineMethod (c$, "setPriority0", + function (newPriority) { +}, "~N"); +Clazz_defineMethod (c$, "stop0", + function (o) { +this.stopped = true; +}, "~O"); +Clazz_defineMethod (c$, "suspend0", + function () { +}); +Clazz_defineMethod (c$, "resume0", + function () { +}); +Clazz_defineMethod (c$, "interrupt0", + function () { +this.$interrupted = true; +}); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.lang.Thread, "State", Enum); +Clazz_defineEnumConstant (c$, "NEW", 0, []); +Clazz_defineEnumConstant (c$, "RUNNABLE", 1, []); +Clazz_defineEnumConstant (c$, "BLOCKED", 2, []); +Clazz_defineEnumConstant (c$, "WAITING", 3, []); +Clazz_defineEnumConstant (c$, "TIMED_WAITING", 4, []); +Clazz_defineEnumConstant (c$, "TERMINATED", 5, []); +c$ = Clazz_p0p (); +Clazz_declareInterface (java.lang.Thread, "UncaughtExceptionHandler"); +Clazz_defineStatics (c$, +"threadInitNumber", 0, +"threadSeqNumber", 0, +"thisThread", null, +"MIN_PRIORITY", 1, +"NORM_PRIORITY", 5, +"MAX_PRIORITY", 10, +"defaultUncaughtExceptionHandler", null); +}); +Clazz_declarePackage ("java.lang"); +Clazz_load (["java.lang.Thread"], "java.lang.ThreadGroup", ["java.lang.IllegalThreadStateException", "$.ThreadDeath", "java.util.Arrays"], function () { +c$ = Clazz_decorateAsClass (function () { +this.parent = null; +this.name = null; +this.maxPriority = 10; +this.destroyed = false; +this.daemon = false; +this.vmAllowSuspension = false; +this.nUnstartedThreads = 0; +this.nthreads = 0; +this.threads = null; +this.ngroups = 0; +this.groups = null; +this.html5Applet = null; +Clazz_instantialize (this, arguments); +}, java.lang, "ThreadGroup", null, java.lang.Thread.UncaughtExceptionHandler); +Clazz_makeConstructor (c$, +function (name) { +this.construct (java.lang.Thread.currentThread ().getThreadGroup (), name); +}, "~S"); +Clazz_makeConstructor (c$, +function (parent, name) { +this.name = name; +this.parent = parent; +if (parent != null) { +this.maxPriority = parent.maxPriority; +this.daemon = parent.daemon; +this.vmAllowSuspension = parent.vmAllowSuspension; +parent.add (this); +}}, "java.lang.ThreadGroup,~S"); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getParent", +function () { +if (this.parent != null) this.parent.checkAccess (); +return this.parent; +}); +Clazz_defineMethod (c$, "getMaxPriority", +function () { +return this.maxPriority; +}); +Clazz_defineMethod (c$, "isDaemon", +function () { +return this.daemon; +}); +Clazz_defineMethod (c$, "isDestroyed", +function () { +return this.destroyed; +}); +Clazz_defineMethod (c$, "setDaemon", +function (daemon) { +this.checkAccess (); +this.daemon = daemon; +}, "~B"); +Clazz_defineMethod (c$, "setMaxPriority", +function (pri) { +var ngroupsSnapshot; +var groupsSnapshot; +{ +this.checkAccess (); +if (pri < 1 || pri > 10) { +return; +}this.maxPriority = (this.parent != null) ? Math.min (pri, this.parent.maxPriority) : pri; +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}for (var i = 0; i < ngroupsSnapshot; i++) { +groupsSnapshot[i].setMaxPriority (pri); +} +}, "~N"); +Clazz_defineMethod (c$, "parentOf", +function (g) { +for (; g != null; g = g.parent) { +if (g === this) { +return true; +}} +return false; +}, "java.lang.ThreadGroup"); +Clazz_defineMethod (c$, "checkAccess", +function () { +}); +Clazz_defineMethod (c$, "activeCount", +function () { +var result; +var ngroupsSnapshot; +var groupsSnapshot; +{ +if (this.destroyed) { +return 0; +}result = this.nthreads; +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}for (var i = 0; i < ngroupsSnapshot; i++) { +result += groupsSnapshot[i].activeCount (); +} +return result; +}); +Clazz_defineMethod (c$, "enumerate", +function (list) { +this.checkAccess (); +return this.enumerate (list, 0, true); +}, "~A"); +Clazz_defineMethod (c$, "enumerate", +function (list, recurse) { +this.checkAccess (); +return this.enumerate (list, 0, recurse); +}, "~A,~B"); +Clazz_defineMethod (c$, "enumerate", + function (list, n, recurse) { +var ngroupsSnapshot = 0; +var groupsSnapshot = null; +{ +if (this.destroyed) { +return 0; +}var nt = this.nthreads; +if (nt > list.length - n) { +nt = list.length - n; +}for (var i = 0; i < nt; i++) { +if (this.threads[i].isAlive ()) { +list[n++] = this.threads[i]; +}} +if (recurse) { +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}}if (recurse) { +for (var i = 0; i < ngroupsSnapshot; i++) { +n = groupsSnapshot[i].enumerate (list, n, true); +} +}return n; +}, "~A,~N,~B"); +Clazz_defineMethod (c$, "activeGroupCount", +function () { +var ngroupsSnapshot; +var groupsSnapshot; +{ +if (this.destroyed) { +return 0; +}ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}var n = ngroupsSnapshot; +for (var i = 0; i < ngroupsSnapshot; i++) { +n += groupsSnapshot[i].activeGroupCount (); +} +return n; +}); +Clazz_defineMethod (c$, "enumerate", +function (list) { +this.checkAccess (); +return this.enumerate (list, 0, true); +}, "~A"); +Clazz_defineMethod (c$, "enumerate", +function (list, recurse) { +this.checkAccess (); +return this.enumerate (list, 0, recurse); +}, "~A,~B"); +Clazz_defineMethod (c$, "enumerate", + function (list, n, recurse) { +var ngroupsSnapshot = 0; +var groupsSnapshot = null; +{ +if (this.destroyed) { +return 0; +}var ng = this.ngroups; +if (ng > list.length - n) { +ng = list.length - n; +}if (ng > 0) { +System.arraycopy (this.groups, 0, list, n, ng); +n += ng; +}if (recurse) { +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}}if (recurse) { +for (var i = 0; i < ngroupsSnapshot; i++) { +n = groupsSnapshot[i].enumerate (list, n, true); +} +}return n; +}, "~A,~N,~B"); +Clazz_defineMethod (c$, "stop", +function () { +if (this.stopOrSuspend (false)) java.lang.Thread.currentThread ().stop (); +}); +Clazz_defineMethod (c$, "interrupt", +function () { +var ngroupsSnapshot; +var groupsSnapshot; +{ +this.checkAccess (); +for (var i = 0; i < this.nthreads; i++) { +this.threads[i].interrupt (); +} +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}for (var i = 0; i < ngroupsSnapshot; i++) { +groupsSnapshot[i].interrupt (); +} +}); +Clazz_defineMethod (c$, "suspend", +function () { +if (this.stopOrSuspend (true)) java.lang.Thread.currentThread ().suspend (); +}); +Clazz_defineMethod (c$, "stopOrSuspend", + function (suspend) { +var suicide = false; +var us = java.lang.Thread.currentThread (); +var ngroupsSnapshot; +var groupsSnapshot = null; +{ +this.checkAccess (); +for (var i = 0; i < this.nthreads; i++) { +if (this.threads[i] === us) suicide = true; + else if (suspend) this.threads[i].suspend (); + else this.threads[i].stop (); +} +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +}}for (var i = 0; i < ngroupsSnapshot; i++) suicide = groupsSnapshot[i].stopOrSuspend (suspend) || suicide; + +return suicide; +}, "~B"); +Clazz_defineMethod (c$, "resume", +function () { +var ngroupsSnapshot; +var groupsSnapshot; +{ +this.checkAccess (); +for (var i = 0; i < this.nthreads; i++) { +this.threads[i].resume (); +} +ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}}for (var i = 0; i < ngroupsSnapshot; i++) { +groupsSnapshot[i].resume (); +} +}); +Clazz_defineMethod (c$, "destroy", +function () { +var ngroupsSnapshot; +var groupsSnapshot; +{ +this.checkAccess (); +if (this.destroyed || (this.nthreads > 0)) { +throw new IllegalThreadStateException (); +}ngroupsSnapshot = this.ngroups; +if (this.groups != null) { +groupsSnapshot = java.util.Arrays.copyOf (this.groups, ngroupsSnapshot); +} else { +groupsSnapshot = null; +}if (this.parent != null) { +this.destroyed = true; +this.ngroups = 0; +this.groups = null; +this.nthreads = 0; +this.threads = null; +}}for (var i = 0; i < ngroupsSnapshot; i += 1) { +groupsSnapshot[i].destroy (); +} +if (this.parent != null) { +this.parent.remove (this); +}}); +Clazz_defineMethod (c$, "add", + function (g) { +{ +if (this.destroyed) { +throw new IllegalThreadStateException (); +}if (this.groups == null) { +this.groups = new Array (4); +} else if (this.ngroups == this.groups.length) { +this.groups = java.util.Arrays.copyOf (this.groups, this.ngroups * 2); +}this.groups[this.ngroups] = g; +this.ngroups++; +}}, "java.lang.ThreadGroup"); +Clazz_defineMethod (c$, "remove", + function (g) { +{ +if (this.destroyed) { +return; +}for (var i = 0; i < this.ngroups; i++) { +if (this.groups[i] === g) { +this.ngroups -= 1; +System.arraycopy (this.groups, i + 1, this.groups, i, this.ngroups - i); +this.groups[this.ngroups] = null; +break; +}} +if (this.nthreads == 0) { +this.notifyAll (); +}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) { +this.destroy (); +}}}, "java.lang.ThreadGroup"); +Clazz_defineMethod (c$, "addUnstarted", +function () { +{ +if (this.destroyed) { +throw new IllegalThreadStateException (); +}this.nUnstartedThreads++; +}}); +Clazz_defineMethod (c$, "add", +function (t) { +{ +if (this.destroyed) { +throw new IllegalThreadStateException (); +}if (this.threads == null) { +this.threads = new Array (4); +} else if (this.nthreads == this.threads.length) { +this.threads = java.util.Arrays.copyOf (this.threads, this.nthreads * 2); +}this.threads[this.nthreads] = t; +this.nthreads++; +this.nUnstartedThreads--; +}}, "java.lang.Thread"); +Clazz_defineMethod (c$, "remove", +function (t) { +{ +if (this.destroyed) { +return; +}for (var i = 0; i < this.nthreads; i++) { +if (this.threads[i] === t) { +System.arraycopy (this.threads, i + 1, this.threads, i, --this.nthreads - i); +this.threads[this.nthreads] = null; +break; +}} +if (this.nthreads == 0) { +this.notifyAll (); +}if (this.daemon && (this.nthreads == 0) && (this.nUnstartedThreads == 0) && (this.ngroups == 0)) { +this.destroy (); +}}}, "java.lang.Thread"); +Clazz_defineMethod (c$, "uncaughtException", +function (t, e) { +if (this.parent != null) { +this.parent.uncaughtException (t, e); +} else { +var ueh = java.lang.Thread.getDefaultUncaughtExceptionHandler (); +if (ueh != null) { +ueh.uncaughtException (t, e); +} else if (!(Clazz_instanceOf (e, ThreadDeath))) { +System.err.print ("Exception in thread \"" + t.getName () + "\" "); +e.printStackTrace (System.err); +}}}, "java.lang.Thread,Throwable"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[name=" + this.getName () + ",maxpri=" + this.maxPriority + ",html5Applet=" + this.html5Applet + "]"; +}); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.LayoutManager"], "java.awt.FlowLayout", ["java.awt.Dimension"], function () { +c$ = Clazz_decorateAsClass (function () { +this.align = 0; +this.newAlign = 0; +this.hgap = 0; +this.vgap = 0; +this.alignOnBaseline = false; +Clazz_instantialize (this, arguments); +}, java.awt, "FlowLayout", null, [java.awt.LayoutManager, java.io.Serializable]); +Clazz_makeConstructor (c$, +function () { +this.construct (1, 5, 5); +}); +Clazz_makeConstructor (c$, +function (align) { +this.construct (align, 5, 5); +}, "~N"); +Clazz_makeConstructor (c$, +function (align, hgap, vgap) { +this.hgap = hgap; +this.vgap = vgap; +this.setAlignment (align); +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "getAlignment", +function () { +return this.newAlign; +}); +Clazz_defineMethod (c$, "setAlignment", +function (align) { +this.newAlign = align; +switch (align) { +case 3: +this.align = 0; +break; +case 4: +this.align = 2; +break; +default: +this.align = align; +break; +} +}, "~N"); +Clazz_defineMethod (c$, "getHgap", +function () { +return this.hgap; +}); +Clazz_defineMethod (c$, "setHgap", +function (hgap) { +this.hgap = hgap; +}, "~N"); +Clazz_defineMethod (c$, "getVgap", +function () { +return this.vgap; +}); +Clazz_defineMethod (c$, "setVgap", +function (vgap) { +this.vgap = vgap; +}, "~N"); +Clazz_defineMethod (c$, "setAlignOnBaseline", +function (alignOnBaseline) { +this.alignOnBaseline = alignOnBaseline; +}, "~B"); +Clazz_defineMethod (c$, "getAlignOnBaseline", +function () { +return this.alignOnBaseline; +}); +Clazz_overrideMethod (c$, "addLayoutComponent", +function (name, comp) { +}, "~S,java.awt.Component"); +Clazz_overrideMethod (c$, "removeLayoutComponent", +function (comp) { +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "preferredLayoutSize", +function (target) { +{ +var dim = new java.awt.Dimension (0, 0); +var nmembers = target.getComponentCount (); +var firstVisibleComponent = true; +var useBaseline = this.getAlignOnBaseline (); +var maxAscent = 0; +var maxDescent = 0; +for (var i = 0; i < nmembers; i++) { +var m = target.getComponent (i); +if (m.isVisible ()) { +var d = m.getPreferredSize (); +dim.height = Math.max (dim.height, d.height); +if (firstVisibleComponent) { +firstVisibleComponent = false; +} else { +dim.width += this.hgap; +}dim.width += d.width; +if (useBaseline) { +var baseline = m.getBaseline (d.width, d.height); +if (baseline >= 0) { +maxAscent = Math.max (maxAscent, baseline); +maxDescent = Math.max (maxDescent, d.height - baseline); +}}}} +if (useBaseline) { +dim.height = Math.max (maxAscent + maxDescent, dim.height); +}var insets = target.getInsets (); +dim.width += insets.left + insets.right + this.hgap * 2; +dim.height += insets.top + insets.bottom + this.vgap * 2; +return dim; +}}, "java.awt.Container"); +Clazz_overrideMethod (c$, "minimumLayoutSize", +function (target) { +{ +var useBaseline = this.getAlignOnBaseline (); +var dim = new java.awt.Dimension (0, 0); +var nmembers = target.getComponentCount (); +var maxAscent = 0; +var maxDescent = 0; +var firstVisibleComponent = true; +for (var i = 0; i < nmembers; i++) { +var m = target.getComponent (i); +if (m.visible) { +var d = m.getMinimumSize (); +dim.height = Math.max (dim.height, d.height); +if (firstVisibleComponent) { +firstVisibleComponent = false; +} else { +dim.width += this.hgap; +}dim.width += d.width; +if (useBaseline) { +var baseline = m.getBaseline (d.width, d.height); +if (baseline >= 0) { +maxAscent = Math.max (maxAscent, baseline); +maxDescent = Math.max (maxDescent, dim.height - baseline); +}}}} +if (useBaseline) { +dim.height = Math.max (maxAscent + maxDescent, dim.height); +}var insets = target.getInsets (); +dim.width += insets.left + insets.right + this.hgap * 2; +dim.height += insets.top + insets.bottom + this.vgap * 2; +return dim; +}}, "java.awt.Container"); +Clazz_defineMethod (c$, "moveComponents", + function (target, x, y, width, height, rowStart, rowEnd, ltr, useBaseline, ascent, descent) { +switch (this.newAlign) { +case 0: +x += ltr ? 0 : width; +break; +case 1: +x += Clazz_doubleToInt (width / 2); +break; +case 2: +x += ltr ? width : 0; +break; +case 3: +break; +case 4: +x += width; +break; +} +var maxAscent = 0; +var nonbaselineHeight = 0; +var baselineOffset = 0; +if (useBaseline) { +var maxDescent = 0; +for (var i = rowStart; i < rowEnd; i++) { +var m = target.getComponent (i); +if (m.visible) { +if (ascent[i] >= 0) { +maxAscent = Math.max (maxAscent, ascent[i]); +maxDescent = Math.max (maxDescent, descent[i]); +} else { +nonbaselineHeight = Math.max (m.getHeight (), nonbaselineHeight); +}}} +height = Math.max (maxAscent + maxDescent, nonbaselineHeight); +baselineOffset = Clazz_doubleToInt ((height - maxAscent - maxDescent) / 2); +}for (var i = rowStart; i < rowEnd; i++) { +var m = target.getComponent (i); +if (m.isVisible ()) { +var cy; +if (useBaseline && ascent[i] >= 0) { +cy = y + baselineOffset + maxAscent - ascent[i]; +} else { +cy = y + Clazz_doubleToInt ((height - m.height) / 2); +}if (ltr) { +m.setLocation (x, cy); +} else { +m.setLocation (target.width - x - m.width, cy); +}x += m.width + this.hgap; +}} +return height; +}, "java.awt.Container,~N,~N,~N,~N,~N,~N,~B,~B,~A,~A"); +Clazz_overrideMethod (c$, "layoutContainer", +function (target) { +System.out.println ("FlowLayout laying out " + target); +{ +var insets = target.getInsets (); +var maxwidth = target.width - (insets.left + insets.right + this.hgap * 2); +var nmembers = target.getComponentCount (); +var x = 0; +var y = insets.top + this.vgap; +var rowh = 0; +var start = 0; +var ltr = target.getComponentOrientation ().isLeftToRight (); +var useBaseline = this.getAlignOnBaseline (); +var ascent = null; +var descent = null; +if (useBaseline) { +ascent = Clazz_newIntArray (nmembers, 0); +descent = Clazz_newIntArray (nmembers, 0); +}for (var i = 0; i < nmembers; i++) { +var m = target.getComponent (i); +if (m.isVisible ()) { +var d = m.getPreferredSize (); +m.setSize (d.width, d.height); +if (useBaseline) { +var baseline = m.getBaseline (d.width, d.height); +if (baseline >= 0) { +ascent[i] = baseline; +descent[i] = d.height - baseline; +} else { +ascent[i] = -1; +}}if ((x == 0) || ((x + d.width) <= maxwidth)) { +if (x > 0) { +x += this.hgap; +}x += d.width; +rowh = Math.max (rowh, d.height); +} else { +rowh = this.moveComponents (target, insets.left + this.hgap, y, maxwidth - x, rowh, start, i, ltr, useBaseline, ascent, descent); +x = d.width; +y += this.vgap + rowh; +rowh = d.height; +start = i; +}}} +this.moveComponents (target, insets.left + this.hgap, y, maxwidth - x, rowh, start, nmembers, ltr, useBaseline, ascent, descent); +}}, "java.awt.Container"); +Clazz_overrideMethod (c$, "toString", +function () { +var str = ""; +switch (this.align) { +case 0: +str = ",align=left"; +break; +case 1: +str = ",align=center"; +break; +case 2: +str = ",align=right"; +break; +case 3: +str = ",align=leading"; +break; +case 4: +str = ",align=trailing"; +break; +} +return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + str + "]"; +}); +Clazz_defineStatics (c$, +"LEFT", 0, +"CENTER", 1, +"RIGHT", 2, +"LEADING", 3, +"TRAILING", 4); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.LayoutManager2"], "java.awt.BorderLayout", ["java.lang.IllegalArgumentException", "java.awt.Dimension"], function () { +c$ = Clazz_decorateAsClass (function () { +this.hgap = 0; +this.vgap = 0; +this.north = null; +this.west = null; +this.east = null; +this.south = null; +this.center = null; +this.firstLine = null; +this.lastLine = null; +this.firstItem = null; +this.lastItem = null; +Clazz_instantialize (this, arguments); +}, java.awt, "BorderLayout", null, [java.awt.LayoutManager2, java.io.Serializable]); +Clazz_makeConstructor (c$, +function () { +this.construct (0, 0); +}); +Clazz_makeConstructor (c$, +function (hgap, vgap) { +this.hgap = hgap; +this.vgap = vgap; +}, "~N,~N"); +Clazz_defineMethod (c$, "getHgap", +function () { +return this.hgap; +}); +Clazz_defineMethod (c$, "setHgap", +function (hgap) { +this.hgap = hgap; +}, "~N"); +Clazz_defineMethod (c$, "getVgap", +function () { +return this.vgap; +}); +Clazz_defineMethod (c$, "setVgap", +function (vgap) { +this.vgap = vgap; +}, "~N"); +Clazz_defineMethod (c$, "addLayoutComponent", +function (comp, constraints) { +{ +if ((constraints == null) || (Clazz_instanceOf (constraints, String))) { +this.addLayoutComponent (constraints, comp); +} else { +throw new IllegalArgumentException ("cannot add to layout: constraint must be a string (or null)"); +}}}, "java.awt.Component,~O"); +Clazz_defineMethod (c$, "addLayoutComponent", +function (name, comp) { +{ +if (name == null) { +name = "Center"; +}System.out.println ("BorderLayout adding " + name + " " + comp); +if ("Center".equals (name)) { +this.center = comp; +} else if ("North".equals (name)) { +this.north = comp; +} else if ("South".equals (name)) { +this.south = comp; +} else if ("East".equals (name)) { +this.east = comp; +} else if ("West".equals (name)) { +this.west = comp; +} else if ("First".equals (name)) { +this.firstLine = comp; +} else if ("Last".equals (name)) { +this.lastLine = comp; +} else if ("Before".equals (name)) { +this.firstItem = comp; +} else if ("After".equals (name)) { +this.lastItem = comp; +} else { +throw new IllegalArgumentException ("cannot add to layout: unknown constraint: " + name); +}}}, "~S,java.awt.Component"); +Clazz_overrideMethod (c$, "removeLayoutComponent", +function (comp) { +{ +if (comp === this.center) { +this.center = null; +} else if (comp === this.north) { +this.north = null; +} else if (comp === this.south) { +this.south = null; +} else if (comp === this.east) { +this.east = null; +} else if (comp === this.west) { +this.west = null; +}if (comp === this.firstLine) { +this.firstLine = null; +} else if (comp === this.lastLine) { +this.lastLine = null; +} else if (comp === this.firstItem) { +this.firstItem = null; +} else if (comp === this.lastItem) { +this.lastItem = null; +}}}, "java.awt.Component"); +Clazz_defineMethod (c$, "getLayoutComponent", +function (constraints) { +if ("Center".equals (constraints)) { +return this.center; +} else if ("North".equals (constraints)) { +return this.north; +} else if ("South".equals (constraints)) { +return this.south; +} else if ("West".equals (constraints)) { +return this.west; +} else if ("East".equals (constraints)) { +return this.east; +} else if ("First".equals (constraints)) { +return this.firstLine; +} else if ("Last".equals (constraints)) { +return this.lastLine; +} else if ("Before".equals (constraints)) { +return this.firstItem; +} else if ("After".equals (constraints)) { +return this.lastItem; +} else { +throw new IllegalArgumentException ("cannot get component: unknown constraint: " + constraints); +}}, "~O"); +Clazz_defineMethod (c$, "getLayoutComponent", +function (target, constraints) { +var ltr = target.getComponentOrientation ().isLeftToRight (); +var result = null; +if ("North".equals (constraints)) { +result = (this.firstLine != null) ? this.firstLine : this.north; +} else if ("South".equals (constraints)) { +result = (this.lastLine != null) ? this.lastLine : this.south; +} else if ("West".equals (constraints)) { +result = ltr ? this.firstItem : this.lastItem; +if (result == null) { +result = this.west; +}} else if ("East".equals (constraints)) { +result = ltr ? this.lastItem : this.firstItem; +if (result == null) { +result = this.east; +}} else if ("Center".equals (constraints)) { +result = this.center; +} else { +throw new IllegalArgumentException ("cannot get component: invalid constraint: " + constraints); +}return result; +}, "java.awt.Container,~O"); +Clazz_defineMethod (c$, "getConstraints", +function (comp) { +if (comp == null) { +return null; +}if (comp === this.center) { +return "Center"; +} else if (comp === this.north) { +return "North"; +} else if (comp === this.south) { +return "South"; +} else if (comp === this.west) { +return "West"; +} else if (comp === this.east) { +return "East"; +} else if (comp === this.firstLine) { +return "First"; +} else if (comp === this.lastLine) { +return "Last"; +} else if (comp === this.firstItem) { +return "Before"; +} else if (comp === this.lastItem) { +return "After"; +}return null; +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "minimumLayoutSize", +function (target) { +{ +var dim = new java.awt.Dimension (0, 0); +var ltr = target.getComponentOrientation ().isLeftToRight (); +var c = null; +if ((c = this.getChild ("East", ltr)) != null) { +var d = c.getMinimumSize (); +dim.width += d.width + this.hgap; +dim.height = Math.max (d.height, dim.height); +}if ((c = this.getChild ("West", ltr)) != null) { +var d = c.getMinimumSize (); +dim.width += d.width + this.hgap; +dim.height = Math.max (d.height, dim.height); +}if ((c = this.getChild ("Center", ltr)) != null) { +var d = c.getMinimumSize (); +dim.width += d.width; +dim.height = Math.max (d.height, dim.height); +}if ((c = this.getChild ("North", ltr)) != null) { +var d = c.getMinimumSize (); +dim.width = Math.max (d.width, dim.width); +dim.height += d.height + this.vgap; +}if ((c = this.getChild ("South", ltr)) != null) { +var d = c.getMinimumSize (); +dim.width = Math.max (d.width, dim.width); +dim.height += d.height + this.vgap; +}var insets = target.getInsets (); +dim.width += insets.left + insets.right; +dim.height += insets.top + insets.bottom; +return dim; +}}, "java.awt.Container"); +Clazz_overrideMethod (c$, "preferredLayoutSize", +function (target) { +{ +var dim = new java.awt.Dimension (0, 0); +var ltr = target.getComponentOrientation ().isLeftToRight (); +var c = null; +if ((c = this.getChild ("East", ltr)) != null) { +var d = c.getPreferredSize (); +dim.width += d.width + this.hgap; +dim.height = Math.max (d.height, dim.height); +}if ((c = this.getChild ("West", ltr)) != null) { +var d = c.getPreferredSize (); +dim.width += d.width + this.hgap; +dim.height = Math.max (d.height, dim.height); +}if ((c = this.getChild ("Center", ltr)) != null) { +var d = c.getPreferredSize (); +dim.width += d.width; +dim.height = Math.max (d.height, dim.height); +}if ((c = this.getChild ("North", ltr)) != null) { +var d = c.getPreferredSize (); +dim.width = Math.max (d.width, dim.width); +dim.height += d.height + this.vgap; +}if ((c = this.getChild ("South", ltr)) != null) { +var d = c.getPreferredSize (); +dim.width = Math.max (d.width, dim.width); +dim.height += d.height + this.vgap; +}var insets = target.getInsets (); +dim.width += insets.left + insets.right; +dim.height += insets.top + insets.bottom; +return dim; +}}, "java.awt.Container"); +Clazz_overrideMethod (c$, "maximumLayoutSize", +function (target) { +return new java.awt.Dimension (2147483647, 2147483647); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayoutAlignmentX", +function (parent) { +return 0.5; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayoutAlignmentY", +function (parent) { +return 0.5; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "invalidateLayout", +function (target) { +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "layoutContainer", +function (target) { +System.out.println ("BorderLayout laying out " + target); +{ +var insets = target.getInsets (); +var top = insets.top; +var bottom = target.height - insets.bottom; +var left = insets.left; +var right = target.width - insets.right; +var ltr = target.getComponentOrientation ().isLeftToRight (); +var c = null; +if ((c = this.getChild ("North", ltr)) != null) { +c.setSize (right - left, c.height); +var d = c.getPreferredSize (); +c.setBounds (left, top, right - left, d.height); +top += d.height + this.vgap; +}if ((c = this.getChild ("South", ltr)) != null) { +c.setSize (right - left, c.height); +var d = c.getPreferredSize (); +c.setBounds (left, bottom - d.height, right - left, d.height); +bottom -= d.height + this.vgap; +}if ((c = this.getChild ("East", ltr)) != null) { +c.setSize (c.width, bottom - top); +var d = c.getPreferredSize (); +c.setBounds (right - d.width, top, d.width, bottom - top); +right -= d.width + this.hgap; +}if ((c = this.getChild ("West", ltr)) != null) { +c.setSize (c.width, bottom - top); +var d = c.getPreferredSize (); +c.setBounds (left, top, d.width, bottom - top); +left += d.width + this.hgap; +}if ((c = this.getChild ("Center", ltr)) != null) { +c.setBounds (left, top, right - left, bottom - top); +}}}, "java.awt.Container"); +Clazz_defineMethod (c$, "getChild", + function (key, ltr) { +var result = null; +if (key === "North") { +result = (this.firstLine != null) ? this.firstLine : this.north; +} else if (key === "South") { +result = (this.lastLine != null) ? this.lastLine : this.south; +} else if (key === "West") { +result = ltr ? this.firstItem : this.lastItem; +if (result == null) { +result = this.west; +}} else if (key === "East") { +result = ltr ? this.lastItem : this.firstItem; +if (result == null) { +result = this.east; +}} else if (key === "Center") { +result = this.center; +}if (result != null && !result.visible) { +result = null; +}return result; +}, "~S,~B"); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[hgap=" + this.hgap + ",vgap=" + this.vgap + "]"; +}); +Clazz_defineStatics (c$, +"NORTH", "North", +"SOUTH", "South", +"EAST", "East", +"WEST", "West", +"CENTER", "Center", +"BEFORE_FIRST_LINE", "First", +"AFTER_LAST_LINE", "Last", +"BEFORE_LINE_BEGINS", "Before", +"AFTER_LINE_ENDS", "After"); +c$.PAGE_START = c$.prototype.PAGE_START = "First"; +c$.PAGE_END = c$.prototype.PAGE_END = "Last"; +c$.LINE_START = c$.prototype.LINE_START = "Before"; +c$.LINE_END = c$.prototype.LINE_END = "After"; +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.LayoutManager"], "java.awt.LayoutManager2", null, function () { +Clazz_declareInterface (java.awt, "LayoutManager2", java.awt.LayoutManager); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "LayoutManager"); +Clazz_declarePackage ("java.awt"); +Clazz_load (["jssun.awt.SunGraphicsCallback"], "java.awt.GraphicsCallback", null, function () { +c$ = Clazz_declareType (java.awt, "GraphicsCallback", jssun.awt.SunGraphicsCallback); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.GraphicsCallback, "PaintCallback", java.awt.GraphicsCallback); +Clazz_makeConstructor (c$, + function () { +Clazz_superConstructor (this, java.awt.GraphicsCallback.PaintCallback, []); +}); +Clazz_overrideMethod (c$, "run", +function (a, b) { +a.paint (b); +}, "java.awt.Component,java.awt.Graphics"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function () { +return java.awt.GraphicsCallback.PaintCallback.instance; +}); +c$.instance = c$.prototype.instance = new java.awt.GraphicsCallback.PaintCallback (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.GraphicsCallback, "PaintAllCallback", java.awt.GraphicsCallback); +Clazz_makeConstructor (c$, + function () { +Clazz_superConstructor (this, java.awt.GraphicsCallback.PaintAllCallback, []); +}); +Clazz_overrideMethod (c$, "run", +function (a, b) { +a.paintAll (b); +}, "java.awt.Component,java.awt.Graphics"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function () { +return java.awt.GraphicsCallback.PaintAllCallback.instance; +}); +c$.instance = c$.prototype.instance = new java.awt.GraphicsCallback.PaintAllCallback (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.GraphicsCallback, "PaintHeavyweightComponentsCallback", java.awt.GraphicsCallback); +Clazz_makeConstructor (c$, + function () { +Clazz_superConstructor (this, java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback, []); +}); +Clazz_overrideMethod (c$, "run", +function (a, b) { +if (a.isLightweight ()) { +a.paintHeavyweightComponents (b); +} else { +a.paintAll (b); +}}, "java.awt.Component,java.awt.Graphics"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function () { +return java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback.instance; +}); +c$.instance = c$.prototype.instance = new java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback (); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.Component", "java.awt.event.AWTEventListener"], ["java.awt.LightweightDispatcher", "$.Container"], ["java.lang.ArrayIndexOutOfBoundsException", "$.IllegalArgumentException", "$.IllegalStateException", "java.util.ArrayList", "java.awt.AWTEventMulticaster", "$.Dimension", "$.GraphicsCallback", "$.Insets", "$.LayoutManager2", "$.Toolkit", "java.awt.event.ContainerEvent", "$.ContainerListener", "$.MouseEvent", "$.MouseWheelEvent", "java.awt.peer.ContainerPeer", "$.LightweightPeer"], function () { +c$ = Clazz_decorateAsClass (function () { +this.component = null; +this.layoutMgr = null; +this.dispatcher = null; +this.focusCycleRoot = false; +this.focusTraversalPolicyProvider = false; +this.containerListener = null; +this.listeningChildren = 0; +this.listeningBoundsChildren = 0; +this.descendantsCount = 0; +this.preserveBackgroundColor = null; +this.numOfHWComponents = 0; +this.numOfLWComponents = 0; +this.modalComp = null; +this.modalAppContext = null; +Clazz_instantialize (this, arguments); +}, java.awt, "Container", java.awt.Component); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.Container, []); +this.component = new java.util.ArrayList (); +}); +Clazz_defineMethod (c$, "initializeFocusTraversalKeys", +function () { +}); +Clazz_defineMethod (c$, "getComponentCount", +function () { +return this.countComponents (); +}); +Clazz_defineMethod (c$, "countComponents", +function () { +return this.component.size (); +}); +Clazz_defineMethod (c$, "getComponent", +function (n) { +if ((n < 0) || (n >= this.component.size ())) { +throw new ArrayIndexOutOfBoundsException ("No such child: " + n); +}return this.component.get (n); +}, "~N"); +Clazz_defineMethod (c$, "getComponents", +function () { +return this.getComponents_NoClientCode (); +}); +Clazz_defineMethod (c$, "getComponents_NoClientCode", +function () { +return this.component.toArray (java.awt.Container.EMPTY_ARRAY); +}); +Clazz_defineMethod (c$, "getInsets", +function () { +var peer = this.peer; +if (Clazz_instanceOf (peer, java.awt.peer.ContainerPeer)) { +var cpeer = peer; +return cpeer.getInsets ().clone (); +}return new java.awt.Insets (0, 0, 0, 0); +}); +Clazz_defineMethod (c$, "add", +function (comp) { +return this.addImpl (comp, null, -1); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "add", +function (name, comp) { +return this.addImpl (comp, name, -1); +}, "~S,java.awt.Component"); +Clazz_defineMethod (c$, "add", +function (comp, index) { +return this.addImpl (comp, null, index); +}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "checkAddToSelf", + function (comp) { +if (Clazz_instanceOf (comp, java.awt.Container)) { +for (var cn = this; cn != null; cn = cn.parent) { +if (cn === comp) { +throw new IllegalArgumentException ("adding container's parent to itself"); +}} +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "checkNotAWindow", + function (comp) { +if (Clazz_instanceOf (comp, java.awt.Window)) { +throw new IllegalArgumentException ("adding a window to a container"); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "removeDelicately", + function (comp, newParent, newIndex) { +var index = this.getComponentZOrder (comp); +var needRemoveNotify = java.awt.Container.isRemoveNotifyNeeded (comp, this, newParent); +if (needRemoveNotify) { +comp.removeNotify (); +}if (newParent !== this) { +if (this.layoutMgr != null) { +this.layoutMgr.removeLayoutComponent (comp); +}this.adjustListeningChildren (32768, -comp.numListening (32768)); +this.adjustListeningChildren (65536, -comp.numListening (65536)); +this.adjustDescendants (-(comp.countHierarchyMembers ())); +comp.parent = null; +this.component.remove (index); +this.invalidateIfValid (); +} else { +this.component.remove (index); +this.component.add (newIndex, comp); +}if (comp.parent == null) { +if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { +var e = new java.awt.event.ContainerEvent (this, 301, comp); +this.dispatchEvent (e); +}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); +if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { +this.updateCursorImmediately (); +}}return needRemoveNotify; +}, "java.awt.Component,java.awt.Container,~N"); +Clazz_defineMethod (c$, "canContainFocusOwner", +function (focusOwnerCandidate) { +if (!(this.isEnabled () && this.isDisplayable () && this.isVisible () && this.isFocusable ())) { +return false; +}{ +if (this.parent != null) { +return this.parent.canContainFocusOwner (focusOwnerCandidate); +}}return true; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "hasHeavyweightDescendants", +function () { +return this.numOfHWComponents > 0; +}); +Clazz_defineMethod (c$, "hasLightweightDescendants", +function () { +return this.numOfLWComponents > 0; +}); +Clazz_defineMethod (c$, "getHeavyweightContainer", +function () { +if (this.peer != null && !(Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer))) { +return this; +} else { +return this.getNativeContainer (); +}}); +c$.isRemoveNotifyNeeded = Clazz_defineMethod (c$, "isRemoveNotifyNeeded", + function (comp, oldContainer, newContainer) { +return false; +}, "java.awt.Component,java.awt.Container,java.awt.Container"); +Clazz_defineMethod (c$, "setComponentZOrder", +function (comp, index) { +{ +var curParent = comp.parent; +var oldZindex = this.getComponentZOrder (comp); +if (curParent === this && index == oldZindex) { +return; +}var peerRecreated = (curParent != null) ? curParent.removeDelicately (comp, this, index) : false; +this.addDelicately (comp, curParent, index); +if (!peerRecreated && oldZindex != -1) { +comp.mixOnZOrderChanging (oldZindex, index); +}}}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "reparentTraverse", + function (parentPeer, child) { +this.checkTreeLock (); +for (var i = 0; i < child.getComponentCount (); i++) { +var comp = child.getComponent (i); +if (comp.isLightweight ()) { +if (Clazz_instanceOf (comp, java.awt.Container)) { +this.reparentTraverse (parentPeer, comp); +}} else { +comp.getPeer ().reparent (parentPeer); +}} +}, "java.awt.peer.ContainerPeer,java.awt.Container"); +Clazz_defineMethod (c$, "reparentChild", + function (comp) { +if (comp == null) { +return; +}if (comp.isLightweight ()) { +if (Clazz_instanceOf (comp, java.awt.Container)) { +this.reparentTraverse (this.getPeer (), comp); +}} else { +comp.getPeer ().reparent (this.getPeer ()); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "addDelicately", + function (comp, curParent, index) { +this.checkTreeLock (); +if (curParent !== this) { +if (index == -1) { +this.component.add (comp); +} else { +this.component.add (index, comp); +}comp.parent = this; +this.adjustListeningChildren (32768, comp.numListening (32768)); +this.adjustListeningChildren (65536, comp.numListening (65536)); +this.adjustDescendants (comp.countHierarchyMembers ()); +} else { +if (index < this.component.size ()) { +this.component.set (index, comp); +}}this.invalidateIfValid (); +if (this.peer != null) { +if (comp.peer == null) { +comp.addNotify (); +} else { +var newNativeContainer = this.getHeavyweightContainer (); +var oldNativeContainer = curParent.getHeavyweightContainer (); +if (oldNativeContainer !== newNativeContainer) { +newNativeContainer.reparentChild (comp); +}if (!comp.isLightweight () && this.isLightweight ()) { +comp.relocateComponent (); +}}}if (curParent !== this) { +if (this.layoutMgr != null) { +if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { +(this.layoutMgr).addLayoutComponent (comp, null); +} else { +this.layoutMgr.addLayoutComponent (null, comp); +}}if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { +var e = new java.awt.event.ContainerEvent (this, 300, comp); +this.dispatchEvent (e); +}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); +} else { +comp.createHierarchyEvents (1400, comp, this, 1400, java.awt.Toolkit.enabledOnToolkit (32768)); +}if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { +this.updateCursorImmediately (); +}}, "java.awt.Component,java.awt.Container,~N"); +Clazz_defineMethod (c$, "checkTreeLock", + function () { +}); +Clazz_defineMethod (c$, "getComponentZOrder", +function (comp) { +if (comp == null) { +return -1; +}{ +if (comp.parent !== this) { +return -1; +}return this.component.indexOf (comp); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "add", +function (comp, constraints) { +this.addImpl (comp, constraints, -1); +}, "java.awt.Component,~O"); +Clazz_defineMethod (c$, "add", +function (comp, constraints, index) { +return this.addImpl (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "addImpl", +function (comp, constraints, index) { +return this.addImplSAEM (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "addImplSAEM", +function (comp, constraints, index) { +{ +if (index > this.component.size () || (index < 0 && index != -1)) { +throw new IllegalArgumentException ("illegal component position"); +}this.checkAddToSelf (comp); +this.checkNotAWindow (comp); +if (comp.parent != null) { +comp.parent.remove (comp); +if (index > this.component.size ()) { +throw new IllegalArgumentException ("illegal component position"); +}}if (index == -1) { +this.component.add (comp); +} else { +this.component.add (index, comp); +}comp.parent = this; +this.adjustListeningChildren (32768, comp.numListening (32768)); +this.adjustListeningChildren (65536, comp.numListening (65536)); +this.adjustDescendants (comp.countHierarchyMembers ()); +this.invalidateIfValid (); +if (this.peer != null) { +comp.addNotify (); +}if (this.layoutMgr != null) { +if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { +(this.layoutMgr).addLayoutComponent (comp, constraints); +} else if (Clazz_instanceOf (constraints, String)) { +this.layoutMgr.addLayoutComponent (constraints, comp); +}}if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { +var e = new java.awt.event.ContainerEvent (this, 300, comp); +this.dispatchEvent (e); +}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); +if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { +this.updateCursorImmediately (); +}}return comp; +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "checkGD", +function (stringID) { +}, "~S"); +Clazz_defineMethod (c$, "remove", +function (index) { +this.removeInt (index); +}, "~N"); +Clazz_defineMethod (c$, "removeInt", +function (index) { +{ +if (index < 0 || index >= this.component.size ()) { +throw new ArrayIndexOutOfBoundsException (index); +}var comp = this.component.get (index); +if (this.peer != null) { +comp.removeNotify (); +}if (this.layoutMgr != null) { +this.layoutMgr.removeLayoutComponent (comp); +}this.adjustListeningChildren (32768, -comp.numListening (32768)); +this.adjustListeningChildren (65536, -comp.numListening (65536)); +this.adjustDescendants (-(comp.countHierarchyMembers ())); +comp.parent = null; +this.component.remove (index); +this.invalidateIfValid (); +if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { +var e = new java.awt.event.ContainerEvent (this, 301, comp); +this.dispatchEvent (e); +}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); +if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { +this.updateCursorImmediately (); +}}}, "~N"); +Clazz_defineMethod (c$, "remove", +function (comp) { +this.removeChild (comp); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "removeChild", +function (comp) { +{ +if (comp.parent === this) { +var index = this.component.indexOf (comp); +if (index >= 0) { +this.remove (index); +}}}}, "java.awt.Component"); +Clazz_defineMethod (c$, "removeAll", +function () { +{ +this.adjustListeningChildren (32768, -this.listeningChildren); +this.adjustListeningChildren (65536, -this.listeningBoundsChildren); +this.adjustDescendants (-this.descendantsCount); +while (!this.component.isEmpty ()) { +var comp = this.component.remove (this.component.size () - 1); +if (this.peer != null) { +comp.removeNotify (); +}if (this.layoutMgr != null) { +this.layoutMgr.removeLayoutComponent (comp); +}comp.parent = null; +if (this.containerListener != null || (this.eventMask & 2) != 0 || java.awt.Toolkit.enabledOnToolkit (2)) { +var e = new java.awt.event.ContainerEvent (this, 301, comp); +this.dispatchEvent (e); +}comp.createHierarchyEvents (1400, comp, this, 1, java.awt.Toolkit.enabledOnToolkit (32768)); +} +if (this.peer != null && this.layoutMgr == null && this.isVisible ()) { +this.updateCursorImmediately (); +}this.invalidateIfValid (); +}}); +Clazz_defineMethod (c$, "numListening", +function (mask) { +var superListening = this.numListeningMask (mask); +if (mask == 32768) { +return this.listeningChildren + superListening; +} else if (mask == 65536) { +return this.listeningBoundsChildren + superListening; +} else { +return superListening; +}}, "~N"); +Clazz_defineMethod (c$, "adjustListeningChildren", +function (mask, num) { +if (num == 0) return; +if ((mask & 32768) != 0) { +this.listeningChildren += num; +}if ((mask & 65536) != 0) { +this.listeningBoundsChildren += num; +}this.adjustListeningChildrenOnParent (mask, num); +}, "~N,~N"); +Clazz_defineMethod (c$, "adjustDescendants", +function (num) { +if (num == 0) return; +this.descendantsCount += num; +this.adjustDecendantsOnParent (num); +}, "~N"); +Clazz_defineMethod (c$, "adjustDecendantsOnParent", +function (num) { +if (this.parent != null) { +this.parent.adjustDescendants (num); +}}, "~N"); +Clazz_defineMethod (c$, "countHierarchyMembers", +function () { +return this.descendantsCount + 1; +}); +Clazz_defineMethod (c$, "getListenersCount", + function (id, enabledOnToolkit) { +if (enabledOnToolkit) { +return this.descendantsCount; +}switch (id) { +case 1400: +return this.listeningChildren; +case 1401: +case 1402: +return this.listeningBoundsChildren; +default: +return 0; +} +}, "~N,~B"); +Clazz_defineMethod (c$, "createHierarchyEvents", +function (id, changed, changedParent, changeFlags, enabledOnToolkit) { +var listeners = this.getListenersCount (id, enabledOnToolkit); +for (var count = listeners, i = 0; count > 0; i++) { +count -= this.component.get (i).createHierarchyEvents (id, changed, changedParent, changeFlags, enabledOnToolkit); +} +return listeners + this.createHierEventsComp (id, changed, changedParent, changeFlags, enabledOnToolkit); +}, "~N,java.awt.Component,java.awt.Container,~N,~B"); +Clazz_defineMethod (c$, "createChildHierarchyEvents", +function (id, changeFlags, enabledOnToolkit) { +if (this.component.isEmpty ()) { +return; +}var listeners = this.getListenersCount (id, enabledOnToolkit); +for (var count = listeners, i = 0; count > 0; i++) { +count -= this.component.get (i).createHierarchyEvents (id, this, this.parent, changeFlags, enabledOnToolkit); +} +}, "~N,~N,~B"); +Clazz_defineMethod (c$, "getLayout", +function () { +return this.layoutMgr; +}); +Clazz_defineMethod (c$, "setLayout", +function (mgr) { +this.layoutMgr = mgr; +this.invalidateIfValid (); +}, "java.awt.LayoutManager"); +Clazz_overrideMethod (c$, "doLayout", +function () { +this.layout (); +}); +Clazz_overrideMethod (c$, "layout", +function () { +var layoutMgr = this.layoutMgr; +if (layoutMgr != null) { +layoutMgr.layoutContainer (this); +}}); +Clazz_overrideMethod (c$, "invalidate", +function () { +var layoutMgr = this.layoutMgr; +if (Clazz_instanceOf (layoutMgr, java.awt.LayoutManager2)) { +var lm = layoutMgr; +lm.invalidateLayout (this); +}this.invalidateComp (); +}); +Clazz_overrideMethod (c$, "validate", +function () { +if (!this.isValid ()) { +var updateCur = false; +{ +if (!this.isValid () && this.peer != null) { +var p = null; +if (Clazz_instanceOf (this.peer, java.awt.peer.ContainerPeer)) { +p = this.peer; +}if (p != null) { +p.beginValidate (); +}this.validateTree (); +if (p != null) { +p.endValidate (); +updateCur = this.isVisible (); +}}}if (updateCur) { +this.updateCursorImmediately (); +}}}); +Clazz_defineMethod (c$, "validateTree", +function () { +if (!this.isValid ()) { +if (Clazz_instanceOf (this.peer, java.awt.peer.ContainerPeer)) { +(this.peer).beginLayout (); +}this.doLayout (); +for (var i = 0; i < this.component.size (); i++) { +var comp = this.component.get (i); +if ((Clazz_instanceOf (comp, java.awt.Container)) && !(Clazz_instanceOf (comp, java.awt.Window)) && !comp.isValid ()) { +(comp).validateTree (); +} else { +comp.validate (); +}} +if (Clazz_instanceOf (this.peer, java.awt.peer.ContainerPeer)) { +(this.peer).endLayout (); +}}this.validateComponent (); +}); +Clazz_defineMethod (c$, "invalidateTree", +function () { +{ +for (var i = 0; i < this.component.size (); i++) { +var comp = this.component.get (i); +if (Clazz_instanceOf (comp, java.awt.Container)) { +(comp).invalidateTree (); +} else { +comp.invalidateIfValid (); +}} +this.invalidateIfValid (); +}}); +Clazz_overrideMethod (c$, "setFont", +function (f) { +var oldfont = this.getFont (); +this.setFontComp (f); +var newfont = this.getFont (); +if (newfont !== oldfont && (oldfont == null || !oldfont.equals (newfont))) { +this.invalidateTree (); +}}, "java.awt.Font"); +Clazz_overrideMethod (c$, "getPreferredSize", +function () { +return this.preferredSize (); +}); +Clazz_overrideMethod (c$, "preferredSize", +function () { +var dim = this.prefSize; +if (dim == null || !(this.isPreferredSizeSet () || this.isValid ())) { +{ +this.prefSize = (this.layoutMgr != null) ? this.layoutMgr.preferredLayoutSize (this) : this.prefSizeComp (); +dim = this.prefSize; +}}return (dim == null ? null : new java.awt.Dimension (dim)); +}); +Clazz_overrideMethod (c$, "getMinimumSize", +function () { +var dim = this.minSize; +if (dim == null || !(this.isMinimumSizeSet () || this.isValid ())) { +{ +this.minSize = (this.layoutMgr != null) ? this.layoutMgr.minimumLayoutSize (this) : this.minimumSize (); +dim = this.minSize; +}}if (dim != null) { +return new java.awt.Dimension (dim); +} else { +return dim; +}}); +Clazz_overrideMethod (c$, "getMaximumSize", +function () { +var dim = this.maxSize; +if (dim == null || !(this.isMaximumSizeSet () || this.isValid ())) { +{ +if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { +var lm = this.layoutMgr; +this.maxSize = lm.maximumLayoutSize (this); +} else { +this.maxSize = this.getMaxSizeComp (); +}dim = this.maxSize; +}}if (dim != null) { +return new java.awt.Dimension (dim); +} else { +return dim; +}}); +Clazz_overrideMethod (c$, "getAlignmentX", +function () { +var xAlign; +if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { +{ +var lm = this.layoutMgr; +xAlign = lm.getLayoutAlignmentX (this); +}} else { +xAlign = this.getAlignmentXComp (); +}return xAlign; +}); +Clazz_overrideMethod (c$, "getAlignmentY", +function () { +var yAlign; +if (Clazz_instanceOf (this.layoutMgr, java.awt.LayoutManager2)) { +{ +var lm = this.layoutMgr; +yAlign = lm.getLayoutAlignmentY (this); +}} else { +yAlign = this.getAlignmentYComp (); +}return yAlign; +}); +Clazz_overrideMethod (c$, "paint", +function (g) { +java.awt.GraphicsCallback.PaintCallback.getInstance ().runComponents (this.component.toArray (java.awt.Container.EMPTY_ARRAY), g, 2); +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "update", +function (g) { +if (this.isShowing ()) { +g.clearRect (0, 0, this.width, this.height); +this.paint (g); +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintComponents", +function (g) { +if (this.isShowing ()) { +java.awt.GraphicsCallback.PaintAllCallback.getInstance ().runComponents (this.component.toArray (java.awt.Container.EMPTY_ARRAY), g, 4); +}}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "lightweightPaint", +function (g) { +this.lwPaintComp (g); +this.paintHeavyweightComponents (g); +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "paintHeavyweightComponents", +function (g) { +if (this.isShowing ()) { +java.awt.GraphicsCallback.PaintHeavyweightComponentsCallback.getInstance ().runComponents (this.component.toArray (java.awt.Container.EMPTY_ARRAY), g, 3); +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "addContainerListener", +function (l) { +if (l == null) { +return; +}this.containerListener = java.awt.AWTEventMulticaster.add (this.containerListener, l); +this.newEventsOnly = true; +}, "java.awt.event.ContainerListener"); +Clazz_defineMethod (c$, "removeContainerListener", +function (l) { +if (l == null) { +return; +}this.containerListener = java.awt.AWTEventMulticaster.remove (this.containerListener, l); +}, "java.awt.event.ContainerListener"); +Clazz_defineMethod (c$, "getContainerListeners", +function () { +return (this.getListeners (java.awt.event.ContainerListener)); +}); +Clazz_overrideMethod (c$, "getListeners", +function (listenerType) { +var l = null; +if (listenerType === java.awt.event.ContainerListener) { +l = this.containerListener; +} else { +return this.getListenersComp (listenerType); +}return java.awt.AWTEventMulticaster.getListeners (l, listenerType); +}, "Class"); +Clazz_overrideMethod (c$, "eventEnabled", +function (e) { +var id = e.getID (); +if (id == 300 || id == 301) { +if ((this.eventMask & 2) != 0 || this.containerListener != null) { +return true; +}return false; +}return this.eventTypeEnabled (e.id); +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "processEvent", +function (e) { +this.processEventCont (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "processEventCont", +function (e) { +if (Clazz_instanceOf (e, java.awt.event.ContainerEvent)) { +this.processContainerEvent (e); +return; +}this.processEventComp (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "processContainerEvent", +function (e) { +var listener = this.containerListener; +if (listener != null) { +switch (e.getID ()) { +case 300: +listener.componentAdded (e); +break; +case 301: +listener.componentRemoved (e); +break; +} +}}, "java.awt.event.ContainerEvent"); +Clazz_overrideMethod (c$, "dispatchEventImpl", +function (e) { +if ((this.dispatcher != null) && this.dispatcher.dispatchEvent (e)) { +e.consume (); +if (this.peer != null) { +this.peer.handleEvent (e); +}return; +}this.dispatchEventImplComp (e); +{ +switch (e.getID ()) { +case 101: +break; +case 100: +break; +default: +break; +} +}}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "dispatchEventToSelf", +function (e) { +this.dispatchEventImplComp (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "getMouseEventTarget", + function (x, y, includeSelf, filter, searchHeavyweights) { +{ +if (arguments.length == 3) { +filter = java.awt.Container.MouseEventTargetFilter.FILTER; +searchHeavyWeights = false; +} +}var comp = null; +if (comp == null || comp === this) { +comp = this.getMouseEventTargetImpl (x, y, includeSelf, filter, false, searchHeavyweights); +}return comp; +}, "~N,~N,~B,java.awt.Container.EventTargetFilter,~B"); +Clazz_defineMethod (c$, "getMouseEventTargetImpl", + function (x, y, includeSelf, filter, searchHeavyweightChildren, searchHeavyweightDescendants) { +{ +for (var i = 0; i < this.component.size (); i++) { +var comp = this.component.get (i); +if (comp != null && comp.visible && ((!searchHeavyweightChildren && Clazz_instanceOf (comp.peer, java.awt.peer.LightweightPeer)) || (searchHeavyweightChildren && !(Clazz_instanceOf (comp.peer, java.awt.peer.LightweightPeer)))) && comp.contains (x - comp.x, y - comp.y)) { +if (Clazz_instanceOf (comp, java.awt.Container)) { +var child = comp; +var deeper = child.getMouseEventTarget (x - child.x, y - child.y, includeSelf, filter, searchHeavyweightDescendants); +if (deeper != null) { +return deeper; +}} else { +if (filter.accept (comp)) { +return comp; +}}}} +var isPeerOK; +var isMouseOverMe; +isPeerOK = includeSelf; +isMouseOverMe = this.contains (x, y); +if (isMouseOverMe && isPeerOK && filter.accept (this)) { +return this; +}return null; +}}, "~N,~N,~B,java.awt.Container.EventTargetFilter,~B,~B"); +Clazz_defineMethod (c$, "proxyEnableEvents", +function (events) { +if (this.parent != null) { +this.parent.proxyEnableEvents (events); +}if (this.dispatcher != null) { +this.dispatcher.enableEvents (events); +}}, "~N"); +Clazz_defineMethod (c$, "deliverEvent", +function (e) { +var comp = this.getComponentAt (e.x, e.y); +if ((comp != null) && (comp !== this)) { +e.translate (-comp.x, -comp.y); +comp.deliverEvent (e); +} else { +this.postEvent (e); +}}, "java.awt.Event"); +Clazz_defineMethod (c$, "getComponentAt", +function (x, y) { +return this.locate (x, y); +}, "~N,~N"); +Clazz_overrideMethod (c$, "locate", +function (x, y) { +return this; +}, "~N,~N"); +Clazz_defineMethod (c$, "getComponentAt", +function (p) { +return this.getComponentAt (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "getMousePosition", +function (allowChildren) { +return null; +}, "~B"); +Clazz_overrideMethod (c$, "isSameOrAncestorOf", +function (comp, allowChildren) { +return this === comp || (allowChildren && this.isParentOf (comp)); +}, "java.awt.Component,~B"); +Clazz_defineMethod (c$, "findComponentAt", +function (x, y) { +{ +return this.findComponentAt (x, y, true); +}}, "~N,~N"); +Clazz_defineMethod (c$, "findComponentAt", +function (x, y, ignoreEnabled) { +return null; +}, "~N,~N,~B"); +Clazz_defineMethod (c$, "findComponentAt", +function (p) { +return this.findComponentAt (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "addNotify", +function () { +{ +this.addNotifyComp (); +if (!(Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer))) { +this.setDispatcher (); +}for (var i = 0; i < this.component.size (); i++) { +this.component.get (i).addNotify (); +} +}}); +Clazz_defineMethod (c$, "setDispatcher", +function () { +this.dispatcher = new java.awt.LightweightDispatcher (this); +}); +Clazz_defineMethod (c$, "removeNotify", +function () { +for (var i = this.component.size () - 1; i >= 0; i--) { +var comp = this.component.get (i); +if (comp != null) { +comp.setAutoFocusTransferOnDisposal (false); +comp.removeNotify (); +comp.setAutoFocusTransferOnDisposal (true); +}} +if (this.dispatcher != null) { +this.dispatcher.dispose (); +this.dispatcher = null; +}this.removeNotifyComp (); +}); +Clazz_defineMethod (c$, "isAncestorOf", +function (c) { +var p; +if (c == null || ((p = c.getParent ()) == null)) { +return false; +}while (p != null) { +if (p === this) { +return true; +}p = p.getParent (); +} +return false; +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "paramString", +function () { +var str = this.paramStringComp (); +var layoutMgr = this.layoutMgr; +if (layoutMgr != null) { +str += ",layout=" + layoutMgr.getClass ().getName (); +}return str; +}); +Clazz_defineMethod (c$, "setFocusTraversalKeys", +function (id, keystrokes) { +}, "~N,java.util.Set"); +Clazz_defineMethod (c$, "getFocusTraversalKeys", +function (id) { +return null; +}, "~N"); +Clazz_defineMethod (c$, "areFocusTraversalKeysSet", +function (id) { +return false; +}, "~N"); +Clazz_defineMethod (c$, "isFocusCycleRoot", +function (container) { +if (this.isFocusCycleRoot () && container === this) { +return true; +} else { +return this.isFocusCycleRootComp (container); +}}, "java.awt.Container"); +Clazz_overrideMethod (c$, "containsFocus", +function () { +return false; +}); +Clazz_defineMethod (c$, "isParentOf", + function (comp) { +{ +while (comp != null && comp !== this && !(Clazz_instanceOf (comp, java.awt.Window))) { +comp = comp.getParent (); +} +return (comp === this); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "clearMostRecentFocusOwnerOnHide", +function () { +}); +Clazz_overrideMethod (c$, "clearCurrentFocusCycleRootOnHide", +function () { +}); +Clazz_defineMethod (c$, "getTraversalRoot", +function () { +return null; +}); +Clazz_defineMethod (c$, "isFocusCycleRoot", +function () { +return this.focusCycleRoot; +}); +Clazz_defineMethod (c$, "setFocusTraversalPolicyProvider", +function (provider) { +var oldProvider; +{ +oldProvider = this.focusTraversalPolicyProvider; +this.focusTraversalPolicyProvider = provider; +}this.firePropertyChangeBool ("focusTraversalPolicyProvider", oldProvider, provider); +}, "~B"); +Clazz_defineMethod (c$, "isFocusTraversalPolicyProvider", +function () { +return this.focusTraversalPolicyProvider; +}); +Clazz_defineMethod (c$, "transferFocusDownCycle", +function () { +}); +Clazz_defineMethod (c$, "preProcessKeyEvent", +function (e) { +var parent = this.parent; +if (parent != null) { +parent.preProcessKeyEvent (e); +}}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "postProcessKeyEvent", +function (e) { +var parent = this.parent; +if (parent != null) { +parent.postProcessKeyEvent (e); +}}, "java.awt.event.KeyEvent"); +Clazz_overrideMethod (c$, "postsOldMouseEvents", +function () { +return true; +}); +Clazz_defineMethod (c$, "applyComponentOrientation", +function (o) { +this.applyCompOrientComp (o); +{ +for (var i = 0; i < this.component.size (); i++) { +var comp = this.component.get (i); +comp.applyComponentOrientation (o); +} +}}, "java.awt.ComponentOrientation"); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (listener) { +this.addPropChangeListenerComp (listener); +}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (propertyName, listener) { +this.addPropChangeListComp (propertyName, listener); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "increaseComponentCount", +function (c) { +if (!c.isDisplayable ()) { +throw new IllegalStateException ("Peer does not exist while invoking the increaseComponentCount() method"); +}var addHW = 0; +var addLW = 0; +if (Clazz_instanceOf (c, java.awt.Container)) { +addLW = (c).numOfLWComponents; +addHW = (c).numOfHWComponents; +}if (c.isLightweight ()) { +addLW++; +} else { +addHW++; +}for (var cont = this; cont != null; cont = cont.getContainer ()) { +cont.numOfLWComponents += addLW; +cont.numOfHWComponents += addHW; +} +}, "java.awt.Component"); +Clazz_defineMethod (c$, "decreaseComponentCount", +function (c) { +if (!c.isDisplayable ()) { +throw new IllegalStateException ("Peer does not exist while invoking the decreaseComponentCount() method"); +}var subHW = 0; +var subLW = 0; +if (Clazz_instanceOf (c, java.awt.Container)) { +subLW = (c).numOfLWComponents; +subHW = (c).numOfHWComponents; +}if (c.isLightweight ()) { +subLW++; +} else { +subHW++; +}for (var cont = this; cont != null; cont = cont.getContainer ()) { +cont.numOfLWComponents -= subLW; +cont.numOfHWComponents -= subHW; +} +}, "java.awt.Component"); +Clazz_declareInterface (java.awt.Container, "EventTargetFilter"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.Container, "MouseEventTargetFilter", null, java.awt.Container.EventTargetFilter); +Clazz_makeConstructor (c$, + function () { +}); +Clazz_overrideMethod (c$, "accept", +function (a) { +return (a.eventMask & 32) != 0 || (a.eventMask & 16) != 0 || (a.eventMask & 131072) != 0 || a.mouseListener != null || a.mouseMotionListener != null || a.mouseWheelListener != null; +}, "java.awt.Component"); +c$.FILTER = c$.prototype.FILTER = new java.awt.Container.MouseEventTargetFilter (); +c$ = Clazz_p0p (); +c$.EMPTY_ARRAY = c$.prototype.EMPTY_ARRAY = new Array (0); +Clazz_defineStatics (c$, +"INCLUDE_SELF", true, +"SEARCH_HEAVYWEIGHTS", true); +c$ = Clazz_decorateAsClass (function () { +this.nativeContainer = null; +this.mouseEventTarget = null; +this.targetLastEntered = null; +this.isMouseInNativeContainer = false; +this.eventMask = 0; +Clazz_instantialize (this, arguments); +}, java.awt, "LightweightDispatcher", null, java.awt.event.AWTEventListener); +Clazz_makeConstructor (c$, +function (nativeContainer) { +this.nativeContainer = nativeContainer; +this.mouseEventTarget = null; +this.eventMask = 0; +}, "java.awt.Container"); +Clazz_defineMethod (c$, "dispose", +function () { +this.stopListeningForOtherDrags (); +this.mouseEventTarget = null; +}); +Clazz_defineMethod (c$, "enableEvents", +function (events) { +this.eventMask |= events; +}, "~N"); +Clazz_defineMethod (c$, "dispatchEvent", +function (e) { +var ret = false; +if (Clazz_instanceOf (e, java.awt.event.MouseEvent) && (this.eventMask & 131120) != 0) { +var me = e; +ret = this.processMouseEvent (me); +}return ret; +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "isMouseGrab", + function (e) { +var modifiers = e.getModifiersEx (); +if (e.getID () == 501 || e.getID () == 502) { +switch (e.getButton ()) { +case 1: +modifiers ^= 1024; +break; +case 2: +modifiers ^= 2048; +break; +case 3: +modifiers ^= 4096; +break; +} +}return ((modifiers & (7168)) != 0); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "processMouseEvent", + function (e) { +var id = e.getID (); +var mouseOver = this.nativeContainer.getMouseEventTarget (e.getX (), e.getY (), true); +this.trackMouseEnterExit (mouseOver, e); +if (!this.isMouseGrab (e) && id != 500) { +this.mouseEventTarget = (mouseOver !== this.nativeContainer) ? mouseOver : null; +}if (this.mouseEventTarget != null) { +switch (id) { +case 504: +case 505: +break; +case 501: +this.retargetMouseEvent (this.mouseEventTarget, id, e); +break; +case 502: +this.retargetMouseEvent (this.mouseEventTarget, id, e); +break; +case 500: +if (mouseOver === this.mouseEventTarget) { +this.retargetMouseEvent (mouseOver, id, e); +}break; +case 503: +this.retargetMouseEvent (this.mouseEventTarget, id, e); +break; +case 506: +if (this.isMouseGrab (e)) { +this.retargetMouseEvent (this.mouseEventTarget, id, e); +}break; +case 507: +this.retargetMouseEvent (mouseOver, id, e); +break; +} +e.consume (); +}return e.isConsumed (); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "trackMouseEnterExit", + function (targetOver, e) { +var targetEnter = null; +var id = e.getID (); +if (id != 505 && id != 506 && id != 1500 && this.isMouseInNativeContainer == false) { +this.isMouseInNativeContainer = true; +this.startListeningForOtherDrags (); +} else if (id == 505) { +this.isMouseInNativeContainer = false; +this.stopListeningForOtherDrags (); +}if (this.isMouseInNativeContainer) { +targetEnter = targetOver; +}if (this.targetLastEntered === targetEnter) { +return; +}if (this.targetLastEntered != null) { +this.retargetMouseEvent (this.targetLastEntered, 505, e); +}if (id == 505) { +e.consume (); +}if (targetEnter != null) { +this.retargetMouseEvent (targetEnter, 504, e); +}if (id == 504) { +e.consume (); +}this.targetLastEntered = targetEnter; +}, "java.awt.Component,java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "startListeningForOtherDrags", + function () { +}); +Clazz_defineMethod (c$, "stopListeningForOtherDrags", + function () { +}); +Clazz_overrideMethod (c$, "eventDispatched", +function (e) { +var isForeignDrag = (Clazz_instanceOf (e, java.awt.event.MouseEvent)) && (e.id == 506) && (e.getSource () !== this.nativeContainer); +if (!isForeignDrag) { +return; +}var srcEvent = e; +var me; +{ +var srcComponent = srcEvent.getComponent (); +if (!srcComponent.isShowing ()) { +return; +}var c = this.nativeContainer; +while ((c != null) && !(Clazz_instanceOf (c, java.awt.Window))) { +c = c.getParent_NoClientCode (); +} +if ((c == null) || (c).isModalBlocked ()) { +return; +}me = new java.awt.event.MouseEvent (this.nativeContainer, 1500, srcEvent.getWhen (), srcEvent.getModifiersEx () | srcEvent.getModifiers (), srcEvent.getX (), srcEvent.getY (), srcEvent.getXOnScreen (), srcEvent.getYOnScreen (), srcEvent.getClickCount (), srcEvent.isPopupTrigger (), srcEvent.getButton ()); +(srcEvent).copyPrivateDataInto (me); +}var targetOver = this.nativeContainer.getMouseEventTarget (me.getX (), me.getY (), true); +this.trackMouseEnterExit (targetOver, me); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "retargetMouseEvent", +function (target, id, e) { +if (target == null) { +return; +}var x = e.getX (); +var y = e.getY (); +var component; +for (component = target; component != null && component !== this.nativeContainer; component = component.getParent ()) { +x -= component.x; +y -= component.y; +} +var retargeted; +if (component != null) { +if (id == 507) { +retargeted = new java.awt.event.MouseWheelEvent (target, id, e.getWhen (), e.getModifiersEx () | e.getModifiers (), x, y, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), (e).getScrollType (), (e).getScrollAmount (), (e).getWheelRotation ()); +} else { +retargeted = new java.awt.event.MouseEvent (target, id, e.getWhen (), e.getModifiersEx () | e.getModifiers (), x, y, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), e.getButton ()); +}(e).copyPrivateDataInto (retargeted); +if (target === this.nativeContainer) { +(target).dispatchEventToSelf (retargeted); +} else { +if (this.nativeContainer.modalComp != null) { +if ((this.nativeContainer.modalComp).isAncestorOf (target)) { +target.dispatchEvent (retargeted); +} else { +e.consume (); +}} else { +target.dispatchEvent (retargeted); +}}}}, "java.awt.Component,~N,java.awt.event.MouseEvent"); +Clazz_defineStatics (c$, +"LWD_MOUSE_DRAGGED_OVER", 1500, +"MOUSE_MASK", 131120); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.lang.Enum", "java.awt.image.ImageObserver", "java.util.HashMap", "java.awt.ComponentOrientation"], "java.awt.Component", ["java.lang.Boolean", "$.Character", "$.Double", "$.Float", "$.IllegalArgumentException", "$.Long", "$.NullPointerException", "$.Short", "$.Thread", "java.awt.AWTEventMulticaster", "$.Cursor", "$.Dimension", "$.EventQueue", "$.IllegalComponentStateException", "$.Point", "$.Rectangle", "$.Toolkit", "java.awt.event.ComponentEvent", "$.ComponentListener", "$.FocusEvent", "$.FocusListener", "$.HierarchyBoundsListener", "$.HierarchyEvent", "$.HierarchyListener", "$.InputEvent", "$.InputMethodEvent", "$.InputMethodListener", "$.KeyEvent", "$.KeyListener", "$.MouseEvent", "$.MouseListener", "$.MouseMotionListener", "$.MouseWheelEvent", "$.MouseWheelListener", "$.PaintEvent", "java.awt.peer.LightweightPeer", "java.beans.PropertyChangeListener", "$.PropertyChangeSupport", "jssun.awt.AppContext", "$.SunToolkit", "jssun.font.FontDesignMetrics", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.threadGroup = null; +this.myThread = null; +this.peer = null; +this.parent = null; +this.appContext = null; +this.x = 0; +this.y = 0; +this.width = 0; +this.height = 0; +this.foreground = null; +this.background = null; +this.font = null; +this.peerFont = null; +this.cursor = null; +this.locale = null; +this.visible = true; +this.enabled = true; +this.valid = false; +this.popups = null; +this.name = null; +this.nameExplicitlySet = false; +this.focusable = true; +this.$isFocusTraversableOverridden = 0; +this.focusTraversalKeysEnabled = false; +this.minSize = null; +this.minSizeSet = false; +this.prefSize = null; +this.prefSizeSet = false; +this.maxSize = null; +this.maxSizeSet = false; +this.componentOrientation = null; +this.newEventsOnly = false; +this.componentListener = null; +this.focusListener = null; +this.hierarchyListener = null; +this.hierarchyBoundsListener = null; +this.keyListener = null; +this.mouseListener = null; +this.mouseMotionListener = null; +this.mouseWheelListener = null; +this.inputMethodListener = null; +this.windowClosingException = null; +this.eventMask = 4096; +this.changeSupport = null; +this.changeSupportLock = null; +this.isPacked = false; +this.boundsOp = 3; +this.isAddNotifyComplete = false; +this.backgroundEraseDisabled = false; +this.htmlName = null; +this.num = 0; +this.graphicsConfig = null; +this.eventCache = null; +this.coalescingEnabled = false; +this.autoFocusTransferOnDisposal = true; +Clazz_instantialize (this, arguments); +}, java.awt, "Component", null, java.awt.image.ImageObserver); +Clazz_prepareFields (c$, function () { +this.componentOrientation = java.awt.ComponentOrientation.UNKNOWN; +this.changeSupportLock = new Clazz._O (); +this.coalescingEnabled = this.checkCoalescing (); +}); +Clazz_defineMethod (c$, "getAppContext", +function () { +return this.appContext; +}); +Clazz_defineMethod (c$, "getChangeSupportLock", + function () { +return this.changeSupportLock; +}); +Clazz_defineMethod (c$, "getBoundsOp", +function () { +return this.boundsOp; +}); +Clazz_defineMethod (c$, "setBoundsOp", +function (op) { +if (op == 5) { +this.boundsOp = 3; +} else if (this.boundsOp == 3) { +this.boundsOp = op; +}}, "~N"); +Clazz_makeConstructor (c$, +function () { +this.setAppContext (); +}); +Clazz_defineMethod (c$, "setAppContext", +function () { +this.appContext = jssun.awt.AppContext.getAppContext (); +this.num = ++java.awt.Component.incr; +}); +Clazz_defineMethod (c$, "getHTMLName", +function (uid) { +return (this.htmlName == null ? this.htmlName = this.appContext.getThreadGroup ().getName () + "_" + uid + "_" + this.num : this.htmlName); +}, "~S"); +Clazz_defineMethod (c$, "constructComponentName", +function () { +return null; +}); +Clazz_defineMethod (c$, "getName", +function () { +if (this.name == null && !this.nameExplicitlySet) { +{ +if (this.name == null && !this.nameExplicitlySet) this.name = this.constructComponentName (); +}}return this.name; +}); +Clazz_defineMethod (c$, "setName", +function (name) { +var oldName; +{ +oldName = this.name; +this.name = name; +this.nameExplicitlySet = true; +}this.firePropertyChangeObject ("name", oldName, name); +}, "~S"); +Clazz_defineMethod (c$, "getParent", +function () { +return this.getParent_NoClientCode (); +}); +Clazz_defineMethod (c$, "getParent_NoClientCode", +function () { +return this.parent; +}); +Clazz_defineMethod (c$, "getContainer", +function () { +return this.getParent (); +}); +Clazz_defineMethod (c$, "getPeer", +function () { +return this.peer; +}); +Clazz_defineMethod (c$, "getGraphicsConfiguration", +function () { +return swingjs.JSToolkit.getGraphicsConfiguration (); +}); +Clazz_defineMethod (c$, "resetGC", +function () { +}); +Clazz_defineMethod (c$, "getToolkit", +function () { +return this.getToolkitImpl (); +}); +Clazz_defineMethod (c$, "getToolkitImpl", +function () { +var peer = this.peer; +if ((peer != null) && !(Clazz_instanceOf (peer, java.awt.peer.LightweightPeer))) { +return peer.getToolkit (); +}var parent = this.parent; +if (parent != null) { +return parent.getToolkitImpl (); +}return java.awt.Toolkit.getDefaultToolkit (); +}); +Clazz_defineMethod (c$, "isValid", +function () { +return this.valid; +}); +Clazz_defineMethod (c$, "isDisplayable", +function () { +return true; +}); +Clazz_defineMethod (c$, "isVisible", +function () { +return this.isVisible_NoClientCode (); +}); +Clazz_defineMethod (c$, "isVisible_NoClientCode", +function () { +return this.visible; +}); +Clazz_defineMethod (c$, "isRecursivelyVisible", +function () { +return this.visible && (this.parent == null || this.parent.isRecursivelyVisible ()); +}); +Clazz_defineMethod (c$, "pointRelativeToComponent", +function (absolute) { +var compCoords = this.getLocationOnScreen (); +return new java.awt.Point (absolute.x - compCoords.x, absolute.y - compCoords.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "getMousePosition", +function () { +return null; +}); +Clazz_defineMethod (c$, "isSameOrAncestorOf", +function (comp, allowChildren) { +return comp === this; +}, "java.awt.Component,~B"); +Clazz_defineMethod (c$, "isShowing", +function () { +if (this.visible) { +var parent = this.parent; +return (parent == null) || parent.isShowing (); +}return false; +}); +Clazz_defineMethod (c$, "isEnabled", +function () { +return this.isEnabledImpl (); +}); +Clazz_defineMethod (c$, "isEnabledImpl", +function () { +return this.enabled; +}); +Clazz_defineMethod (c$, "setEnabled", +function (b) { +this.enable (b); +}, "~B"); +Clazz_defineMethod (c$, "enable", +function () { +if (!this.enabled) { +this.enabled = true; +var peer = this.peer; +if (peer != null) { +peer.setEnabled (true); +if (this.visible) { +this.updateCursorImmediately (); +}}}}); +Clazz_defineMethod (c$, "enable", +function (b) { +if (b) { +this.enable (); +} else { +this.disable (); +}}, "~B"); +Clazz_defineMethod (c$, "disable", +function () { +if (this.enabled) { +this.enabled = false; +var peer = this.peer; +if (peer != null) { +peer.setEnabled (false); +if (this.visible) { +this.updateCursorImmediately (); +}}}}); +Clazz_defineMethod (c$, "isDoubleBuffered", +function () { +return false; +}); +Clazz_defineMethod (c$, "setVisible", +function (b) { +this.show (b); +}, "~B"); +Clazz_defineMethod (c$, "show", +function () { +if (!this.visible) { +this.visible = true; +var peer = this.peer; +if (peer != null) { +peer.setVisible (true); +this.createHierarchyEvents (1400, this, this.parent, 4, java.awt.Toolkit.enabledOnToolkit (32768)); +if (Clazz_instanceOf (peer, java.awt.peer.LightweightPeer)) { +this.repaint (); +}this.updateCursorImmediately (); +}if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) { +var e = new java.awt.event.ComponentEvent (this, 102); +java.awt.Toolkit.getEventQueue ().postEvent (e); +}}var parent = this.parent; +if (parent != null) { +parent.invalidate (); +}}); +Clazz_defineMethod (c$, "containsFocus", +function () { +return this.isFocusOwner (); +}); +Clazz_defineMethod (c$, "clearCurrentFocusCycleRootOnHide", +function () { +}); +Clazz_defineMethod (c$, "hide", +function () { +this.isPacked = false; +if (this.visible) { +this.clearCurrentFocusCycleRootOnHide (); +this.visible = false; +this.mixOnHiding (this.isLightweight ()); +var peer = this.peer; +if (peer != null) { +peer.setVisible (false); +this.createHierarchyEvents (1400, this, this.parent, 4, java.awt.Toolkit.enabledOnToolkit (32768)); +if (Clazz_instanceOf (peer, java.awt.peer.LightweightPeer)) { +this.repaint (); +}this.updateCursorImmediately (); +}if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) { +var e = new java.awt.event.ComponentEvent (this, 103); +java.awt.Toolkit.getEventQueue ().postEvent (e); +}}var parent = this.parent; +if (parent != null) { +parent.invalidate (); +}}); +Clazz_defineMethod (c$, "getForeground", +function () { +var foreground = this.foreground; +if (foreground != null) { +return foreground; +}var parent = this.parent; +return (parent != null) ? parent.getForeground () : null; +}); +Clazz_defineMethod (c$, "setForeground", +function (c) { +var oldColor = this.foreground; +var peer = this.peer; +this.foreground = c; +if (peer != null) { +c = this.getForeground (); +if (c != null) { +peer.setForeground (c); +}}this.firePropertyChangeObject ("foreground", oldColor, c); +}, "java.awt.Color"); +Clazz_defineMethod (c$, "isForegroundSet", +function () { +return (this.foreground != null); +}); +Clazz_defineMethod (c$, "getBackground", +function () { +var background = this.background; +if (background != null) { +return background; +}var parent = this.parent; +return (parent != null) ? parent.getBackground () : null; +}); +Clazz_defineMethod (c$, "setBackground", +function (c) { +var oldColor = this.background; +var peer = this.peer; +this.background = c; +if (peer != null) { +c = this.getBackground (); +if (c != null) { +peer.setBackground (c); +}}this.firePropertyChangeObject ("background", oldColor, c); +}, "java.awt.Color"); +Clazz_defineMethod (c$, "isBackgroundSet", +function () { +return (this.background != null); +}); +Clazz_defineMethod (c$, "getFont", +function () { +return this.getFont_NoClientCode (); +}); +Clazz_defineMethod (c$, "getFont_NoClientCode", +function () { +var font = this.font; +if (font != null) { +return font; +}var parent = this.parent; +return (parent != null) ? parent.getFont_NoClientCode () : null; +}); +Clazz_defineMethod (c$, "setFont", +function (f) { +this.setFontComp (f); +}, "java.awt.Font"); +Clazz_defineMethod (c$, "setFontComp", +function (f) { +var oldFont; +var newFont; +oldFont = this.font; +newFont = this.font = f; +{ +{ +}var peer = this.peer; +if (peer != null) { +f = this.getFont (); +if (f != null) { +peer.setFont (f); +this.peerFont = f; +}}}this.firePropertyChangeObject ("font", oldFont, newFont); +if (f !== oldFont && (oldFont == null || !oldFont.equals (f))) { +this.invalidateIfValid (); +}}, "java.awt.Font"); +Clazz_defineMethod (c$, "isFontSet", +function () { +return (this.font != null); +}); +Clazz_defineMethod (c$, "getLocale", +function () { +var locale = this.locale; +if (locale != null) { +return locale; +}var parent = this.parent; +if (parent == null) { +throw new java.awt.IllegalComponentStateException ("This component must have a parent in order to determine its locale"); +} else { +return parent.getLocale (); +}}); +Clazz_defineMethod (c$, "setLocale", +function (l) { +var oldValue = this.locale; +this.locale = l; +this.firePropertyChangeObject ("locale", oldValue, l); +this.invalidateIfValid (); +}, "java.util.Locale"); +Clazz_defineMethod (c$, "getLocation", +function () { +return this.location (); +}); +Clazz_defineMethod (c$, "getLocationOnScreen", +function () { +return this.getLocationOnScreen_NoTreeLock (); +}); +Clazz_defineMethod (c$, "getLocationOnScreen_NoTreeLock", +function () { +if (this.isShowing ()) { +if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { +var host = this.getNativeContainer (); +var pt = host.peer.getLocationOnScreen (); +for (var c = this; c !== host; c = c.getParent ()) { +pt.x += c.x; +pt.y += c.y; +} +return pt; +} else { +var pt = this.peer.getLocationOnScreen (); +return pt; +}} else { +throw new java.awt.IllegalComponentStateException ("component must be showing on the screen to determine its location"); +}}); +Clazz_defineMethod (c$, "location", +function () { +return this.location_NoClientCode (); +}); +Clazz_defineMethod (c$, "location_NoClientCode", + function () { +return new java.awt.Point (this.x, this.y); +}); +Clazz_defineMethod (c$, "setLocation", +function (x, y) { +this.setBoundsOp (1); +this.setBounds (x, y, this.width, this.height); +}, "~N,~N"); +Clazz_defineMethod (c$, "setLocation", +function (p) { +this.setLocation (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "getSize", +function () { +return this.size (); +}); +Clazz_defineMethod (c$, "size", +function () { +return new java.awt.Dimension (this.width, this.height); +}); +Clazz_defineMethod (c$, "setSize", +function (width, height) { +{ +if (arguments.length == 1) { +var d = arguments[0]; +width = d.width; +height = d.height; +} +}this.resize (width, height); +}, "~N,~N"); +Clazz_defineMethod (c$, "resize", +function (width, height) { +this.setBoundsOp (2); +this.setBounds (this.x, this.y, width, height); +}, "~N,~N"); +Clazz_defineMethod (c$, "setBounds", +function (x, y, width, height) { +this.reshape (x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setBounds", +function (r) { +this.setBounds (r.x, r.y, r.width, r.height); +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "reshape", +function (x, y, width, height) { +try { +this.setBoundsOp (3); +var resized = (this.width != width) || (this.height != height); +var moved = (this.x != x) || (this.y != y); +if (!resized && !moved) { +return; +}var oldX = this.x; +var oldY = this.y; +var oldWidth = this.width; +var oldHeight = this.height; +this.x = x; +this.y = y; +this.width = width; +this.height = height; +if (resized) { +this.isPacked = false; +System.out.println ("C " + swingjs.JSToolkit.getClassName (this) + " resized to " + this.getBounds ()); +}var needNotify = true; +this.mixOnReshaping (); +if (this.peer != null) { +this.reshapeNativePeer (x, y, width, height, this.getBoundsOp ()); +resized = (oldWidth != this.width) || (oldHeight != this.height); +moved = (oldX != this.x) || (oldY != this.y); +if (Clazz_instanceOf (this, java.awt.Window)) { +needNotify = false; +}if (resized) { +this.invalidate (); +}if (this.parent != null) { +this.parent.invalidateIfValid (); +}}if (needNotify) { +this.notifyNewBounds (resized, moved); +}this.repaintParentIfNeeded (oldX, oldY, oldWidth, oldHeight); +} finally { +this.setBoundsOp (5); +} +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "repaintParentIfNeeded", + function (oldX, oldY, oldWidth, oldHeight) { +if (this.parent != null && Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer) && this.isShowing ()) { +this.parent.repaint (oldX, oldY, oldWidth, oldHeight); +this.repaint (); +}}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "reshapeNativePeer", + function (x, y, width, height, op) { +var nativeX = x; +var nativeY = y; +for (var c = this.parent; (c != null) && (Clazz_instanceOf (c.peer, java.awt.peer.LightweightPeer)); c = c.parent) { +nativeX += c.x; +nativeY += c.y; +} +this.peer.setBounds (nativeX, nativeY, width, height, op); +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "notifyNewBounds", + function (resized, moved) { +if (this.componentListener != null || (this.eventMask & 1) != 0 || java.awt.Toolkit.enabledOnToolkit (1)) { +if (resized) { +var e = new java.awt.event.ComponentEvent (this, 101); +java.awt.Toolkit.getEventQueue ().postEvent (e); +}if (moved) { +var e = new java.awt.event.ComponentEvent (this, 100); +java.awt.Toolkit.getEventQueue ().postEvent (e); +}} else { +if (Clazz_instanceOf (this, java.awt.Container) && (this).countComponents () > 0) { +var enabledOnToolkit = java.awt.Toolkit.enabledOnToolkit (65536); +if (resized) { +(this).createChildHierarchyEvents (1402, 0, enabledOnToolkit); +}if (moved) { +(this).createChildHierarchyEvents (1401, 0, enabledOnToolkit); +}}}}, "~B,~B"); +Clazz_defineMethod (c$, "getX", +function () { +return this.x; +}); +Clazz_defineMethod (c$, "getY", +function () { +return this.y; +}); +Clazz_defineMethod (c$, "getWidth", +function () { +return this.width; +}); +Clazz_defineMethod (c$, "getHeight", +function () { +return this.height; +}); +Clazz_defineMethod (c$, "getBounds", +function (rv) { +if (rv == null) return new java.awt.Rectangle (this.getX (), this.getY (), this.getWidth (), this.getHeight ()); +rv.reshape (this.getX (), this.getY (), this.getWidth (), this.getHeight ()); +return rv; +}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "getSize", +function (rv) { +if (rv == null) { +return new java.awt.Dimension (this.getWidth (), this.getHeight ()); +} else { +rv.setSize (this.getWidth (), this.getHeight ()); +return rv; +}}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "getLocation", +function (rv) { +if (rv == null) { +return new java.awt.Point (this.getX (), this.getY ()); +} else { +rv.setLocation (this.getX (), this.getY ()); +return rv; +}}, "java.awt.Point"); +Clazz_defineMethod (c$, "isOpaque", +function () { +return true; +}); +Clazz_defineMethod (c$, "isLightweight", +function () { +return false; +}); +Clazz_defineMethod (c$, "setPreferredSize", +function (preferredSize) { +this.setPrefSizeComp (preferredSize); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "setPrefSizeComp", +function (preferredSize) { +var old = (this.prefSizeSet ? this.prefSize : null); +this.prefSize = preferredSize; +this.prefSizeSet = (preferredSize != null); +this.firePropertyChangeObject ("preferredSize", old, preferredSize); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "isPreferredSizeSet", +function () { +return this.prefSizeSet; +}); +Clazz_defineMethod (c$, "getPreferredSize", +function () { +return this.preferredSize (); +}); +Clazz_defineMethod (c$, "preferredSize", +function () { +return this.prefSizeComp (); +}); +Clazz_defineMethod (c$, "prefSizeComp", +function () { +var dim = this.prefSize; +if (dim == null || !(this.isPreferredSizeSet () || this.isValid ())) { +this.prefSize = this.getMinimumSize (); +dim = this.prefSize; +}return new java.awt.Dimension (dim); +}); +Clazz_defineMethod (c$, "setMinimumSize", +function (minimumSize) { +var old; +if (this.minSizeSet) { +old = this.minSize; +} else { +old = null; +}this.minSize = minimumSize; +this.minSizeSet = (minimumSize != null); +this.firePropertyChangeObject ("minimumSize", old, minimumSize); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "isMinimumSizeSet", +function () { +return this.minSizeSet; +}); +Clazz_defineMethod (c$, "getMinimumSize", +function () { +return this.minimumSize (); +}); +Clazz_defineMethod (c$, "minimumSize", +function () { +var dim = this.minSize; +if (dim == null || !(this.isMinimumSizeSet () || this.isValid ())) { +this.minSize = this.getSize (); +dim = this.minSize; +}return new java.awt.Dimension (dim); +}); +Clazz_defineMethod (c$, "setMaximumSize", +function (maximumSize) { +var old; +if (this.maxSizeSet) { +old = this.maxSize; +} else { +old = null; +}this.maxSize = maximumSize; +this.maxSizeSet = (maximumSize != null); +this.firePropertyChangeObject ("maximumSize", old, maximumSize); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "isMaximumSizeSet", +function () { +return this.maxSizeSet; +}); +Clazz_defineMethod (c$, "getMaximumSize", +function () { +return this.getMaxSizeComp (); +}); +Clazz_defineMethod (c$, "getMaxSizeComp", +function () { +if (this.isMaximumSizeSet ()) { +return new java.awt.Dimension (this.maxSize); +}return new java.awt.Dimension (32767, 32767); +}); +Clazz_defineMethod (c$, "getAlignmentX", +function () { +return this.getAlignmentXComp (); +}); +Clazz_defineMethod (c$, "getAlignmentXComp", +function () { +return 0.5; +}); +Clazz_defineMethod (c$, "getAlignmentY", +function () { +return this.getAlignmentYComp (); +}); +Clazz_defineMethod (c$, "getAlignmentYComp", +function () { +return 0.5; +}); +Clazz_defineMethod (c$, "getBaseline", +function (width, height) { +if (width < 0 || height < 0) { +throw new IllegalArgumentException ("Width and height must be >= 0"); +}return -1; +}, "~N,~N"); +Clazz_defineMethod (c$, "getBaselineResizeBehavior", +function () { +return java.awt.Component.BaselineResizeBehavior.OTHER; +}); +Clazz_defineMethod (c$, "doLayout", +function () { +this.layout (); +}); +Clazz_defineMethod (c$, "layout", +function () { +}); +Clazz_defineMethod (c$, "validate", +function () { +this.validateComponent (); +}); +Clazz_defineMethod (c$, "validateComponent", +function () { +{ +var peer = this.peer; +var wasValid = this.isValid (); +if (!wasValid && peer != null) { +var newfont = this.getFont (); +var oldfont = this.peerFont; +if (newfont !== oldfont && (oldfont == null || !oldfont.equals (newfont))) { +peer.setFont (newfont); +this.peerFont = newfont; +}peer.layout (); +}this.valid = true; +if (!wasValid) { +this.mixOnValidating (); +}}}); +Clazz_defineMethod (c$, "invalidate", +function () { +this.invalidateComp (); +}); +Clazz_defineMethod (c$, "invalidateComp", +function () { +this.valid = false; +if (!this.isPreferredSizeSet ()) { +this.prefSize = null; +}if (!this.isMinimumSizeSet ()) { +this.minSize = null; +}if (!this.isMaximumSizeSet ()) { +this.maxSize = null; +}if (this.parent != null) { +this.parent.invalidateIfValid (); +}}); +Clazz_defineMethod (c$, "invalidateIfValid", +function () { +if (this.isValid ()) { +this.invalidate (); +}}); +Clazz_defineMethod (c$, "getGraphics", +function () { +if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { +if (this.parent == null) return null; +var g = this.parent.getGraphics (); +if (g == null) return null; +g.setFont (this.getFont ()); +return g; +} else { +var peer = this.peer; +return (peer != null) ? peer.getGraphics () : null; +}}); +Clazz_defineMethod (c$, "getTreeLock", +function () { +return this; +}); +Clazz_defineMethod (c$, "getFontMetrics", +function (font) { +return jssun.font.FontDesignMetrics.getMetrics (font); +}, "java.awt.Font"); +Clazz_defineMethod (c$, "setCursor", +function (cursor) { +this.cursor = cursor; +this.updateCursorImmediately (); +}, "java.awt.Cursor"); +Clazz_defineMethod (c$, "updateCursorImmediately", +function () { +}); +Clazz_defineMethod (c$, "getCursor", +function () { +return this.getCursor_NoClientCode (); +}); +Clazz_defineMethod (c$, "getCursor_NoClientCode", +function () { +var cursor = this.cursor; +if (cursor != null) { +return cursor; +}var parent = this.parent; +if (parent != null) { +return parent.getCursor_NoClientCode (); +} else { +return java.awt.Cursor.getPredefinedCursor (0); +}}); +Clazz_defineMethod (c$, "isCursorSet", +function () { +return (this.cursor != null); +}); +Clazz_defineMethod (c$, "paint", +function (g) { +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintAll", +function (g) { +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "lightweightPaint", +function (g) { +this.lwPaintComp (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "lwPaintComp", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintHeavyweightComponents", +function (g) { +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "repaint", +function () { +this.repaintImpl (0, 0, 0, this.width, this.height); +}); +Clazz_defineMethod (c$, "repaint", +function (tm) { +this.repaintImpl (tm, 0, 0, this.width, this.height); +}, "~N"); +Clazz_defineMethod (c$, "repaint", +function (x, y, width, height) { +this.repaintImpl (0, x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "repaint", +function (tm, x, y, width, height) { +this.repaintImpl (tm, x, y, width, height); +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "repaintImpl", +function (tm, x, y, width, height) { +if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { +if (this.parent != null) { +var px = this.x + ((x < 0) ? 0 : x); +var py = this.y + ((y < 0) ? 0 : y); +var pwidth = (width > this.width) ? this.width : width; +var pheight = (height > this.height) ? this.height : height; +this.parent.repaint (tm, px, py, pwidth, pheight); +}} else { +if (this.isVisible () && (this.peer != null) && (width > 0) && (height > 0)) { +var e = new java.awt.event.PaintEvent (this, 801, new java.awt.Rectangle (x, y, width, height)); +java.awt.Toolkit.getEventQueue ().postEvent (e); +}}}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "print", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "printAll", +function (g) { +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "printHeavyweightComponents", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "imageUpdate", +function (img, infoflags, x, y, w, h) { +return false; +}, "java.awt.Image,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "createImage", +function (producer) { +return this.getToolkit ().createImage (producer); +}, "java.awt.image.ImageProducer"); +Clazz_defineMethod (c$, "createImage", +function (width, height) { +return java.awt.Toolkit.getDefaultToolkit ().createImage (null, width, height); +}, "~N,~N"); +Clazz_defineMethod (c$, "createVolatileImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_defineMethod (c$, "createVolatileImage", +function (width, height, caps) { +return this.createVolatileImage (width, height); +}, "~N,~N,java.awt.ImageCapabilities"); +Clazz_defineMethod (c$, "prepareImage", +function (image, observer) { +return this.prepareImage (image, -1, -1, observer); +}, "java.awt.Image,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "prepareImage", +function (image, width, height, observer) { +return false; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "checkImage", +function (image, observer) { +return this.checkImage (image, -1, -1, observer); +}, "java.awt.Image,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "checkImage", +function (image, width, height, observer) { +return 0; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "setIgnoreRepaint", +function (ignoreRepaint) { +}, "~B"); +Clazz_defineMethod (c$, "getIgnoreRepaint", +function () { +return false; +}); +Clazz_defineMethod (c$, "contains", +function (x, y) { +return this.inside (x, y); +}, "~N,~N"); +Clazz_defineMethod (c$, "inside", +function (x, y) { +return (x >= 0) && (x < this.width) && (y >= 0) && (y < this.height); +}, "~N,~N"); +Clazz_defineMethod (c$, "getComponentAt", +function (x, y) { +return this.locate (x, y); +}, "~N,~N"); +Clazz_defineMethod (c$, "locate", +function (x, y) { +return this.contains (x, y) ? this : null; +}, "~N,~N"); +Clazz_defineMethod (c$, "getComponentAt", +function (p) { +return this.getComponentAt (p.x, p.y); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "deliverEvent", +function (e) { +this.postEvent (e); +}, "java.awt.Event"); +Clazz_defineMethod (c$, "dispatchEvent", +function (e) { +this.dispatchEventImpl (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "dispatchEventImpl", +function (e) { +this.dispatchEventImplComp (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "dispatchEventImplComp", +function (e) { +var id = e.getID (); +java.awt.EventQueue.setCurrentEventAndMostRecentTime (e); +if (!e.focusManagerIsDispatching) { +if (e.isPosted) { +e.isPosted = true; +}}if (!e.isConsumed ()) { +if (Clazz_instanceOf (e, java.awt.event.KeyEvent)) { +if (e.isConsumed ()) { +return; +}}}if (this.areInputMethodsEnabled ()) { +if ((Clazz_instanceOf (e, java.awt.event.InputEvent)) || (Clazz_instanceOf (e, java.awt.event.FocusEvent))) { +}} else { +if (id == 1004) { +}}switch (id) { +case 401: +case 402: +var p = ((Clazz_instanceOf (this, java.awt.Container)) ? this : this.parent); +if (p != null) { +p.preProcessKeyEvent (e); +}break; +case 201: +break; +default: +break; +} +if (this.newEventsOnly) { +if (this.eventEnabled (e)) { +this.processEvent (e); +}} else if (id == 507) { +this.autoProcessMouseWheel (e); +} else if (!(Clazz_instanceOf (e, java.awt.event.MouseEvent) && !this.postsOldMouseEvents ())) { +}if (id == 201 && !e.isConsumed ()) { +}if (!(Clazz_instanceOf (e, java.awt.event.KeyEvent))) { +}}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "autoProcessMouseWheel", +function (e) { +}, "java.awt.event.MouseWheelEvent"); +Clazz_defineMethod (c$, "dispatchMouseWheelToAncestor", +function (e) { +var newX; +var newY; +newX = e.getX () + this.getX (); +newY = e.getY () + this.getY (); +var newMWE; +{ +var anc = this.getParent (); +while (anc != null && !anc.eventEnabled (e)) { +newX += anc.getX (); +newY += anc.getY (); +if (!(Clazz_instanceOf (anc, java.awt.Window))) { +anc = anc.getParent (); +} else { +break; +}} +if (anc != null && anc.eventEnabled (e)) { +newMWE = new java.awt.event.MouseWheelEvent (anc, e.getID (), e.getWhen (), e.getModifiers (), newX, newY, e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), e.getScrollType (), e.getScrollAmount (), e.getWheelRotation ()); +(e).copyPrivateDataInto (newMWE); +anc.dispatchEventToSelf (newMWE); +}}return true; +}, "java.awt.event.MouseWheelEvent"); +Clazz_defineMethod (c$, "checkWindowClosingException", +function () { +if (this.windowClosingException != null) { +if (Clazz_instanceOf (this, java.awt.Dialog)) { +(this).interruptBlocking (); +} else { +this.windowClosingException.fillInStackTrace (); +this.windowClosingException.printStackTrace (); +this.windowClosingException = null; +}return true; +}return false; +}); +Clazz_defineMethod (c$, "areInputMethodsEnabled", +function () { +return ((this.eventMask & 4096) != 0) && ((this.eventMask & 8) != 0 || this.keyListener != null); +}); +Clazz_defineMethod (c$, "eventEnabled", +function (e) { +return this.eventTypeEnabled (e.id); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "eventTypeEnabled", +function (type) { +switch (type) { +case 100: +case 101: +case 102: +case 103: +if ((this.eventMask & 1) != 0 || this.componentListener != null) { +return true; +}break; +case 1004: +case 1005: +if ((this.eventMask & 4) != 0 || this.focusListener != null) { +return true; +}break; +case 401: +case 402: +case 400: +if ((this.eventMask & 8) != 0 || this.keyListener != null) { +return true; +}break; +case 501: +case 502: +case 504: +case 505: +case 500: +if ((this.eventMask & 16) != 0 || this.mouseListener != null) { +return true; +}break; +case 503: +case 506: +if ((this.eventMask & 32) != 0 || this.mouseMotionListener != null) { +return true; +}break; +case 507: +if ((this.eventMask & 131072) != 0 || this.mouseWheelListener != null) { +return true; +}break; +case 1100: +case 1101: +if ((this.eventMask & 2048) != 0 || this.inputMethodListener != null) { +return true; +}break; +case 1400: +if ((this.eventMask & 32768) != 0 || this.hierarchyListener != null) { +return true; +}break; +case 1401: +case 1402: +if ((this.eventMask & 65536) != 0 || this.hierarchyBoundsListener != null) { +return true; +}break; +case 1001: +if ((this.eventMask & 128) != 0) { +return true; +}break; +case 900: +if ((this.eventMask & 1024) != 0) { +return true; +}break; +case 701: +if ((this.eventMask & 512) != 0) { +return true; +}break; +case 601: +if ((this.eventMask & 256) != 0) { +return true; +}break; +default: +break; +} +if (type > 1999) { +return true; +}return false; +}, "~N"); +Clazz_defineMethod (c$, "postEvent", +function (e) { +if (this.handleEvent (e)) { +e.consume (); +return true; +}var parent = this.parent; +var eventx = e.x; +var eventy = e.y; +if (parent != null) { +e.translate (this.x, this.y); +if (parent.postEvent (e)) { +e.consume (); +return true; +}e.x = eventx; +e.y = eventy; +}return false; +}, "java.awt.Event"); +Clazz_defineMethod (c$, "addComponentListener", +function (l) { +if (l == null) { +return; +}this.componentListener = java.awt.AWTEventMulticaster.add (this.componentListener, l); +this.newEventsOnly = true; +}, "java.awt.event.ComponentListener"); +Clazz_defineMethod (c$, "removeComponentListener", +function (l) { +if (l == null) { +return; +}this.componentListener = java.awt.AWTEventMulticaster.remove (this.componentListener, l); +}, "java.awt.event.ComponentListener"); +Clazz_defineMethod (c$, "getComponentListeners", +function () { +return (this.getListeners (java.awt.event.ComponentListener)); +}); +Clazz_defineMethod (c$, "addFocusListener", +function (l) { +if (l == null) { +return; +}this.focusListener = java.awt.AWTEventMulticaster.add (this.focusListener, l); +this.newEventsOnly = true; +}, "java.awt.event.FocusListener"); +Clazz_defineMethod (c$, "removeFocusListener", +function (l) { +if (l == null) { +return; +}this.focusListener = java.awt.AWTEventMulticaster.remove (this.focusListener, l); +}, "java.awt.event.FocusListener"); +Clazz_defineMethod (c$, "getFocusListeners", +function () { +return (this.getListeners (java.awt.event.FocusListener)); +}); +Clazz_defineMethod (c$, "addHierarchyListener", +function (l) { +}, "java.awt.event.HierarchyListener"); +Clazz_defineMethod (c$, "removeHierarchyListener", +function (l) { +}, "java.awt.event.HierarchyListener"); +Clazz_defineMethod (c$, "getHierarchyListeners", +function () { +return (this.getListeners (java.awt.event.HierarchyListener)); +}); +Clazz_defineMethod (c$, "addHierarchyBoundsListener", +function (l) { +if (l == null) { +return; +}var notifyAncestors; +{ +notifyAncestors = (this.hierarchyBoundsListener == null && (this.eventMask & 65536) == 0); +this.hierarchyBoundsListener = java.awt.AWTEventMulticaster.add (this.hierarchyBoundsListener, l); +notifyAncestors = (notifyAncestors && this.hierarchyBoundsListener != null); +this.newEventsOnly = true; +}if (notifyAncestors) { +{ +this.adjustListeningChildrenOnParent (65536, 1); +}}}, "java.awt.event.HierarchyBoundsListener"); +Clazz_defineMethod (c$, "removeHierarchyBoundsListener", +function (l) { +if (l == null) { +return; +}var notifyAncestors; +{ +notifyAncestors = (this.hierarchyBoundsListener != null && (this.eventMask & 65536) == 0); +this.hierarchyBoundsListener = java.awt.AWTEventMulticaster.remove (this.hierarchyBoundsListener, l); +notifyAncestors = (notifyAncestors && this.hierarchyBoundsListener == null); +}if (notifyAncestors) { +{ +this.adjustListeningChildrenOnParent (65536, -1); +}}}, "java.awt.event.HierarchyBoundsListener"); +Clazz_defineMethod (c$, "numListening", +function (mask) { +return this.numListeningMask (mask); +}, "~N"); +Clazz_defineMethod (c$, "numListeningMask", +function (mask) { +if ((mask == 32768 && (this.hierarchyListener != null || (this.eventMask & 32768) != 0)) || (mask == 65536 && (this.hierarchyBoundsListener != null || (this.eventMask & 65536) != 0))) { +return 1; +} else { +return 0; +}}, "~N"); +Clazz_defineMethod (c$, "countHierarchyMembers", +function () { +return 1; +}); +Clazz_defineMethod (c$, "createHierarchyEvents", +function (id, changed, changedParent, changeFlags, enabledOnToolkit) { +return this.createHierEventsComp (id, changed, changedParent, changeFlags, enabledOnToolkit); +}, "~N,java.awt.Component,java.awt.Container,~N,~B"); +Clazz_defineMethod (c$, "createHierEventsComp", +function (id, changed, changedParent, changeFlags, enabledOnToolkit) { +switch (id) { +case 1400: +if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || enabledOnToolkit) { +var e = new java.awt.event.HierarchyEvent (this, id, changed, changedParent, changeFlags); +this.dispatchEvent (e); +return 1; +}break; +case 1401: +case 1402: +if (this.hierarchyBoundsListener != null || (this.eventMask & 65536) != 0 || enabledOnToolkit) { +var e = new java.awt.event.HierarchyEvent (this, id, changed, changedParent); +this.dispatchEvent (e); +return 1; +}break; +default: +break; +} +return 0; +}, "~N,java.awt.Component,java.awt.Container,~N,~B"); +Clazz_defineMethod (c$, "getHierarchyBoundsListeners", +function () { +return (this.getListeners (java.awt.event.HierarchyBoundsListener)); +}); +Clazz_defineMethod (c$, "adjustListeningChildrenOnParent", +function (mask, num) { +if (this.parent != null) { +this.parent.adjustListeningChildren (mask, num); +}}, "~N,~N"); +Clazz_defineMethod (c$, "addKeyListener", +function (l) { +if (l == null) { +return; +}this.keyListener = java.awt.AWTEventMulticaster.add (this.keyListener, l); +this.newEventsOnly = true; +}, "java.awt.event.KeyListener"); +Clazz_defineMethod (c$, "removeKeyListener", +function (l) { +if (l == null) { +return; +}this.keyListener = java.awt.AWTEventMulticaster.remove (this.keyListener, l); +}, "java.awt.event.KeyListener"); +Clazz_defineMethod (c$, "getKeyListeners", +function () { +return (this.getListeners (java.awt.event.KeyListener)); +}); +Clazz_defineMethod (c$, "addMouseListener", +function (l) { +if (l == null) { +return; +}System.out.println ("C adding mouse listener " + l); +this.mouseListener = java.awt.AWTEventMulticaster.add (this.mouseListener, l); +this.newEventsOnly = true; +}, "java.awt.event.MouseListener"); +Clazz_defineMethod (c$, "removeMouseListener", +function (l) { +if (l == null) { +return; +}this.mouseListener = java.awt.AWTEventMulticaster.remove (this.mouseListener, l); +}, "java.awt.event.MouseListener"); +Clazz_defineMethod (c$, "getMouseListeners", +function () { +return (this.getListeners (java.awt.event.MouseListener)); +}); +Clazz_defineMethod (c$, "addMouseMotionListener", +function (l) { +if (l == null) { +return; +}this.mouseMotionListener = java.awt.AWTEventMulticaster.add (this.mouseMotionListener, l); +this.newEventsOnly = true; +}, "java.awt.event.MouseMotionListener"); +Clazz_defineMethod (c$, "removeMouseMotionListener", +function (l) { +if (l == null) { +return; +}this.mouseMotionListener = java.awt.AWTEventMulticaster.remove (this.mouseMotionListener, l); +}, "java.awt.event.MouseMotionListener"); +Clazz_defineMethod (c$, "getMouseMotionListeners", +function () { +return (this.getListeners (java.awt.event.MouseMotionListener)); +}); +Clazz_defineMethod (c$, "addMouseWheelListener", +function (l) { +if (l == null) { +return; +}this.mouseWheelListener = java.awt.AWTEventMulticaster.add (this.mouseWheelListener, l); +this.newEventsOnly = true; +}, "java.awt.event.MouseWheelListener"); +Clazz_defineMethod (c$, "removeMouseWheelListener", +function (l) { +if (l == null) { +return; +}this.mouseWheelListener = java.awt.AWTEventMulticaster.remove (this.mouseWheelListener, l); +}, "java.awt.event.MouseWheelListener"); +Clazz_defineMethod (c$, "getMouseWheelListeners", +function () { +return (this.getListeners (java.awt.event.MouseWheelListener)); +}); +Clazz_defineMethod (c$, "addInputMethodListener", +function (l) { +if (l == null) { +return; +}this.inputMethodListener = java.awt.AWTEventMulticaster.add (this.inputMethodListener, l); +this.newEventsOnly = true; +}, "java.awt.event.InputMethodListener"); +Clazz_defineMethod (c$, "removeInputMethodListener", +function (l) { +if (l == null) { +return; +}this.inputMethodListener = java.awt.AWTEventMulticaster.remove (this.inputMethodListener, l); +}, "java.awt.event.InputMethodListener"); +Clazz_defineMethod (c$, "getInputMethodListeners", +function () { +return (this.getListeners (java.awt.event.InputMethodListener)); +}); +Clazz_defineMethod (c$, "getListeners", +function (listenerType) { +return this.getListenersComp (listenerType); +}, "Class"); +Clazz_defineMethod (c$, "getListenersComp", +function (listenerType) { +var l = null; +if (listenerType === java.awt.event.ComponentListener) { +l = this.componentListener; +} else if (listenerType === java.awt.event.FocusListener) { +l = this.focusListener; +} else if (listenerType === java.awt.event.HierarchyListener) { +l = this.hierarchyListener; +} else if (listenerType === java.awt.event.HierarchyBoundsListener) { +l = this.hierarchyBoundsListener; +} else if (listenerType === java.awt.event.KeyListener) { +l = this.keyListener; +} else if (listenerType === java.awt.event.MouseListener) { +l = this.mouseListener; +} else if (listenerType === java.awt.event.MouseMotionListener) { +l = this.mouseMotionListener; +} else if (listenerType === java.awt.event.MouseWheelListener) { +l = this.mouseWheelListener; +} else if (listenerType === java.awt.event.InputMethodListener) { +l = this.inputMethodListener; +} else if (listenerType === java.beans.PropertyChangeListener) { +return this.getPropertyChangeListeners (); +}return java.awt.AWTEventMulticaster.getListeners (l, listenerType); +}, "Class"); +Clazz_defineMethod (c$, "enableEvents", +function (eventsToEnable) { +var notifyAncestors = 0; +{ +if ((eventsToEnable & 32768) != 0 && this.hierarchyListener == null && (this.eventMask & 32768) == 0) { +notifyAncestors |= 32768; +}if ((eventsToEnable & 65536) != 0 && this.hierarchyBoundsListener == null && (this.eventMask & 65536) == 0) { +notifyAncestors |= 65536; +}this.eventMask |= eventsToEnable; +this.newEventsOnly = true; +}if (Clazz_instanceOf (this.peer, java.awt.peer.LightweightPeer)) { +this.parent.proxyEnableEvents (this.eventMask); +}if (notifyAncestors != 0) { +{ +this.adjustListeningChildrenOnParent (notifyAncestors, 1); +}}}, "~N"); +Clazz_defineMethod (c$, "disableEvents", +function (eventsToDisable) { +var notifyAncestors = 0; +{ +if ((eventsToDisable & 32768) != 0 && this.hierarchyListener == null && (this.eventMask & 32768) != 0) { +notifyAncestors |= 32768; +}if ((eventsToDisable & 65536) != 0 && this.hierarchyBoundsListener == null && (this.eventMask & 65536) != 0) { +notifyAncestors |= 65536; +}this.eventMask &= ~eventsToDisable; +}if (notifyAncestors != 0) { +{ +this.adjustListeningChildrenOnParent (notifyAncestors, -1); +}}}, "~N"); +Clazz_defineMethod (c$, "checkCoalescing", + function () { +if (this.getClass ().getClassLoader () == null) { +return false; +}var clazz = this.getClass (); +{ +var value = java.awt.Component.coalesceMap.get (clazz); +if (value != null) { +return value; +}var enabled = Boolean.$valueOf (swingjs.JSToolkit.checkClassMethod (this, "coalesceEvents", "\\java.awt.AWTEvent\\java.awt.AWTEvent")); +java.awt.Component.coalesceMap.put (clazz, enabled); +return enabled; +}}); +Clazz_defineMethod (c$, "isCoalescingEnabled", +function () { +return this.coalescingEnabled; +}); +Clazz_defineMethod (c$, "coalesceEvents", +function (existingEvent, newEvent) { +return null; +}, "java.awt.AWTEvent,java.awt.AWTEvent"); +Clazz_defineMethod (c$, "processEvent", +function (e) { +this.processEventComp (e); +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "processEventComp", +function (e) { +if (Clazz_instanceOf (e, java.awt.event.FocusEvent)) { +this.processFocusEvent (e); +} else if (Clazz_instanceOf (e, java.awt.event.MouseEvent)) { +switch (e.getID ()) { +case 501: +case 502: +case 500: +case 504: +case 505: +this.processMouseEvent (e); +break; +case 503: +case 506: +this.processMouseMotionEvent (e); +break; +case 507: +this.processMouseWheelEvent (e); +break; +} +} else if (Clazz_instanceOf (e, java.awt.event.KeyEvent)) { +this.processKeyEvent (e); +} else if (Clazz_instanceOf (e, java.awt.event.ComponentEvent)) { +this.processComponentEvent (e); +} else if (Clazz_instanceOf (e, java.awt.event.InputMethodEvent)) { +this.processInputMethodEvent (e); +} else if (Clazz_instanceOf (e, java.awt.event.HierarchyEvent)) { +switch (e.getID ()) { +case 1400: +this.processHierarchyEvent (e); +break; +case 1401: +case 1402: +this.processHierarchyBoundsEvent (e); +break; +} +}}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "processComponentEvent", +function (e) { +var listener = this.componentListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 101: +listener.componentResized (e); +break; +case 100: +listener.componentMoved (e); +break; +case 102: +listener.componentShown (e); +break; +case 103: +listener.componentHidden (e); +break; +} +}}, "java.awt.event.ComponentEvent"); +Clazz_defineMethod (c$, "processFocusEvent", +function (e) { +var listener = this.focusListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 1004: +listener.focusGained (e); +break; +case 1005: +listener.focusLost (e); +break; +} +}}, "java.awt.event.FocusEvent"); +Clazz_defineMethod (c$, "processKeyEvent", +function (e) { +var listener = this.keyListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 400: +listener.keyTyped (e); +break; +case 401: +listener.keyPressed (e); +break; +case 402: +listener.keyReleased (e); +break; +} +}}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "processMouseEvent", +function (e) { +var listener = this.mouseListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 501: +listener.mousePressed (e); +break; +case 502: +listener.mouseReleased (e); +break; +case 500: +listener.mouseClicked (e); +break; +case 505: +listener.mouseExited (e); +break; +case 504: +listener.mouseEntered (e); +break; +} +}}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "processMouseMotionEvent", +function (e) { +var listener = this.mouseMotionListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 503: +listener.mouseMoved (e); +break; +case 506: +listener.mouseDragged (e); +break; +} +}}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "processMouseWheelEvent", +function (e) { +var listener = this.mouseWheelListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 507: +listener.mouseWheelMoved (e); +break; +} +}}, "java.awt.event.MouseWheelEvent"); +Clazz_defineMethod (c$, "postsOldMouseEvents", +function () { +return false; +}); +Clazz_defineMethod (c$, "processInputMethodEvent", +function (e) { +var listener = this.inputMethodListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 1100: +listener.inputMethodTextChanged (e); +break; +case 1101: +listener.caretPositionChanged (e); +break; +} +}}, "java.awt.event.InputMethodEvent"); +Clazz_defineMethod (c$, "processHierarchyEvent", +function (e) { +var listener = this.hierarchyListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 1400: +listener.hierarchyChanged (e); +break; +} +}}, "java.awt.event.HierarchyEvent"); +Clazz_defineMethod (c$, "processHierarchyBoundsEvent", +function (e) { +var listener = this.hierarchyBoundsListener; +if (listener != null) { +var id = e.getID (); +switch (id) { +case 1401: +listener.ancestorMoved (e); +break; +case 1402: +listener.ancestorResized (e); +break; +} +}}, "java.awt.event.HierarchyEvent"); +Clazz_defineMethod (c$, "handleEvent", +function (evt) { +switch (evt.id) { +case 504: +return this.mouseEnter (evt, evt.x, evt.y); +case 505: +return this.mouseExit (evt, evt.x, evt.y); +case 503: +return this.mouseMove (evt, evt.x, evt.y); +case 501: +return this.mouseDown (evt, evt.x, evt.y); +case 506: +return this.mouseDrag (evt, evt.x, evt.y); +case 502: +return this.mouseUp (evt, evt.x, evt.y); +case 401: +case 403: +return this.keyDown (evt, evt.key); +case 402: +case 404: +return this.keyUp (evt, evt.key); +case 1001: +return this.action (evt, evt.arg); +case 1004: +return this.gotFocus (evt, evt.arg); +case 1005: +return this.lostFocus (evt, evt.arg); +} +return false; +}, "java.awt.Event"); +Clazz_defineMethod (c$, "mouseDown", +function (evt, x, y) { +return false; +}, "java.awt.Event,~N,~N"); +Clazz_defineMethod (c$, "mouseDrag", +function (evt, x, y) { +return false; +}, "java.awt.Event,~N,~N"); +Clazz_defineMethod (c$, "mouseUp", +function (evt, x, y) { +return false; +}, "java.awt.Event,~N,~N"); +Clazz_defineMethod (c$, "mouseMove", +function (evt, x, y) { +return false; +}, "java.awt.Event,~N,~N"); +Clazz_defineMethod (c$, "mouseEnter", +function (evt, x, y) { +return false; +}, "java.awt.Event,~N,~N"); +Clazz_defineMethod (c$, "mouseExit", +function (evt, x, y) { +return false; +}, "java.awt.Event,~N,~N"); +Clazz_defineMethod (c$, "keyDown", +function (evt, key) { +return false; +}, "java.awt.Event,~N"); +Clazz_defineMethod (c$, "keyUp", +function (evt, key) { +return false; +}, "java.awt.Event,~N"); +Clazz_defineMethod (c$, "action", +function (evt, what) { +return false; +}, "java.awt.Event,~O"); +Clazz_defineMethod (c$, "addNotify", +function () { +this.addNotifyComp (); +}); +Clazz_defineMethod (c$, "addNotifyComp", +function () { +{ +var peer = this.peer; +if (peer == null || Clazz_instanceOf (peer, java.awt.peer.LightweightPeer)) { +if (peer == null) { +this.peer = peer = this.getToolkit ().createComponent (this); +}if (this.parent != null) { +var mask = 0; +if ((this.mouseListener != null) || ((this.eventMask & 16) != 0)) { +mask |= 16; +}if ((this.mouseMotionListener != null) || ((this.eventMask & 32) != 0)) { +mask |= 32; +}if ((this.mouseWheelListener != null) || ((this.eventMask & 131072) != 0)) { +mask |= 131072; +}if (this.focusListener != null || (this.eventMask & 4) != 0) { +mask |= 4; +}if (this.keyListener != null || (this.eventMask & 8) != 0) { +mask |= 8; +}if (mask != 0) { +this.parent.proxyEnableEvents (mask); +}}} else { +var parent = this.parent; +if (parent != null && Clazz_instanceOf (parent.peer, java.awt.peer.LightweightPeer)) { +this.relocateComponent (); +}}this.invalidate (); +this.peerFont = this.getFont (); +if (this.getContainer () != null && !this.isAddNotifyComplete) { +this.getContainer ().increaseComponentCount (this); +}if (this.parent != null && this.parent.peer != null) { +var parentContPeer = this.parent.peer; +if (Clazz_instanceOf (parentContPeer, java.awt.peer.LightweightPeer) && !(Clazz_instanceOf (peer, java.awt.peer.LightweightPeer))) { +var hwParent = this.getNativeContainer (); +if (hwParent != null && hwParent.peer != null) { +parentContPeer = hwParent.peer; +}}}if (!this.isAddNotifyComplete) { +this.mixOnShowing (); +}this.isAddNotifyComplete = true; +if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || java.awt.Toolkit.enabledOnToolkit (32768)) { +var e = new java.awt.event.HierarchyEvent (this, 1400, this, this.parent, 2 | ((this.isRecursivelyVisible ()) ? 4 : 0)); +this.dispatchEvent (e); +}}}); +Clazz_defineMethod (c$, "getNativeContainer", +function () { +var p = this.parent; +while (p != null && Clazz_instanceOf (p.peer, java.awt.peer.LightweightPeer)) { +p = p.getParent (); +} +return p; +}); +Clazz_defineMethod (c$, "removeNotify", +function () { +this.removeNotifyComp (); +}); +Clazz_defineMethod (c$, "removeNotifyComp", +function () { +{ +if (this.getContainer () != null && this.isAddNotifyComplete) { +this.getContainer ().decreaseComponentCount (this); +}var p = this.peer; +if (p != null) { +var isLightweight = this.isLightweight (); +this.peer = null; +this.peerFont = null; +java.awt.Toolkit.getEventQueue ().removeSourceEvents (this, false); +p.dispose (); +this.mixOnHiding (isLightweight); +this.isAddNotifyComplete = false; +}if (this.hierarchyListener != null || (this.eventMask & 32768) != 0 || java.awt.Toolkit.enabledOnToolkit (32768)) { +var e = new java.awt.event.HierarchyEvent (this, 1400, this, this.parent, 2 | ((this.isRecursivelyVisible ()) ? 4 : 0)); +this.dispatchEvent (e); +}}}); +Clazz_defineMethod (c$, "gotFocus", +function (evt, what) { +return false; +}, "java.awt.Event,~O"); +Clazz_defineMethod (c$, "lostFocus", +function (evt, what) { +return false; +}, "java.awt.Event,~O"); +Clazz_defineMethod (c$, "isFocusTraversable", +function () { +if (this.$isFocusTraversableOverridden == 0) { +this.$isFocusTraversableOverridden = 1; +}return this.focusable; +}); +Clazz_defineMethod (c$, "isFocusable", +function () { +return this.isFocusTraversable (); +}); +Clazz_defineMethod (c$, "setFocusable", +function (focusable) { +var oldFocusable; +{ +oldFocusable = this.focusable; +this.focusable = focusable; +}this.$isFocusTraversableOverridden = 2; +this.firePropertyChangeObject ("focusable", new Boolean (oldFocusable), new Boolean (focusable)); +}, "~B"); +Clazz_defineMethod (c$, "isFocusTraversableOverridden", +function () { +return (this.$isFocusTraversableOverridden != 1); +}); +Clazz_defineMethod (c$, "getFocusTraversalKeysEnabled", +function () { +return this.focusTraversalKeysEnabled; +}); +Clazz_defineMethod (c$, "requestFocus", +function () { +swingjs.JSToolkit.requestFocus (this); +}); +Clazz_defineMethod (c$, "requestFocus", +function (temporary) { +return swingjs.JSToolkit.requestFocus (this); +}, "~B"); +Clazz_defineMethod (c$, "requestFocusInWindow", +function () { +return swingjs.JSToolkit.requestFocus (this); +}); +Clazz_defineMethod (c$, "requestFocusInWindow", +function (temporary) { +return swingjs.JSToolkit.requestFocus (this); +}, "~B"); +Clazz_defineMethod (c$, "getFocusCycleRootAncestor", +function () { +var rootAncestor = this.parent; +while (rootAncestor != null && !rootAncestor.isFocusCycleRoot ()) { +rootAncestor = rootAncestor.parent; +} +return rootAncestor; +}); +Clazz_defineMethod (c$, "isFocusCycleRoot", +function (container) { +return this.isFocusCycleRootComp (container); +}, "java.awt.Container"); +Clazz_defineMethod (c$, "isFocusCycleRootComp", +function (container) { +var rootAncestor = this.getFocusCycleRootAncestor (); +return (rootAncestor === container); +}, "java.awt.Container"); +Clazz_defineMethod (c$, "hasFocus", +function () { +return swingjs.JSToolkit.hasFocus (this); +}); +Clazz_defineMethod (c$, "isFocusOwner", +function () { +return this.hasFocus (); +}); +Clazz_defineMethod (c$, "setAutoFocusTransferOnDisposal", +function (value) { +this.autoFocusTransferOnDisposal = value; +}, "~B"); +Clazz_defineMethod (c$, "isAutoFocusTransferOnDisposal", +function () { +return this.autoFocusTransferOnDisposal; +}); +Clazz_defineMethod (c$, "paramString", +function () { +return this.paramStringComp (); +}); +Clazz_defineMethod (c$, "paramStringComp", +function () { +var thisName = this.getName (); +var str = (thisName != null ? thisName : ""); +if (!this.isValid ()) { +str += ",invalid"; +}if (!this.visible) { +str += ",hidden"; +}if (!this.enabled) { +str += ",disabled"; +}str += ",parent:" + (this.parent == null ? null : this.parent.getName ()) + "," + this.x + "," + this.y + "," + this.width + "x" + this.height; +return str; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[" + this.paramString () + "]"; +}); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (listener) { +this.addPropChangeListenerComp (listener); +}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "addPropChangeListenerComp", +function (listener) { +{ +if (listener == null) { +return; +}if (this.changeSupport == null) { +this.changeSupport = new java.beans.PropertyChangeSupport (this); +}this.changeSupport.addPropertyChangeListener1 (listener); +}}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (listener) { +{ +if (listener == null || this.changeSupport == null) { +return; +}this.changeSupport.removePropertyChangeListener (listener); +}}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +{ +if (this.changeSupport == null) { +return new Array (0); +}return this.changeSupport.getPropertyChangeListeners (); +}}); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (propertyName, listener) { +this.addPropChangeListComp (propertyName, listener); +}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "addPropChangeListComp", +function (propertyName, listener) { +{ +if (arguments.length == 1) { +addPropertyChangeListener1(propertyName); return; } +}{ +if (listener == null) { +return; +}if (this.changeSupport == null) { +this.changeSupport = new java.beans.PropertyChangeSupport (this); +}this.changeSupport.addPropertyChangeListener2 (propertyName, listener); +}}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (propertyName, listener) { +{ +if (listener == null || this.changeSupport == null) { +return; +}this.changeSupport.removePropertyChangeListener (propertyName, listener); +}}, "~S,java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function (propertyName) { +{ +if (this.changeSupport == null) { +return new Array (0); +}return this.changeSupport.getPropertyChangeListeners (propertyName); +}}, "~S"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +this.firePropertyChangeObject (propertyName, oldValue, newValue); +}, "~S,~O,~O"); +Clazz_defineMethod (c$, "firePropertyChangeObject", +function (propertyName, oldValue, newValue) { +var changeSupport; +{ +changeSupport = this.changeSupport; +}if (changeSupport == null || (oldValue != null && newValue != null && oldValue.equals (newValue))) { +return; +}changeSupport.firePropertyChange (propertyName, oldValue, newValue); +}, "~S,~O,~O"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +this.firePropertyChangeBool (propertyName, oldValue, newValue); +}, "~S,~B,~B"); +Clazz_defineMethod (c$, "firePropertyChangeBool", +function (propertyName, oldValue, newValue) { +var changeSupport = this.changeSupport; +if (changeSupport == null || oldValue == newValue) { +return; +}changeSupport.firePropertyChange (propertyName, Boolean.$valueOf (oldValue), Boolean.$valueOf (newValue)); +}, "~S,~B,~B"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +this.firePropertyChangeInt (propertyName, oldValue, newValue); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "firePropertyChangeInt", +function (propertyName, oldValue, newValue) { +var changeSupport = this.changeSupport; +if (changeSupport == null || oldValue == newValue) { +return; +}changeSupport.firePropertyChange (propertyName, Integer.$valueOf (oldValue), Integer.$valueOf (newValue)); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +this.firePropertyChangeChar (propertyName, oldValue, newValue); +}, "~S,~S,~S"); +Clazz_defineMethod (c$, "firePropertyChangeChar", +function (propertyName, oldValue, newValue) { +if (this.changeSupport == null || oldValue == newValue) { +return; +}this.firePropertyChangeObject (propertyName, new Character (oldValue), new Character (newValue)); +}, "~S,~S,~S"); +Clazz_defineMethod (c$, "firePropertyChangeShort", +function (propertyName, oldValue, newValue) { +if (this.changeSupport == null || oldValue == newValue) { +return; +}this.firePropertyChangeObject (propertyName, Short.$valueOf (oldValue), Short.$valueOf (newValue)); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "firePropertyChangeLong", +function (propertyName, oldValue, newValue) { +if (this.changeSupport == null || oldValue == newValue) { +return; +}this.firePropertyChangeObject (propertyName, Long.$valueOf (oldValue), Long.$valueOf (newValue)); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "firePropertyChangeFloat", +function (propertyName, oldValue, newValue) { +if (this.changeSupport == null || oldValue == newValue) { +return; +}this.firePropertyChangeObject (propertyName, Float.$valueOf (oldValue), Float.$valueOf (newValue)); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "firePropertyChangeDouble", +function (propertyName, oldValue, newValue) { +if (this.changeSupport == null || oldValue == newValue) { +return; +}this.firePropertyChangeObject (propertyName, Double.$valueOf (oldValue), Double.$valueOf (newValue)); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "setComponentOrientation", +function (o) { +var oldValue = this.componentOrientation; +this.componentOrientation = o; +this.firePropertyChangeObject ("componentOrientation", oldValue, o); +this.invalidateIfValid (); +}, "java.awt.ComponentOrientation"); +Clazz_defineMethod (c$, "getComponentOrientation", +function () { +return this.componentOrientation; +}); +Clazz_defineMethod (c$, "applyComponentOrientation", +function (orientation) { +this.applyCompOrientComp (orientation); +}, "java.awt.ComponentOrientation"); +Clazz_defineMethod (c$, "applyCompOrientComp", +function (orientation) { +if (orientation == null) { +throw new NullPointerException (); +}this.setComponentOrientation (orientation); +}, "java.awt.ComponentOrientation"); +Clazz_defineMethod (c$, "canBeFocusOwner", +function () { +if (this.isEnabled () && this.isDisplayable () && this.isVisible () && this.isFocusable ()) { +return true; +}return false; +}); +Clazz_defineMethod (c$, "canBeFocusOwnerRecursively", +function () { +if (!this.canBeFocusOwner ()) { +return false; +}if (this.parent != null) { +return this.parent.canContainFocusOwner (this); +}return true; +}); +Clazz_defineMethod (c$, "relocateComponent", +function () { +}); +Clazz_defineMethod (c$, "getContainingWindow", +function () { +return jssun.awt.SunToolkit.getContainingWindow (this); +}); +c$.isInstanceOf = Clazz_defineMethod (c$, "isInstanceOf", +function (obj, className) { +if (obj == null) return false; +if (className == null) return false; +var cls = obj.getClass (); +while (cls != null) { +if (cls.getName ().equals (className)) { +return true; +}cls = cls.getSuperclass (); +} +return false; +}, "~O,~S"); +Clazz_defineMethod (c$, "areBoundsValid", +function () { +var cont = this.getContainer (); +return cont == null || cont.isValid () || cont.getLayout () == null; +}); +Clazz_defineMethod (c$, "getLocationOnWindow", +function () { +var curLocation = this.getLocation (); +for (var parent = this.getContainer (); parent != null && !(Clazz_instanceOf (parent, java.awt.Window)); parent = parent.getContainer ()) { +curLocation.x += parent.getX (); +curLocation.y += parent.getY (); +} +return curLocation; +}); +Clazz_defineMethod (c$, "getSiblingIndexAbove", +function () { +var parent = this.getContainer (); +if (parent == null) { +return -1; +}var nextAbove = parent.getComponentZOrder (this) - 1; +return nextAbove < 0 ? -1 : nextAbove; +}); +Clazz_defineMethod (c$, "getSiblingIndexBelow", +function () { +var parent = this.getContainer (); +if (parent == null) { +return -1; +}var nextBelow = parent.getComponentZOrder (this) + 1; +return nextBelow >= parent.getComponentCount () ? -1 : nextBelow; +}); +Clazz_defineMethod (c$, "mixOnShowing", +function () { +}); +Clazz_defineMethod (c$, "mixOnHiding", +function (isLightweight) { +}, "~B"); +Clazz_defineMethod (c$, "mixOnReshaping", +function () { +swingjs.JSToolkit.taintUI (this); +}); +Clazz_defineMethod (c$, "mixOnZOrderChanging", +function (oldZorder, newZorder) { +}, "~N,~N"); +Clazz_defineMethod (c$, "mixOnValidating", +function () { +}); +c$.doesClassImplement = Clazz_defineMethod (c$, "doesClassImplement", + function (cls, interfaceName) { +if (cls == null) return false; +for (var c, $c = 0, $$c = cls.getInterfaces (); $c < $$c.length && ((c = $$c[$c]) || true); $c++) { +if (c.getName ().equals (interfaceName)) { +return true; +}} +return java.awt.Component.doesClassImplement (cls.getSuperclass (), interfaceName); +}, "Class,~S"); +c$.doesImplement = Clazz_defineMethod (c$, "doesImplement", +function (obj, interfaceName) { +if (obj == null) return false; +if (interfaceName == null) return false; +return java.awt.Component.doesClassImplement (obj.getClass (), interfaceName); +}, "~O,~S"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.Component, "BaselineResizeBehavior", Enum); +Clazz_defineEnumConstant (c$, "CONSTANT_ASCENT", 0, []); +Clazz_defineEnumConstant (c$, "CONSTANT_DESCENT", 1, []); +Clazz_defineEnumConstant (c$, "CENTER_OFFSET", 2, []); +Clazz_defineEnumConstant (c$, "OTHER", 3, []); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.Component, "AWTTreeLock"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"FOCUS_TRAVERSABLE_UNKNOWN", 0, +"FOCUS_TRAVERSABLE_DEFAULT", 1, +"FOCUS_TRAVERSABLE_SET", 2, +"actionListenerK", "actionL", +"adjustmentListenerK", "adjustmentL", +"componentListenerK", "componentL", +"containerListenerK", "containerL", +"focusListenerK", "focusL", +"itemListenerK", "itemL", +"keyListenerK", "keyL", +"mouseListenerK", "mouseL", +"mouseMotionListenerK", "mouseMotionL", +"mouseWheelListenerK", "mouseWheelL", +"textListenerK", "textL", +"ownedWindowK", "ownedL", +"windowListenerK", "windowL", +"inputMethodListenerK", "inputMethodL", +"hierarchyListenerK", "hierarchyL", +"hierarchyBoundsListenerK", "hierarchyBoundsL", +"windowStateListenerK", "windowStateL", +"windowFocusListenerK", "windowFocusL", +"isInc", false, +"incRate", 0, +"TOP_ALIGNMENT", 0.0, +"CENTER_ALIGNMENT", 0.5, +"BOTTOM_ALIGNMENT", 1.0, +"LEFT_ALIGNMENT", 0.0, +"RIGHT_ALIGNMENT", 1.0, +"incr", 0); +c$.coalesceMap = c$.prototype.coalesceMap = new java.util.HashMap (); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (null, "jssun.awt.SunGraphicsCallback", ["java.awt.Container", "$.Graphics2D", "jssun.awt.ConstrainableGraphics", "$.Graphics2Delegate"], function () { +c$ = Clazz_declareType (jssun.awt, "SunGraphicsCallback"); +Clazz_defineMethod (c$, "constrainGraphics", +function (g, bounds) { +if (Clazz_instanceOf (g, jssun.awt.ConstrainableGraphics)) { +(g).constrain (bounds.x, bounds.y, bounds.width, bounds.height); +} else { +g.translate (bounds.x, bounds.y); +}g.clipRect (0, 0, bounds.width, bounds.height); +}, "java.awt.Graphics,java.awt.Rectangle"); +Clazz_defineMethod (c$, "runOneComponent", +function (comp, bounds, g, clip, weightFlags) { +if (comp == null || !comp.isLightweight () || !comp.isVisible ()) { +return; +}var lightweight = comp.isLightweight (); +if ((lightweight && (weightFlags & 2) == 0) || (!lightweight && (weightFlags & 1) == 0)) { +return; +}if (bounds == null) { +bounds = comp.getBounds (); +}if (clip == null || clip.intersects (bounds)) { +var cg = g.createSwingJS (); +try { +this.constrainGraphics (cg, bounds); +cg.setFont (comp.getFont ()); +cg.setColor (comp.getForeground ()); +if (Clazz_instanceOf (cg, java.awt.Graphics2D)) { +(cg).setBackground (comp.getBackground ()); +} else if (Clazz_instanceOf (cg, jssun.awt.Graphics2Delegate)) { +(cg).setBackground (comp.getBackground ()); +}this.run (comp, cg); +} finally { +cg.dispose (); +} +}}, "java.awt.Component,java.awt.Rectangle,java.awt.Graphics,java.awt.Shape,~N"); +Clazz_defineMethod (c$, "runComponents", +function (comps, g, weightFlags) { +var ncomponents = comps.length; +var clip = g.getClip (); +for (var i = ncomponents - 1; i >= 0; i--) { +this.runOneComponent (comps[i], null, g, clip, weightFlags); +} +}, "~A,java.awt.Graphics,~N"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (jssun.awt.SunGraphicsCallback, "PaintHeavyweightComponentsCallback", jssun.awt.SunGraphicsCallback); +Clazz_makeConstructor (c$, + function () { +Clazz_superConstructor (this, jssun.awt.SunGraphicsCallback.PaintHeavyweightComponentsCallback, []); +}); +Clazz_overrideMethod (c$, "run", +function (a, b) { +if (!a.isLightweight ()) { +a.paintAll (b); +} else if (Clazz_instanceOf (a, java.awt.Container)) { +this.runComponents ((a).getComponents (), b, 3); +}}, "java.awt.Component,java.awt.Graphics"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function () { +return jssun.awt.SunGraphicsCallback.PaintHeavyweightComponentsCallback.instance; +}); +c$.instance = c$.prototype.instance = new jssun.awt.SunGraphicsCallback.PaintHeavyweightComponentsCallback (); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"HEAVYWEIGHTS", 0x1, +"LIGHTWEIGHTS", 0x2, +"TWO_PASSES", 0x4); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.util.HashMap", "java.awt.Rectangle"], "javax.swing.RepaintManager", ["java.lang.StringBuffer", "$.Thread", "java.util.ArrayList", "$.HashSet", "$.IdentityHashMap", "java.applet.Applet", "java.awt.Frame", "$.Toolkit", "$.Window", "java.awt.event.InvocationEvent", "javax.swing.CellRendererPane", "$.JComponent", "$.SwingUtilities", "jssun.awt.AWTAccessor", "$.AppContext", "$.SunToolkit", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.volatileMap = null; +this.hwDirtyComponents = null; +this.dirtyComponents = null; +this.tmpDirtyComponents = null; +this.invalidComponents = null; +this.runnableList = null; +this.paintDepth = 0; +this.painting = false; +this.repaintRoot = null; +this.paintThread = null; +this.processingRunnable = null; +this.myComponent = null; +this.tmp = null; +if (!Clazz_isClassDefined ("javax.swing.RepaintManager.ProcessingRunnable")) { +javax.swing.RepaintManager.$RepaintManager$ProcessingRunnable$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "RepaintManager"); +Clazz_prepareFields (c$, function () { +this.volatileMap = new java.util.HashMap (1); +this.tmp = new java.awt.Rectangle (); +}); +c$.currentManager = Clazz_defineMethod (c$, "currentManager", +function (c) { +var appContext = jssun.awt.AppContext.getAppContext (); +var rm = appContext.get (javax.swing.RepaintManager.repaintManagerKey); +if (rm == null) { +rm = new javax.swing.RepaintManager (); +rm.set (c); +appContext.put (javax.swing.RepaintManager.repaintManagerKey, rm); +}return rm; +}, "java.awt.Component"); +c$.setCurrentManager = Clazz_defineMethod (c$, "setCurrentManager", +function (aRepaintManager) { +if (aRepaintManager != null) { +javax.swing.SwingUtilities.appContextPut (javax.swing.RepaintManager.repaintManagerKey, aRepaintManager); +} else { +javax.swing.SwingUtilities.appContextRemove (javax.swing.RepaintManager.repaintManagerKey); +}}, "javax.swing.RepaintManager"); +Clazz_makeConstructor (c$, + function () { +this.processingRunnable = Clazz_innerTypeInstance (javax.swing.RepaintManager.ProcessingRunnable, this, null); +}); +Clazz_defineMethod (c$, "set", + function (c) { +this.myComponent = c; +this.dirtyComponents = new java.util.IdentityHashMap (); +this.tmpDirtyComponents = new java.util.IdentityHashMap (); +this.hwDirtyComponents = new java.util.IdentityHashMap (); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "addInvalidComponent", +function (invalidComponent) { +var validateRoot = null; +for (var c = invalidComponent; c != null; c = c.getParent ()) { +if ((Clazz_instanceOf (c, javax.swing.CellRendererPane))) { +return; +}if ((Clazz_instanceOf (c, javax.swing.JComponent)) && ((c).isValidateRoot ())) { +validateRoot = c; +break; +}} +if (validateRoot == null) { +return; +}var root = null; +for (var c = validateRoot; c != null; c = c.getParent ()) { +if (!c.isVisible ()) { +return; +}if ((Clazz_instanceOf (c, java.awt.Window)) || (Clazz_instanceOf (c, java.applet.Applet))) { +root = c; +break; +}} +if (root == null) { +return; +}if (this.invalidComponents == null) { +this.invalidComponents = new java.util.ArrayList (); +} else { +var n = this.invalidComponents.size (); +for (var i = 0; i < n; i++) { +if (validateRoot === this.invalidComponents.get (i)) { +return; +}} +}this.invalidComponents.add (validateRoot); +this.scheduleProcessingRunnable (root); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "removeInvalidComponent", +function (component) { +if (this.invalidComponents != null) { +var index = this.invalidComponents.indexOf (component); +if (index != -1) { +this.invalidComponents.remove (index); +}}}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "addDirtyRegion0", + function (c, x, y, w, h) { +{ +var g = c.getGraphics(); +if (g == null || g.gc == null)return; +}if ((w <= 0) || (h <= 0) || (c == null)) { +return; +}if ((c.getWidth () <= 0) || (c.getHeight () <= 0)) { +return; +}if (this.extendDirtyRegion (c, x, y, w, h)) { +return; +}var root = null; +for (var p = c; p != null; p = p.getParent ()) { +if (!p.isVisible () || p.getPeer () == null) { +return; +}if ((Clazz_instanceOf (p, java.awt.Window)) || (Clazz_instanceOf (p, java.applet.Applet))) { +if (Clazz_instanceOf (p, java.awt.Frame) && ((p).getExtendedState () & 1) == 1) { +return; +}root = p; +break; +}} +if (root == null) return; +{ +if (this.extendDirtyRegion (c, x, y, w, h)) { +return; +}this.dirtyComponents.put (c, new java.awt.Rectangle (x, y, w, h)); +}this.scheduleProcessingRunnable (c); +}, "java.awt.Container,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "addDirtyRegion", +function (c, x, y, w, h) { +this.addDirtyRegion0 (c, x, y, w, h); +}, "javax.swing.JComponent,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "addDirtyRegion", +function (window, x, y, w, h) { +this.addDirtyRegion0 (window, x, y, w, h); +}, "java.awt.Window,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "addDirtyRegion", +function (applet, x, y, w, h) { +this.addDirtyRegion0 (applet, x, y, w, h); +}, "java.applet.Applet,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "scheduleHeavyWeightPaints", +function () { +var hws; +{ +if (this.hwDirtyComponents.size () == 0) { +return; +}hws = this.hwDirtyComponents; +this.hwDirtyComponents = new java.util.IdentityHashMap (); +}for (var hw, $hw = hws.keySet ().iterator (); $hw.hasNext () && ((hw = $hw.next ()) || true);) { +var dirty = hws.get (hw); +if (Clazz_instanceOf (hw, java.awt.Window)) { +this.addDirtyRegion (hw, dirty.x, dirty.y, dirty.width, dirty.height); +} else if (Clazz_instanceOf (hw, java.applet.Applet)) { +this.addDirtyRegion (hw, dirty.x, dirty.y, dirty.width, dirty.height); +} else { +this.addDirtyRegion0 (hw, dirty.x, dirty.y, dirty.width, dirty.height); +}} +}); +Clazz_defineMethod (c$, "nativeAddDirtyRegion", +function (appContext, c, x, y, w, h) { +if (w > 0 && h > 0) { +{ +var dirty = this.hwDirtyComponents.get (c); +if (dirty == null) { +this.hwDirtyComponents.put (c, new java.awt.Rectangle (x, y, w, h)); +} else { +this.hwDirtyComponents.put (c, javax.swing.SwingUtilities.computeUnion (x, y, w, h, dirty)); +}}this.scheduleProcessingRunnable (appContext); +}}, "jssun.awt.AppContext,java.awt.Container,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "extendDirtyRegion", + function (c, x, y, w, h) { +var r = this.dirtyComponents.get (c); +if (r != null) { +javax.swing.SwingUtilities.computeUnion (x, y, w, h, r); +return true; +}return false; +}, "java.awt.Component,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getDirtyRegion", +function (aComponent) { +var r = null; +{ +r = this.dirtyComponents.get (aComponent); +}if (r == null) return new java.awt.Rectangle (0, 0, 0, 0); + else return new java.awt.Rectangle (r); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "markCompletelyDirty", +function (aComponent) { +this.addDirtyRegion (aComponent, 0, 0, 2147483647, 2147483647); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "markCompletelyClean", +function (aComponent) { +{ +this.dirtyComponents.remove (aComponent); +}}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "isCompletelyDirty", +function (aComponent) { +var r; +r = this.getDirtyRegion (aComponent); +if (r.width == 2147483647 && r.height == 2147483647) return true; + else return false; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "validateInvalidComponents", +function () { +var ic; +{ +if (this.invalidComponents == null) { +return; +}ic = this.invalidComponents; +this.invalidComponents = null; +}var n = ic.size (); +for (var i = 0; i < n; i++) { +var c = ic.get (i); +c.validate (); +} +}); +Clazz_defineMethod (c$, "prePaintDirtyRegions", + function () { +var dirtyComponents; +var runnableList; +{ +dirtyComponents = this.dirtyComponents; +runnableList = this.runnableList; +this.runnableList = null; +}if (runnableList != null) { +for (var runnable, $runnable = runnableList.iterator (); $runnable.hasNext () && ((runnable = $runnable.next ()) || true);) { +runnable.run (); +} +}this.paintDirtyRegions (); +if (dirtyComponents.size () > 0) { +this.paintDirtyRegions1 (dirtyComponents); +}}); +Clazz_defineMethod (c$, "updateWindows", + function (dirtyComponents) { +var toolkit = java.awt.Toolkit.getDefaultToolkit (); +if (!(Clazz_instanceOf (toolkit, jssun.awt.SunToolkit) && (toolkit).needUpdateWindow ())) { +return dirtyComponents; +}var windows = new java.util.HashSet (); +var dirtyComps = dirtyComponents.keySet (); +for (var it = dirtyComps.iterator (); it.hasNext (); ) { +var dirty = it.next (); +var window = Clazz_instanceOf (dirty, java.awt.Window) ? dirty : javax.swing.SwingUtilities.getWindowAncestor (dirty); +if (window != null && !jssun.awt.AWTAccessor.getWindowAccessor ().isOpaque (window)) { +it.remove (); +windows.add (window); +}} +for (var window, $window = windows.iterator (); $window.hasNext () && ((window = $window.next ()) || true);) { +jssun.awt.AWTAccessor.getWindowAccessor ().updateWindow (window, null); +} +return dirtyComponents; +}, "java.util.Map"); +Clazz_defineMethod (c$, "paintDirtyRegions", +function () { +{ +var tmp = this.tmpDirtyComponents; +this.tmpDirtyComponents = this.dirtyComponents; +this.dirtyComponents = tmp; +this.dirtyComponents.clear (); +}this.paintDirtyRegions1 (this.tmpDirtyComponents); +}); +Clazz_defineMethod (c$, "paintDirtyRegions1", + function (tmpDirtyComponents) { +if (tmpDirtyComponents.isEmpty ()) { +return; +}this.updateWindows (tmpDirtyComponents); +var roots = new java.util.ArrayList (tmpDirtyComponents.size ()); +for (var dirty, $dirty = tmpDirtyComponents.keySet ().iterator (); $dirty.hasNext () && ((dirty = $dirty.next ()) || true);) { +this.collectDirtyComponents (tmpDirtyComponents, dirty, roots); +} +var count = roots.size (); +this.painting = true; +try { +for (var j = 0; j < count; j++) { +var i = j; +var dirtyComponent = roots.get (j); +var rect = tmpDirtyComponents.get (dirtyComponent); +var localBoundsH = dirtyComponent.getHeight (); +var localBoundsW = dirtyComponent.getWidth (); +javax.swing.SwingUtilities.computeIntersection (0, 0, localBoundsW, localBoundsH, rect); +if (Clazz_instanceOf (dirtyComponent, javax.swing.JComponent)) { +(dirtyComponent).paintImmediately (rect.x, rect.y, rect.width, rect.height); +} else if (dirtyComponent.isShowing ()) { +var g = javax.swing.JComponent.safelyGetGraphics (dirtyComponent, dirtyComponent); +if (g != null) { +try { +dirtyComponent.paint (g); +} finally { +g.dispose (); +} +}}if (this.repaintRoot != null) { +this.adjustRoots (this.repaintRoot, roots, i + 1); +count = roots.size (); +this.repaintRoot.paintImmediately (0, 0, this.repaintRoot.getWidth (), this.repaintRoot.getHeight ()); +this.repaintRoot = null; +}} +} finally { +this.painting = false; +} +tmpDirtyComponents.clear (); +}, "java.util.Map"); +Clazz_defineMethod (c$, "adjustRoots", + function (root, roots, index) { +for (var i = roots.size () - 1; i >= index; i--) { +var c = roots.get (i); +for (; ; ) { +if (c === root || c == null || !(Clazz_instanceOf (c, javax.swing.JComponent))) { +break; +}c = c.getParent (); +} +if (c === root) { +roots.remove (i); +}} +}, "javax.swing.JComponent,java.util.List,~N"); +Clazz_defineMethod (c$, "collectDirtyComponents", +function (dirtyComponents, dirtyComponent, roots) { +var dx; +var dy; +var rootDx; +var rootDy; +var component; +var rootDirtyComponent; +var parent; +component = rootDirtyComponent = dirtyComponent; +var x = dirtyComponent.getX (); +var y = dirtyComponent.getY (); +var w = dirtyComponent.getWidth (); +var h = dirtyComponent.getHeight (); +dx = rootDx = 0; +dy = rootDy = 0; +this.tmp.setBounds (dirtyComponents.get (dirtyComponent)); +javax.swing.SwingUtilities.computeIntersection (0, 0, w, h, this.tmp); +if (this.tmp.isEmpty ()) { +return; +}for (; ; ) { +if (!(Clazz_instanceOf (component, javax.swing.JComponent))) break; +parent = component.getParent (); +if (parent == null) break; +component = parent; +dx += x; +dy += y; +this.tmp.setLocation (this.tmp.x + x, this.tmp.y + y); +x = component.getX (); +y = component.getY (); +w = component.getWidth (); +h = component.getHeight (); +this.tmp = javax.swing.SwingUtilities.computeIntersection (0, 0, w, h, this.tmp); +if (this.tmp.isEmpty ()) { +return; +}if (dirtyComponents.get (component) != null) { +rootDirtyComponent = component; +rootDx = dx; +rootDy = dy; +}} +if (dirtyComponent !== rootDirtyComponent) { +var r; +this.tmp.setLocation (this.tmp.x + rootDx - dx, this.tmp.y + rootDy - dy); +r = dirtyComponents.get (rootDirtyComponent); +javax.swing.SwingUtilities.computeUnion (this.tmp.x, this.tmp.y, this.tmp.width, this.tmp.height, r); +}if (!roots.contains (rootDirtyComponent)) roots.add (rootDirtyComponent); +}, "java.util.Map,java.awt.Component,java.util.List"); +Clazz_overrideMethod (c$, "toString", +function () { +var sb = new StringBuffer (); +if (this.dirtyComponents != null) sb.append ("" + this.dirtyComponents); +return sb.toString (); +}); +Clazz_defineMethod (c$, "getOffscreenBuffer", +function (c, proposedWidth, proposedHeight) { +return null; +}, "java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getVolatileOffscreenBuffer", +function (c, proposedWidth, proposedHeight) { +var config = c.getGraphicsConfiguration (); +var maxSize = this.getDoubleBufferMaximumSize (); +var width = proposedWidth < 1 ? 1 : (proposedWidth > maxSize.width ? maxSize.width : proposedWidth); +var height = proposedHeight < 1 ? 1 : (proposedHeight > maxSize.height ? maxSize.height : proposedHeight); +var image = this.volatileMap.get (config); +if (image == null || image.getWidth () < width || image.getHeight () < height) { +if (image != null) { +image.flush (); +}image = config.createCompatibleVolatileImage (width, height); +this.volatileMap.put (config, image); +}return image; +}, "java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "setDoubleBufferMaximumSize", +function (d) { +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "getDoubleBufferMaximumSize", +function () { +return null; +}); +Clazz_defineMethod (c$, "setDoubleBufferingEnabled", +function (aFlag) { +}, "~B"); +Clazz_defineMethod (c$, "resetDoubleBuffer", +function () { +}); +Clazz_defineMethod (c$, "resetVolatileDoubleBuffer", +function (gc) { +var image = this.volatileMap.remove (gc); +if (image != null) { +image.flush (); +}}, "java.awt.GraphicsConfiguration"); +Clazz_defineMethod (c$, "useVolatileDoubleBuffer", +function () { +return javax.swing.RepaintManager.volatileImageBufferEnabled; +}); +Clazz_defineMethod (c$, "isPaintingThread", + function () { +return (Thread.currentThread () === this.paintThread); +}); +Clazz_defineMethod (c$, "paint", +function (paintingComponent, bufferComponent, g, x, y, w, h) { +paintingComponent.paintToOffscreen (g, x, y, w, h, x + w, y + h); +}, "javax.swing.JComponent,javax.swing.JComponent,java.awt.Graphics,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "beginPaint", +function () { +var multiThreadedPaint = false; +var paintDepth = 0; +var currentThread = Thread.currentThread (); +{ +paintDepth = this.paintDepth; +if (this.paintThread == null || currentThread === this.paintThread) { +this.paintThread = currentThread; +this.paintDepth++; +} else { +multiThreadedPaint = true; +}}}); +Clazz_defineMethod (c$, "endPaint", +function () { +if (this.isPaintingThread ()) { +}}); +Clazz_defineMethod (c$, "doubleBufferingChanged", +function (rootPane) { +}, "javax.swing.JRootPane"); +Clazz_defineMethod (c$, "scheduleProcessingRunnable", + function (c) { +this.scheduleProcessingRunnable (c.getAppContext ()); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "scheduleProcessingRunnable", + function (context) { +if (this.processingRunnable.markPending ()) { +jssun.awt.SunToolkit.getSystemEventQueueImplPP (context).postEvent ( new java.awt.event.InvocationEvent (java.awt.Toolkit.getDefaultToolkit (), this.processingRunnable)); +}}, "jssun.awt.AppContext"); +c$.$RepaintManager$ProcessingRunnable$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +this.pending = false; +Clazz_instantialize (this, arguments); +}, javax.swing.RepaintManager, "ProcessingRunnable", null, Runnable); +Clazz_defineMethod (c$, "markPending", +function () { +if (!this.pending) { +this.pending = true; +return true; +}return false; +}); +Clazz_overrideMethod (c$, "run", +function () { +{ +this.pending = false; +}this.b$["javax.swing.RepaintManager"].scheduleHeavyWeightPaints (); +this.b$["javax.swing.RepaintManager"].validateInvalidComponents (); +this.b$["javax.swing.RepaintManager"].prePaintDirtyRegions (); +swingjs.JSToolkit.forceRepaint (this.b$["javax.swing.RepaintManager"].myComponent); +}); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"HANDLE_TOP_LEVEL_PAINT", false); +c$.repaintManagerKey = c$.prototype.repaintManagerKey = javax.swing.RepaintManager; +Clazz_defineStatics (c$, +"volatileImageBufferEnabled", true); +{ +javax.swing.RepaintManager.volatileImageBufferEnabled = false; +var headless = false; +if (javax.swing.RepaintManager.volatileImageBufferEnabled && headless) { +javax.swing.RepaintManager.volatileImageBufferEnabled = false; +}javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT = true; +}}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (["java.awt.Toolkit", "jssun.awt.ComponentFactory", "$.WindowClosingListener", "$.WindowClosingSupport", "java.util.HashMap"], "jssun.awt.SunToolkit", ["java.lang.NullPointerException", "$.Thread", "java.awt.Component", "$.Dimension", "$.EventQueue", "$.Panel", "$.Window", "jssun.awt.AWTAccessor", "$.AWTAutoShutdown", "$.AppContext", "$.PeerEvent", "$.PostEventQueue", "jssun.font.FontDesignMetrics"], function () { +c$ = Clazz_decorateAsClass (function () { +this.windowClosingListener = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "SunToolkit", java.awt.Toolkit, [jssun.awt.WindowClosingSupport, jssun.awt.WindowClosingListener, jssun.awt.ComponentFactory]); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, jssun.awt.SunToolkit, []); +var eventQueue; +eventQueue = new java.awt.EventQueue (); +var appContext = jssun.awt.AppContext.getAppContext (); +if (appContext != null) { +appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, eventQueue); +var postEventQueue = new jssun.awt.PostEventQueue (eventQueue); +appContext.put ("PostEventQueue", postEventQueue); +}}); +Clazz_defineMethod (c$, "useBufferPerWindow", +function () { +return false; +}); +c$.createNewAppContext = Clazz_defineMethod (c$, "createNewAppContext", +function () { +var threadGroup = Thread.currentThread ().getThreadGroup (); +return jssun.awt.SunToolkit.createNewAppContext (threadGroup); +}); +c$.createNewAppContext = Clazz_defineMethod (c$, "createNewAppContext", +function (threadGroup) { +var eventQueue; +var eqName = System.getProperty ("AWT.EventQueueClass", "java.awt.EventQueue"); +try { +eventQueue = Clazz._4Name (eqName).newInstance (); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +System.err.println ("Failed loading " + eqName + ": " + e); +eventQueue = new java.awt.EventQueue (); +} else { +throw e; +} +} +var appContext = new jssun.awt.AppContext (threadGroup); +appContext.put (jssun.awt.AppContext.EVENT_QUEUE_KEY, eventQueue); +var postEventQueue = new jssun.awt.PostEventQueue (eventQueue); +appContext.put ("PostEventQueue", postEventQueue); +return appContext; +}, "ThreadGroup"); +c$.wakeupEventQueue = Clazz_defineMethod (c$, "wakeupEventQueue", +function (q, isShutdown) { +q.wakeup (isShutdown); +}, "java.awt.EventQueue,~B"); +c$.targetToPeer = Clazz_defineMethod (c$, "targetToPeer", +function (target) { +if (target != null) { +return jssun.awt.AWTAutoShutdown.getInstance ().getPeer (target); +}return null; +}, "~O"); +c$.targetCreatedPeer = Clazz_defineMethod (c$, "targetCreatedPeer", +function (target, peer) { +if (target != null && peer != null) { +jssun.awt.AWTAutoShutdown.getInstance ().registerPeer (target, peer); +}}, "~O,~O"); +c$.targetDisposedPeer = Clazz_defineMethod (c$, "targetDisposedPeer", +function (target, peer) { +if (target != null && peer != null) { +jssun.awt.AWTAutoShutdown.getInstance ().unregisterPeer (target, peer); +}}, "~O,~O"); +c$.setAppContext = Clazz_defineMethod (c$, "setAppContext", + function (target, context) { +if (Clazz_instanceOf (target, java.awt.Component)) { +jssun.awt.AWTAccessor.getComponentAccessor ().setAppContext (target, context); +} else { +return false; +}return true; +}, "~O,jssun.awt.AppContext"); +c$.getAppContext = Clazz_defineMethod (c$, "getAppContext", + function (target) { +if (Clazz_instanceOf (target, java.awt.Component)) { +{ +return target.appContext; +}} else { +return null; +}}, "~O"); +c$.targetToAppContext = Clazz_defineMethod (c$, "targetToAppContext", +function (target) { +if (target == null) { +return null; +}var context = jssun.awt.SunToolkit.getAppContext (target); +if (context == null) { +context = jssun.awt.SunToolkit.appContextMap.get (target); +}return context; +}, "~O"); +c$.setLWRequestStatus = Clazz_defineMethod (c$, "setLWRequestStatus", +function (changed, status) { +jssun.awt.AWTAccessor.getWindowAccessor ().setLWRequestStatus (changed, status); +}, "java.awt.Window,~B"); +c$.checkAndSetPolicy = Clazz_defineMethod (c$, "checkAndSetPolicy", +function (cont, isSwingCont) { +}, "java.awt.Container,~B"); +c$.insertTargetMapping = Clazz_defineMethod (c$, "insertTargetMapping", +function (target, appContext) { +if (!jssun.awt.SunToolkit.setAppContext (target, appContext)) { +jssun.awt.SunToolkit.appContextMap.put (target, appContext); +}}, "~O,jssun.awt.AppContext"); +c$.postEvent = Clazz_defineMethod (c$, "postEvent", +function (appContext, event) { +if (event == null) { +throw new NullPointerException (); +}var postEventQueue = appContext.get ("PostEventQueue"); +if (postEventQueue != null) { +postEventQueue.postEvent (event); +}}, "jssun.awt.AppContext,java.awt.AWTEvent"); +c$.postPriorityEvent = Clazz_defineMethod (c$, "postPriorityEvent", +function (e) { +var pe = new jssun.awt.PeerEvent (java.awt.Toolkit.getDefaultToolkit (), ((Clazz_isClassDefined ("jssun.awt.SunToolkit$1") ? 0 : jssun.awt.SunToolkit.$SunToolkit$1$ ()), Clazz_innerTypeInstance (jssun.awt.SunToolkit$1, this, Clazz_cloneFinals ("e", e))), 2); +jssun.awt.SunToolkit.postEvent (jssun.awt.SunToolkit.targetToAppContext (e.getSource ()), pe); +}, "java.awt.AWTEvent"); +c$.flushPendingEvents = Clazz_defineMethod (c$, "flushPendingEvents", +function () { +var appContext = jssun.awt.AppContext.getAppContext (); +var postEventQueue = appContext.get ("PostEventQueue"); +if (postEventQueue != null) { +postEventQueue.flush (); +}}); +c$.isPostEventQueueEmpty = Clazz_defineMethod (c$, "isPostEventQueueEmpty", +function () { +var appContext = jssun.awt.AppContext.getAppContext (); +var postEventQueue = appContext.get ("PostEventQueue"); +return (postEventQueue == null || postEventQueue.noEvents ()); +}); +c$.executeOnEventHandlerThread = Clazz_defineMethod (c$, "executeOnEventHandlerThread", +function (target, runnable) { +jssun.awt.SunToolkit.executeOnEventHandlerThread ( new jssun.awt.PeerEvent (target, runnable, 1)); +}, "~O,Runnable"); +c$.executeOnEventHandlerThread = Clazz_defineMethod (c$, "executeOnEventHandlerThread", +function (target, runnable, when) { +jssun.awt.SunToolkit.executeOnEventHandlerThread (((Clazz_isClassDefined ("jssun.awt.SunToolkit$2") ? 0 : jssun.awt.SunToolkit.$SunToolkit$2$ ()), Clazz_innerTypeInstance (jssun.awt.SunToolkit$2, this, Clazz_cloneFinals ("when", when), target, runnable, 1))); +}, "~O,Runnable,~N"); +c$.executeOnEventHandlerThread = Clazz_defineMethod (c$, "executeOnEventHandlerThread", +function (peerEvent) { +jssun.awt.SunToolkit.postEvent (jssun.awt.SunToolkit.targetToAppContext (peerEvent.getSource ()), peerEvent); +}, "jssun.awt.PeerEvent"); +c$.invokeLaterOnAppContext = Clazz_defineMethod (c$, "invokeLaterOnAppContext", +function (appContext, dispatcher) { +jssun.awt.SunToolkit.postEvent (appContext, new jssun.awt.PeerEvent (java.awt.Toolkit.getDefaultToolkit (), dispatcher, 1)); +}, "jssun.awt.AppContext,Runnable"); +c$.isDispatchThreadForAppContext = Clazz_defineMethod (c$, "isDispatchThreadForAppContext", +function (target) { +var appContext = jssun.awt.SunToolkit.targetToAppContext (target); +var eq = appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY); +var next = jssun.awt.AWTAccessor.getEventQueueAccessor ().getNextQueue (eq); +while (next != null) { +eq = next; +next = jssun.awt.AWTAccessor.getEventQueueAccessor ().getNextQueue (eq); +} +return (Thread.currentThread () === jssun.awt.AWTAccessor.getEventQueueAccessor ().getDispatchThread (eq)); +}, "~O"); +Clazz_overrideMethod (c$, "getScreenSize", +function () { +return new java.awt.Dimension (this.getScreenWidth (), this.getScreenHeight ()); +}); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +return jssun.font.FontDesignMetrics.getMetrics (font); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "getFontList", +function () { +var hardwiredFontList = Clazz_newArray (-1, ["Dialog", "SansSerif", "Serif", "Monospaced", "DialogInput"]); +return hardwiredFontList; +}); +Clazz_overrideMethod (c$, "createPanel", +function (target) { +return this.createComponent (target); +}, "java.awt.Panel"); +Clazz_defineMethod (c$, "disableBackgroundErase", +function (component) { +this.disableBackgroundEraseImpl (component); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "disableBackgroundEraseImpl", + function (component) { +jssun.awt.AWTAccessor.getComponentAccessor ().setBackgroundEraseDisabled (component, true); +}, "java.awt.Component"); +c$.getSunAwtNoerasebackground = Clazz_defineMethod (c$, "getSunAwtNoerasebackground", +function () { +return false; +}); +c$.getSunAwtErasebackgroundonresize = Clazz_defineMethod (c$, "getSunAwtErasebackgroundonresize", +function () { +return true; +}); +Clazz_defineMethod (c$, "setOverrideRedirect", +function (target) { +}, "java.awt.Window"); +c$.getImageFromHash = Clazz_defineMethod (c$, "getImageFromHash", +function (tk, url) { +var img = jssun.awt.SunToolkit.imgCache.get (url); +if (img == null) { +try { +img = tk.createImage (url); +jssun.awt.SunToolkit.imgCache.put (url, img); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +} else { +throw e; +} +} +}return img; +}, "java.awt.Toolkit,java.net.URL"); +c$.getImageFromHash = Clazz_defineMethod (c$, "getImageFromHash", +function (tk, filename) { +var img = jssun.awt.SunToolkit.imgCache.get (filename); +if (img == null) { +try { +tk.createImage (filename); +jssun.awt.SunToolkit.imgCache.put (filename, img); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +} else { +throw e; +} +} +}return img; +}, "java.awt.Toolkit,~S"); +Clazz_defineMethod (c$, "getImage", +function (filename) { +return jssun.awt.SunToolkit.getImageFromHash (this, filename); +}, "~S"); +Clazz_defineMethod (c$, "getImage", +function (url) { +return jssun.awt.SunToolkit.getImageFromHash (this, url); +}, "java.net.URL"); +Clazz_overrideMethod (c$, "checkImage", +function (img, w, h, o) { +return 0; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "prepareImage", +function (img, w, h, o) { +if (w == 0 || h == 0) { +return true; +}return true; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "getSystemEventQueueImpl", +function () { +return jssun.awt.SunToolkit.getSystemEventQueueImplPP (); +}); +c$.getSystemEventQueueImplPP = Clazz_defineMethod (c$, "getSystemEventQueueImplPP", +function () { +return jssun.awt.SunToolkit.getSystemEventQueueImplPP (jssun.awt.AppContext.getAppContext ()); +}); +c$.getSystemEventQueueImplPP = Clazz_defineMethod (c$, "getSystemEventQueueImplPP", +function (appContext) { +var theEventQueue = appContext.get (jssun.awt.AppContext.EVENT_QUEUE_KEY); +return theEventQueue; +}, "jssun.awt.AppContext"); +c$.getNativeContainer = Clazz_defineMethod (c$, "getNativeContainer", +function (c) { +return java.awt.Toolkit.getNativeContainer (c); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "enableInputMethodsForTextComponent", +function () { +return false; +}); +c$.getStartupLocale = Clazz_defineMethod (c$, "getStartupLocale", +function () { +if (jssun.awt.SunToolkit.startupLocale == null) { +{ +}}return jssun.awt.SunToolkit.startupLocale; +}); +Clazz_defineMethod (c$, "getDefaultKeyboardLocale", +function () { +return jssun.awt.SunToolkit.getStartupLocale (); +}); +c$.setDataTransfererClassName = Clazz_defineMethod (c$, "setDataTransfererClassName", +function (className) { +jssun.awt.SunToolkit.dataTransfererClassName = className; +}, "~S"); +c$.getDataTransfererClassName = Clazz_defineMethod (c$, "getDataTransfererClassName", +function () { +if (jssun.awt.SunToolkit.dataTransfererClassName == null) { +java.awt.Toolkit.getDefaultToolkit (); +}return jssun.awt.SunToolkit.dataTransfererClassName; +}); +Clazz_overrideMethod (c$, "getWindowClosingListener", +function () { +return this.windowClosingListener; +}); +Clazz_overrideMethod (c$, "setWindowClosingListener", +function (wcl) { +this.windowClosingListener = wcl; +}, "jssun.awt.WindowClosingListener"); +Clazz_defineMethod (c$, "windowClosingNotify", +function (event) { +if (this.windowClosingListener != null) { +return this.windowClosingListener.windowClosingNotify (event); +} else { +return null; +}}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "windowClosingDelivered", +function (event) { +if (this.windowClosingListener != null) { +return this.windowClosingListener.windowClosingDelivered (event); +} else { +return null; +}}, "java.awt.event.WindowEvent"); +c$.isModalExcluded = Clazz_defineMethod (c$, "isModalExcluded", +function (window) { +return true; +}, "java.awt.Window"); +c$.isLightweightOrUnknown = Clazz_defineMethod (c$, "isLightweightOrUnknown", +function (comp) { +if (comp.isLightweight () || !(Clazz_instanceOf (java.awt.Toolkit.getDefaultToolkit (), jssun.awt.SunToolkit))) { +return true; +}return !(Clazz_instanceOf (comp, java.awt.Panel) || Clazz_instanceOf (comp, java.awt.Window)); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getDesktopAAHints", +function () { +return null; +}); +c$.getContainingWindow = Clazz_defineMethod (c$, "getContainingWindow", +function (comp) { +while (comp != null && !(Clazz_instanceOf (comp, java.awt.Window))) { +comp = comp.getParent (); +} +return comp; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "isNativeGTKAvailable", +function () { +return false; +}); +Clazz_defineMethod (c$, "isWindowOpacitySupported", +function () { +return false; +}); +Clazz_defineMethod (c$, "isWindowShapingSupported", +function () { +return false; +}); +Clazz_defineMethod (c$, "isWindowTranslucencySupported", +function () { +return false; +}); +Clazz_defineMethod (c$, "isTranslucencyCapable", +function (gc) { +return false; +}, "java.awt.GraphicsConfiguration"); +Clazz_defineMethod (c$, "needUpdateWindow", +function () { +return false; +}); +c$.$SunToolkit$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (jssun.awt, "SunToolkit$1", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +jssun.awt.AWTAccessor.getAWTEventAccessor ().setPosted (this.f$.e); +(this.f$.e.getSource ()).dispatchEvent (this.f$.e); +}); +c$ = Clazz_p0p (); +}; +c$.$SunToolkit$2$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (jssun.awt, "SunToolkit$2", jssun.awt.PeerEvent); +Clazz_overrideMethod (c$, "getWhen", +function () { +return this.f$.when; +}); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"GRAB_EVENT_MASK", 0x80000000, +"POST_EVENT_QUEUE_KEY", "PostEventQueue"); +c$.appContextMap = c$.prototype.appContextMap = new java.util.HashMap (); +c$.imgCache = c$.prototype.imgCache = new java.util.HashMap (); +Clazz_defineStatics (c$, +"startupLocale", null, +"dataTransfererClassName", null, +"DESKTOPFONTHINTS", "awt.font.desktophints"); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "Conditional"); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.PaintEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.updateRect = null; +Clazz_instantialize (this, arguments); +}, java.awt.event, "PaintEvent", java.awt.event.ComponentEvent); +Clazz_makeConstructor (c$, +function (source, id, updateRect) { +Clazz_superConstructor (this, java.awt.event.PaintEvent, [source, id]); +this.updateRect = updateRect; +}, "java.awt.Component,~N,java.awt.Rectangle"); +Clazz_defineMethod (c$, "getUpdateRect", +function () { +return this.updateRect; +}); +Clazz_defineMethod (c$, "setUpdateRect", +function (updateRect) { +this.updateRect = updateRect; +}, "java.awt.Rectangle"); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 800: +typeStr = "PAINT"; +break; +case 801: +typeStr = "UPDATE"; +break; +default: +typeStr = "unknown type"; +} +return typeStr + ",updateRect=" + (this.updateRect != null ? this.updateRect.toString () : "null"); +}); +Clazz_defineStatics (c$, +"PAINT_FIRST", 800, +"PAINT_LAST", 801, +"PAINT", 800, +"UPDATE", 801); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent", "$.EventFilter", "swingjs.JSThread", "java.util.Vector"], "java.awt.EventDispatchThread", ["java.lang.Error", "$.RuntimeException", "$.Thread", "java.awt.Component", "$.Container", "$.ModalEventFilter", "$.Window", "jssun.awt.AWTAutoShutdown", "$.ModalExclude", "$.SunToolkit", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.theQueue = null; +this.eventFilters = null; +this.modalFiltersCount = 0; +this.filter = null; +this.cond = null; +this.id = 0; +this.doDispatch = true; +if (!Clazz_isClassDefined ("java.awt.EventDispatchThread.StopDispatchEvent")) { +java.awt.EventDispatchThread.$EventDispatchThread$StopDispatchEvent$ (); +} +Clazz_instantialize (this, arguments); +}, java.awt, "EventDispatchThread", swingjs.JSThread); +Clazz_prepareFields (c$, function () { +this.eventFilters = new java.util.Vector (); +}); +Clazz_makeConstructor (c$, +function (group, name, queue) { +Clazz_superConstructor (this, java.awt.EventDispatchThread, [group, name]); +this.theQueue = queue; +}, "ThreadGroup,~S,java.awt.EventQueue"); +Clazz_defineMethod (c$, "stopDispatchingImpl", +function (wait) { +var stopEvent = Clazz_innerTypeInstance (java.awt.EventDispatchThread.StopDispatchEvent, this, null); +if (Thread.currentThread () !== this) { +this.theQueue.postEventPrivate (stopEvent); +if (wait) { +try { +this.join (); +} catch (e) { +if (Clazz_exceptionOf (e, InterruptedException)) { +} else { +throw e; +} +} +}} else { +stopEvent.dispatch (); +}{ +if (this.theQueue.getDispatchThread () === this) { +this.theQueue.detachDispatchThread (); +}}}, "~B"); +Clazz_defineMethod (c$, "stopDispatching", +function () { +this.stopDispatchingImpl (true); +}); +Clazz_defineMethod (c$, "stopDispatchingLater", +function () { +this.stopDispatchingImpl (false); +}); +Clazz_overrideMethod (c$, "run", +function () { +this.pumpEvents (-1, null); +}); +Clazz_defineMethod (c$, "pumpEvents", +function (id, cond) { +this.pumpEventsForHierarchy (id, cond, null); +}, "~N,java.awt.Conditional"); +Clazz_defineMethod (c$, "pumpEventsForHierarchy", +function (id, cond, modalComponent) { +this.pumpEventsForFilter (id, cond, new java.awt.EventDispatchThread.HierarchyEventFilter (modalComponent)); +}, "~N,java.awt.Conditional,java.awt.Component"); +Clazz_defineMethod (c$, "pumpEventsForFilter", +function (id, cond, filter) { +this.filter = filter; +this.cond = cond; +this.id = id; +this.run1 (0); +}, "~N,java.awt.Conditional,java.awt.EventFilter"); +Clazz_overrideMethod (c$, "run1", +function (mode) { +try { +while (true) switch (mode) { +case 0: +this.addEventFilter (this.filter); +mode = 1; +case 1: +if (!this.doDispatch || this.cond != null && !this.cond.evaluate () || this.isInterrupted ()) { +this.doDispatch = false; +return; +}var myid = this.id; +var r = ((Clazz_isClassDefined ("java.awt.EventDispatchThread$1") ? 0 : java.awt.EventDispatchThread.$EventDispatchThread$1$ ()), Clazz_innerTypeInstance (java.awt.EventDispatchThread$1, this, Clazz_cloneFinals ("myid", myid))); +this.dispatchAndReturn (r, mode); +if (this.isJS) return; +break; +case 2: +this.doDispatch = false; +return; +} + +} finally { +if (!this.doDispatch) this.finish (); +} +}, "~N"); +Clazz_defineMethod (c$, "dispatchAndReturn", +function (r, mode) { +var f = null; +var me = this; +{ +f = function() {r.run();me.run1(mode) +}; +}swingjs.JSToolkit.setTimeout (f, 0, 0); +}, "Runnable,~N"); +Clazz_defineMethod (c$, "finish", + function () { +this.doDispatch = false; +this.removeEventFilter (this.filter); +{ +if (this.theQueue.getDispatchThread () === this) { +this.theQueue.detachDispatchThread (); +}if (this.theQueue.peekEvent () != null || !jssun.awt.SunToolkit.isPostEventQueueEmpty ()) { +this.theQueue.initDispatchThread (); +}jssun.awt.AWTAutoShutdown.getInstance ().notifyThreadFree (this); +}}); +Clazz_defineMethod (c$, "addEventFilter", +function (filter) { +{ +if (!this.eventFilters.contains (filter)) { +if (Clazz_instanceOf (filter, java.awt.ModalEventFilter)) { +var newFilter = filter; +var k = 0; +for (k = 0; k < this.eventFilters.size (); k++) { +var f = this.eventFilters.get (k); +if (Clazz_instanceOf (f, java.awt.ModalEventFilter)) { +var cf = f; +if (cf.compareTo (newFilter) > 0) { +break; +}}} +this.eventFilters.add (k, filter); +this.modalFiltersCount++; +} else { +this.eventFilters.add (filter); +}}}}, "java.awt.EventFilter"); +Clazz_defineMethod (c$, "removeEventFilter", +function (filter) { +{ +if (this.eventFilters.contains (filter)) { +if (Clazz_instanceOf (filter, java.awt.ModalEventFilter)) { +this.modalFiltersCount--; +}this.eventFilters.remove (filter); +}}}, "java.awt.EventFilter"); +Clazz_defineMethod (c$, "pumpOneEventForFilters", +function (id) { +try { +var event; +var eventOK; +do { +event = (id == -1) ? this.theQueue.getNextEvent () : this.theQueue.getNextEventForID (id); +if (event == null) return (this.doDispatch = false); +eventOK = true; +{ +for (var i = this.eventFilters.size () - 1; i >= 0; i--) { +var f = this.eventFilters.get (i); +var accept = f.acceptEvent (event); +if (accept === java.awt.EventFilter.FilterAction.REJECT) { +eventOK = false; +break; +} else if (accept === java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY) { +break; +}} +}if (!eventOK) { +event.consume (); +}} while (eventOK == false); +this.theQueue.dispatchEvent (event); +return this.doDispatch = true; +} catch (e$$) { +if (Clazz_exceptionOf (e$$, ThreadDeath)) { +var death = e$$; +{ +return this.doDispatch = false; +} +} else if (Clazz_exceptionOf (e$$, InterruptedException)) { +var interruptedException = e$$; +{ +return this.doDispatch = false; +} +} else { +var e = e$$; +{ +this.processException (e, this.modalFiltersCount > 0); +} +} +} +return this.doDispatch = true; +}, "~N"); +Clazz_defineMethod (c$, "processException", + function (e, isModal) { +if (!this.handleException (e)) { +if (isModal) { +System.err.println ("Exception occurred during event dispatching:"); +e.printStackTrace (); +} else if (Clazz_instanceOf (e, RuntimeException)) { +throw e; +} else if (Clazz_instanceOf (e, Error)) { +throw e; +}}}, "Throwable,~B"); +Clazz_defineMethod (c$, "handleException", + function (thrown) { +return false; +}, "Throwable"); +Clazz_defineMethod (c$, "isDispatching", +function (eq) { +return this.theQueue.equals (eq); +}, "java.awt.EventQueue"); +Clazz_defineMethod (c$, "getEventQueue", +function () { +return this.theQueue; +}); +c$.$EventDispatchThread$StopDispatchEvent$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, java.awt.EventDispatchThread, "StopDispatchEvent", java.awt.AWTEvent, java.awt.ActiveEvent); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, java.awt.EventDispatchThread.StopDispatchEvent, [this.b$["java.awt.EventDispatchThread"], 0]); +}); +Clazz_overrideMethod (c$, "dispatch", +function () { +this.b$["java.awt.EventDispatchThread"].doDispatch = false; +}); +c$ = Clazz_p0p (); +}; +c$.$EventDispatchThread$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (java.awt, "EventDispatchThread$1", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +this.b$["java.awt.EventDispatchThread"].pumpOneEventForFilters (this.f$.myid); +}); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.modalComponent = null; +Clazz_instantialize (this, arguments); +}, java.awt.EventDispatchThread, "HierarchyEventFilter", null, java.awt.EventFilter); +Clazz_makeConstructor (c$, +function (a) { +this.modalComponent = a; +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "acceptEvent", +function (a) { +if (this.modalComponent != null) { +var b = a.getID (); +var c = (b >= 500) && (b <= 507); +var d = (b >= 1001) && (b <= 1001); +var e = (b == 201); +if (java.awt.Component.isInstanceOf (this.modalComponent, "javax.swing.JInternalFrame")) { +return e ? java.awt.EventFilter.FilterAction.REJECT : java.awt.EventFilter.FilterAction.ACCEPT; +}if (c || d || e) { +var f = a.getSource (); +if (Clazz_instanceOf (f, jssun.awt.ModalExclude)) { +return java.awt.EventFilter.FilterAction.ACCEPT; +} else if (Clazz_instanceOf (f, java.awt.Component)) { +var g = f; +var h = false; +if (Clazz_instanceOf (this.modalComponent, java.awt.Container)) { +while (g !== this.modalComponent && g != null) { +if ((Clazz_instanceOf (g, java.awt.Window)) && (jssun.awt.SunToolkit.isModalExcluded (g))) { +h = true; +break; +}g = g.getParent (); +} +}if (!h && (g !== this.modalComponent)) { +return java.awt.EventFilter.FilterAction.REJECT; +}}}}return java.awt.EventFilter.FilterAction.ACCEPT; +}, "java.awt.AWTEvent"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"ANY_EVENT", -1); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.lang.Enum"], "java.awt.EventFilter", null, function () { +Clazz_declareInterface (java.awt, "EventFilter"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.EventFilter, "FilterAction", Enum); +Clazz_defineEnumConstant (c$, "ACCEPT", 0, []); +Clazz_defineEnumConstant (c$, "REJECT", 1, []); +Clazz_defineEnumConstant (c$, "ACCEPT_IMMEDIATELY", 2, []); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.EventFilter"], "java.awt.ModalEventFilter", ["java.awt.Component", "$.Dialog", "$.Window", "jssun.awt.ModalExclude"], function () { +c$ = Clazz_decorateAsClass (function () { +this.modalDialog = null; +this.disabled = false; +Clazz_instantialize (this, arguments); +}, java.awt, "ModalEventFilter", null, java.awt.EventFilter); +Clazz_makeConstructor (c$, +function (modalDialog) { +this.modalDialog = modalDialog; +this.disabled = false; +}, "java.awt.Dialog"); +Clazz_defineMethod (c$, "getModalDialog", +function () { +return this.modalDialog; +}); +Clazz_overrideMethod (c$, "acceptEvent", +function (event) { +if (this.disabled || !this.modalDialog.isVisible ()) { +return java.awt.EventFilter.FilterAction.ACCEPT; +}var eventID = event.getID (); +if ((eventID >= 500 && eventID <= 507) || (eventID >= 1001 && eventID <= 1001) || eventID == 201) { +var o = event.getSource (); +if (Clazz_instanceOf (o, jssun.awt.ModalExclude)) { +} else if (Clazz_instanceOf (o, java.awt.Component)) { +var c = o; +while ((c != null) && !(Clazz_instanceOf (c, java.awt.Window))) { +c = c.getParent_NoClientCode (); +} +if (c != null) { +return this.acceptWindow (c); +}}}return java.awt.EventFilter.FilterAction.ACCEPT; +}, "java.awt.AWTEvent"); +Clazz_defineMethod (c$, "disable", +function () { +this.disabled = true; +}); +Clazz_defineMethod (c$, "compareTo", +function (another) { +var anotherDialog = another.getModalDialog (); +var c = this.modalDialog; +while (c != null) { +if (c === anotherDialog) { +return 1; +}c = c.getParent_NoClientCode (); +} +c = anotherDialog; +while (c != null) { +if (c === this.modalDialog) { +return -1; +}c = c.getParent_NoClientCode (); +} +var blocker = this.modalDialog.getModalBlocker (); +while (blocker != null) { +if (blocker === anotherDialog) { +return -1; +}blocker = blocker.getModalBlocker (); +} +blocker = anotherDialog.getModalBlocker (); +while (blocker != null) { +if (blocker === this.modalDialog) { +return 1; +}blocker = blocker.getModalBlocker (); +} +return this.modalDialog.getModalityType ().compareTo (anotherDialog.getModalityType ()); +}, "java.awt.ModalEventFilter"); +c$.createFilterForDialog = Clazz_defineMethod (c$, "createFilterForDialog", +function (modalDialog) { +switch (modalDialog.getModalityType ()) { +case java.awt.Dialog.ModalityType.DOCUMENT_MODAL: +return new java.awt.ModalEventFilter.DocumentModalEventFilter (modalDialog); +case java.awt.Dialog.ModalityType.APPLICATION_MODAL: +return new java.awt.ModalEventFilter.ApplicationModalEventFilter (modalDialog); +case java.awt.Dialog.ModalityType.TOOLKIT_MODAL: +return new java.awt.ModalEventFilter.ToolkitModalEventFilter (modalDialog); +} +return null; +}, "java.awt.Dialog"); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.appContext = null; +Clazz_instantialize (this, arguments); +}, java.awt.ModalEventFilter, "ToolkitModalEventFilter", java.awt.ModalEventFilter); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.awt.ModalEventFilter.ToolkitModalEventFilter, [a]); +this.appContext = a.appContext; +}, "java.awt.Dialog"); +Clazz_overrideMethod (c$, "acceptWindow", +function (a) { +if (a.isModalExcluded (java.awt.Dialog.ModalExclusionType.TOOLKIT_EXCLUDE)) { +return java.awt.EventFilter.FilterAction.ACCEPT; +}if (a.appContext !== this.appContext) { +return java.awt.EventFilter.FilterAction.REJECT; +}while (a != null) { +if (a === this.modalDialog) { +return java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY; +}a = a.getOwner (); +} +return java.awt.EventFilter.FilterAction.REJECT; +}, "java.awt.Window"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.appContext = null; +Clazz_instantialize (this, arguments); +}, java.awt.ModalEventFilter, "ApplicationModalEventFilter", java.awt.ModalEventFilter); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.awt.ModalEventFilter.ApplicationModalEventFilter, [a]); +this.appContext = a.appContext; +}, "java.awt.Dialog"); +Clazz_overrideMethod (c$, "acceptWindow", +function (a) { +if (a.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { +return java.awt.EventFilter.FilterAction.ACCEPT; +}if (a.appContext === this.appContext) { +while (a != null) { +if (a === this.modalDialog) { +return java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY; +}a = a.getOwner (); +} +return java.awt.EventFilter.FilterAction.REJECT; +}return java.awt.EventFilter.FilterAction.ACCEPT; +}, "java.awt.Window"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.documentRoot = null; +Clazz_instantialize (this, arguments); +}, java.awt.ModalEventFilter, "DocumentModalEventFilter", java.awt.ModalEventFilter); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, java.awt.ModalEventFilter.DocumentModalEventFilter, [a]); +this.documentRoot = a.getDocumentRoot (); +}, "java.awt.Dialog"); +Clazz_overrideMethod (c$, "acceptWindow", +function (a) { +if (a.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { +var b = this.modalDialog.getOwner (); +while (b != null) { +if (b === a) { +return java.awt.EventFilter.FilterAction.REJECT; +}b = b.getOwner (); +} +return java.awt.EventFilter.FilterAction.ACCEPT; +}while (a != null) { +if (a === this.modalDialog) { +return java.awt.EventFilter.FilterAction.ACCEPT_IMMEDIATELY; +}if (a === this.documentRoot) { +return java.awt.EventFilter.FilterAction.REJECT; +}a = a.getOwner (); +} +return java.awt.EventFilter.FilterAction.ACCEPT; +}, "java.awt.Window"); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("java.awt.peer"); +Clazz_load (["java.awt.peer.ComponentPeer"], "java.awt.peer.CanvasPeer", null, function () { +Clazz_declareInterface (java.awt.peer, "CanvasPeer", java.awt.peer.ComponentPeer); +}); +Clazz_declarePackage ("java.awt.peer"); +c$ = Clazz_declareInterface (java.awt.peer, "ComponentPeer"); +Clazz_defineStatics (c$, +"SET_LOCATION", 1, +"SET_SIZE", 2, +"SET_BOUNDS", 3, +"SET_CLIENT_SIZE", 4, +"RESET_OPERATION", 5, +"NO_EMBEDDED_CHECK", (16384), +"DEFAULT_OPERATION", 3); +Clazz_declarePackage ("java.awt.peer"); +Clazz_load (["java.awt.peer.ComponentPeer"], "java.awt.peer.ContainerPeer", null, function () { +Clazz_declareInterface (java.awt.peer, "ContainerPeer", java.awt.peer.ComponentPeer); +}); +Clazz_declarePackage ("java.awt.peer"); +Clazz_load (["java.awt.peer.WindowPeer"], "java.awt.peer.FramePeer", null, function () { +Clazz_declareInterface (java.awt.peer, "FramePeer", java.awt.peer.WindowPeer); +}); +Clazz_declarePackage ("java.awt.peer"); +Clazz_load (["java.awt.peer.ComponentPeer"], "java.awt.peer.LightweightPeer", null, function () { +Clazz_declareInterface (java.awt.peer, "LightweightPeer", java.awt.peer.ComponentPeer); +}); +Clazz_declarePackage ("java.awt.peer"); +Clazz_load (["java.awt.peer.ContainerPeer"], "java.awt.peer.PanelPeer", null, function () { +Clazz_declareInterface (java.awt.peer, "PanelPeer", java.awt.peer.ContainerPeer); +}); +Clazz_declarePackage ("java.awt.peer"); +Clazz_load (["java.awt.peer.ContainerPeer"], "java.awt.peer.WindowPeer", null, function () { +Clazz_declareInterface (java.awt.peer, "WindowPeer", java.awt.peer.ContainerPeer); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent"], "java.awt.SentEvent", ["java.awt.Toolkit", "jssun.awt.SunToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.$dispatched = false; +this.nested = null; +this.toNotify = null; +Clazz_instantialize (this, arguments); +}, java.awt, "SentEvent", java.awt.AWTEvent, java.awt.ActiveEvent); +Clazz_makeConstructor (c$, +function () { +this.construct (null); +}); +Clazz_makeConstructor (c$, +function (nested) { +this.construct (nested, null); +}, "java.awt.AWTEvent"); +Clazz_makeConstructor (c$, +function (nested, toNotify) { +Clazz_superConstructor (this, java.awt.SentEvent, [(nested != null) ? nested.getSource () : java.awt.Toolkit.getDefaultToolkit (), 1007]); +this.nested = nested; +this.toNotify = toNotify; +}, "java.awt.AWTEvent,jssun.awt.AppContext"); +Clazz_overrideMethod (c$, "dispatch", +function () { +try { +if (this.nested != null) { +java.awt.Toolkit.getEventQueue ().dispatchEvent (this.nested); +}} finally { +this.$dispatched = true; +if (this.toNotify != null) { +jssun.awt.SunToolkit.postEvent (this.toNotify, new java.awt.SentEvent ()); +}{ +this.notifyAll (); +}} +}); +Clazz_defineMethod (c$, "dispose", +function () { +this.$dispatched = true; +if (this.toNotify != null) { +jssun.awt.SunToolkit.postEvent (this.toNotify, new java.awt.SentEvent ()); +}{ +this.notifyAll (); +}}); +Clazz_defineStatics (c$, +"ID", 1007); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.awt.AWTEvent", "$.ActiveEvent", "java.util.LinkedList"], "java.awt.SequencedEvent", ["java.lang.Thread", "java.awt.Component", "$.Conditional", "$.EventQueue", "$.SentEvent", "$.Toolkit", "jssun.awt.AppContext", "$.SunToolkit", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.nested = null; +this.appContext = null; +this.disposed = false; +Clazz_instantialize (this, arguments); +}, java.awt, "SequencedEvent", java.awt.AWTEvent, java.awt.ActiveEvent); +Clazz_makeConstructor (c$, +function (nested) { +Clazz_superConstructor (this, java.awt.SequencedEvent, [nested.getSource (), 1006]); +this.nested = nested; +{ +java.awt.SequencedEvent.list.add (this); +}}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "dispatch", +function () { +try { +this.appContext = jssun.awt.AppContext.getAppContext (); +if (java.awt.SequencedEvent.getFirst () !== this) { +if (java.awt.EventQueue.isDispatchThread ()) { +var edt = Thread.currentThread (); +edt.pumpEvents (1007, ((Clazz_isClassDefined ("java.awt.SequencedEvent$1") ? 0 : java.awt.SequencedEvent.$SequencedEvent$1$ ()), Clazz_innerTypeInstance (java.awt.SequencedEvent$1, this, null))); +} else { +while (!this.isFirstOrDisposed ()) { +{ +try { +swingjs.JSToolkit.warn ("Cannot wait in SequenceEvent"); +java.awt.SequencedEvent.wait (1000); +} catch (e) { +if (Clazz_exceptionOf (e, InterruptedException)) { +break; +} else { +throw e; +} +} +}} +}}if (!this.disposed) { +java.awt.Toolkit.getEventQueue ().dispatchEvent (this.nested); +}} finally { +this.dispose (); +} +}); +c$.isOwnerAppContextDisposed = Clazz_defineMethod (c$, "isOwnerAppContextDisposed", + function (se) { +if (se != null) { +var target = se.nested.getSource (); +if (Clazz_instanceOf (target, java.awt.Component)) { +return (target).appContext.isDisposed (); +}}return false; +}, "java.awt.SequencedEvent"); +Clazz_defineMethod (c$, "isFirstOrDisposed", +function () { +if (this.disposed) { +return true; +}return this === java.awt.SequencedEvent.getFirstWithContext () || this.disposed; +}); +c$.getFirst = Clazz_defineMethod (c$, "getFirst", + function () { +return java.awt.SequencedEvent.list.getFirst (); +}); +c$.getFirstWithContext = Clazz_defineMethod (c$, "getFirstWithContext", + function () { +var first = java.awt.SequencedEvent.getFirst (); +while (java.awt.SequencedEvent.isOwnerAppContextDisposed (first)) { +first.dispose (); +first = java.awt.SequencedEvent.getFirst (); +} +return first; +}); +Clazz_defineMethod (c$, "dispose", +function () { +{ +if (this.disposed) { +return; +}this.disposed = true; +}if (this.appContext != null) { +jssun.awt.SunToolkit.postEvent (this.appContext, new java.awt.SentEvent ()); +}var next = null; +{ +java.awt.SequencedEvent.notifyAll (); +if (java.awt.SequencedEvent.list.getFirst () === this) { +java.awt.SequencedEvent.list.removeFirst (); +if (!java.awt.SequencedEvent.list.isEmpty ()) { +next = java.awt.SequencedEvent.list.getFirst (); +}} else { +java.awt.SequencedEvent.list.remove (this); +}}if (next != null && next.appContext != null) { +jssun.awt.SunToolkit.postEvent (next.appContext, new java.awt.SentEvent ()); +}}); +c$.$SequencedEvent$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (java.awt, "SequencedEvent$1", null, java.awt.Conditional); +Clazz_overrideMethod (c$, "evaluate", +function () { +return !this.b$["java.awt.SequencedEvent"].isFirstOrDisposed (); +}); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"ID", 1006); +c$.list = c$.prototype.list = new java.util.LinkedList (); +}); +Clazz_load(["java.util.AbstractList"],"java.util.AbstractSequentialList",["java.lang.IndexOutOfBoundsException"],function(){ +c$=Clazz_declareType(java.util,"AbstractSequentialList",java.util.AbstractList); +Clazz_defineMethod(c$,"add", +function(location,object){ +this.listIterator(location).add(object); +},"~N,~O"); +Clazz_defineMethod(c$,"addAll", +function(location,collection){ +var it=this.listIterator(location); +var colIt=collection.iterator(); +var next=it.nextIndex(); +while(colIt.hasNext()){ +it.add(colIt.next()); +it.previous(); +} +return next!=it.nextIndex(); +},"~N,java.util.Collection"); +Clazz_overrideMethod(c$,"get", +function(location){ +try{ +return this.listIterator(location).next(); +}catch(e){ +if(Clazz_instanceOf(e,java.util.NoSuchElementException)){ +throw new IndexOutOfBoundsException(); +}else{ +throw e; +} +} +},"~N"); +Clazz_overrideMethod(c$,"iterator", +function(){ +return this.listIterator(0); +}); +Clazz_defineMethod(c$,"remove", +function(location){ +try{ +var it=this.listIterator(location); +var result=it.next(); +it.remove(); +return result; +}catch(e){ +if(Clazz_instanceOf(e,java.util.NoSuchElementException)){ +throw new IndexOutOfBoundsException(); +}else{ +throw e; +} +} +},"~N"); +Clazz_overrideMethod(c$,"set", +function(location,object){ +var it=this.listIterator(location); +var result=it.next(); +it.set(object); +return result; +},"~N,~O"); +}); +Clazz_load(["java.util.AbstractSequentialList","$.List","$.ListIterator","$.Queue"],"java.util.LinkedList",["java.lang.IllegalStateException","$.IndexOutOfBoundsException","java.lang.reflect.Array","java.util.ConcurrentModificationException","$.NoSuchElementException"],function(){ +c$=Clazz_decorateAsClass(function(){ +this.$size=0; +this.voidLink=null; +Clazz_instantialize(this,arguments); +},java.util,"LinkedList",java.util.AbstractSequentialList,[java.util.List,java.util.Queue,Cloneable,java.io.Serializable]); +Clazz_makeConstructor(c$, +function(){ +Clazz_superConstructor(this,java.util.LinkedList,[]); +this.voidLink=new java.util.LinkedList.Link(null,null,null); +this.voidLink.previous=this.voidLink; +this.voidLink.next=this.voidLink; +}); +Clazz_makeConstructor(c$, +function(collection){ +this.construct(); +this.addAll(collection); +},"java.util.Collection"); +Clazz_defineMethod(c$,"add", +function(location,object){ +if(0<=location&&location<=this.$size){ +var link=this.voidLink; +if(location<(Math.floor(this.$size/2))){ +for(var i=0;i<=location;i++){ +link=link.next; +} +}else{ +for(var i=this.$size;i>location;i--){ +link=link.previous; +} +}var previous=link.previous; +var newLink=new java.util.LinkedList.Link(object,previous,link); +previous.next=newLink; +link.previous=newLink; +this.$size++; +this.modCount++; +}else{ +throw new IndexOutOfBoundsException(); +}},"~N,~O"); +Clazz_defineMethod(c$,"add", +function(object){ +var oldLast=this.voidLink.previous; +var newLink=new java.util.LinkedList.Link(object,oldLast,this.voidLink); +this.voidLink.previous=newLink; +oldLast.next=newLink; +this.$size++; +this.modCount++; +return true; +},"~O"); +Clazz_defineMethod(c$,"addAll", +function(location,collection){ +if(location<0||location>this.$size){ +throw new IndexOutOfBoundsException(); +}var adding=collection.size(); +if(adding==0){ +return false; +}var previous=this.voidLink; +if(location<(Math.floor(this.$size/2))){ +for(var i=0;i=location;i--){ +previous=previous.previous; +} +}var next=previous.next; +for(var e,$e=collection.iterator();$e.hasNext()&&((e=$e.next())||true);){ +var newLink=new java.util.LinkedList.Link(e,previous,null); +previous.next=newLink; +previous=newLink; +} +previous.next=next; +next.previous=previous; +this.$size+=adding; +this.modCount++; +return true; +},"~N,java.util.Collection"); +Clazz_defineMethod(c$,"addAll", +function(collection){ +var adding=collection.size(); +if(adding==0){ +return false; +}var previous=this.voidLink.previous; +for(var e,$e=collection.iterator();$e.hasNext()&&((e=$e.next())||true);){ +var newLink=new java.util.LinkedList.Link(e,previous,null); +previous.next=newLink; +previous=newLink; +} +previous.next=this.voidLink; +this.voidLink.previous=previous; +this.$size+=adding; +this.modCount++; +return true; +},"java.util.Collection"); +Clazz_defineMethod(c$,"addFirst", +function(object){ +var oldFirst=this.voidLink.next; +var newLink=new java.util.LinkedList.Link(object,this.voidLink,oldFirst); +this.voidLink.next=newLink; +oldFirst.previous=newLink; +this.$size++; +this.modCount++; +},"~O"); +Clazz_defineMethod(c$,"addLast", +function(object){ +var oldLast=this.voidLink.previous; +var newLink=new java.util.LinkedList.Link(object,oldLast,this.voidLink); +this.voidLink.previous=newLink; +oldLast.next=newLink; +this.$size++; +this.modCount++; +},"~O"); +Clazz_overrideMethod(c$,"clear", +function(){ +if(this.$size>0){ +this.$size=0; +this.voidLink.next=this.voidLink; +this.voidLink.previous=this.voidLink; +this.modCount++; +}}); +Clazz_overrideMethod(c$,"clone", +function(){ +return new java.util.LinkedList(this); +}); +Clazz_overrideMethod(c$,"contains", +function(object){ +var link=this.voidLink.next; +if(object!=null){ +while(link!==this.voidLink){ +if(object.equals(link.data)){ +return true; +}link=link.next; +} +}else{ +while(link!==this.voidLink){ +if(link.data==null){ +return true; +}link=link.next; +} +}return false; +},"~O"); +Clazz_overrideMethod(c$,"get", +function(location){ +if(0<=location&&locationlocation;i--){ +link=link.previous; +} +}return link.data; +}throw new IndexOutOfBoundsException(); +},"~N"); +Clazz_defineMethod(c$,"getFirst", +function(){ +var first=this.voidLink.next; +if(first!==this.voidLink){ +return first.data; +}throw new java.util.NoSuchElementException(); +}); +Clazz_defineMethod(c$,"getLast", +function(){ +var last=this.voidLink.previous; +if(last!==this.voidLink){ +return last.data; +}throw new java.util.NoSuchElementException(); +}); +Clazz_overrideMethod(c$,"indexOf", +function(object){ +var pos=0; +var link=this.voidLink.next; +if(object!=null){ +while(link!==this.voidLink){ +if(object.equals(link.data)){ +return pos; +}link=link.next; +pos++; +} +}else{ +while(link!==this.voidLink){ +if(link.data==null){ +return pos; +}link=link.next; +pos++; +} +}return-1; +},"~O"); +Clazz_overrideMethod(c$,"lastIndexOf", +function(object){ +var pos=this.$size; +var link=this.voidLink.previous; +if(object!=null){ +while(link!==this.voidLink){ +pos--; +if(object.equals(link.data)){ +return pos; +}link=link.previous; +} +}else{ +while(link!==this.voidLink){ +pos--; +if(link.data==null){ +return pos; +}link=link.previous; +} +}return-1; +},"~O"); +Clazz_defineMethod(c$,"listIterator", +function(location){ +return new java.util.LinkedList.LinkIterator(this,location); +},"~N"); +Clazz_defineMethod(c$,"remove", +function(location){ +if(0<=location&&locationlocation;i--){ +link=link.previous; +} +}var previous=link.previous; +var next=link.next; +previous.next=next; +next.previous=previous; +this.$size--; +this.modCount++; +return link.data; +}throw new IndexOutOfBoundsException(); +},"~N"); +Clazz_defineMethod(c$,"remove", +function(object){ +var link=this.voidLink.next; +if(object!=null){ +while(link!==this.voidLink&&!object.equals(link.data)){ +link=link.next; +} +}else{ +while(link!==this.voidLink&&link.data!=null){ +link=link.next; +} +}if(link===this.voidLink){ +return false; +}var next=link.next; +var previous=link.previous; +previous.next=next; +next.previous=previous; +this.$size--; +this.modCount++; +return true; +},"~O"); +Clazz_defineMethod(c$,"removeFirst", +function(){ +var first=this.voidLink.next; +if(first!==this.voidLink){ +var next=first.next; +this.voidLink.next=next; +next.previous=this.voidLink; +this.$size--; +this.modCount++; +return first.data; +}throw new java.util.NoSuchElementException(); +}); +Clazz_defineMethod(c$,"removeLast", +function(){ +var last=this.voidLink.previous; +if(last!==this.voidLink){ +var previous=last.previous; +this.voidLink.previous=previous; +previous.next=this.voidLink; +this.$size--; +this.modCount++; +return last.data; +}throw new java.util.NoSuchElementException(); +}); +Clazz_overrideMethod(c$,"set", +function(location,object){ +if(0<=location&&locationlocation;i--){ +link=link.previous; +} +}var result=link.data; +link.data=object; +return result; +}throw new IndexOutOfBoundsException(); +},"~N,~O"); +Clazz_overrideMethod(c$,"size", +function(){ +return this.$size; +}); +Clazz_overrideMethod(c$,"offer", +function(o){ +this.add(o); +return true; +},"~O"); +Clazz_overrideMethod(c$,"poll", +function(){ +return this.$size==0?null:this.removeFirst(); +}); +Clazz_defineMethod(c$,"remove", +function(){ +return this.removeFirst(); +}); +Clazz_overrideMethod(c$,"peek", +function(){ +var first=this.voidLink.next; +return first===this.voidLink?null:first.data; +}); +Clazz_overrideMethod(c$,"element", +function(){ +return this.getFirst(); +}); +Clazz_defineMethod(c$,"toArray", +function(){ +var index=0; +var contents=new Array(this.$size); +var link=this.voidLink.next; +while(link!==this.voidLink){ +contents[index++]=link.data; +link=link.next; +} +return contents; +}); +Clazz_defineMethod(c$,"toArray", +function(contents){ +var index=0; +if(this.$size>contents.length){ +var ct=contents.getClass().getComponentType(); +contents=java.lang.reflect.Array.newInstance(ct,this.$size); +}var link=this.voidLink.next; +while(link!==this.voidLink){ +contents[index++]=link.data; +link=link.next; +} +if(index=b;this.pos--){ +this.link=this.link.previous; +} +}}else{ +throw new IndexOutOfBoundsException(); +}},"java.util.LinkedList,~N"); +Clazz_overrideMethod(c$,"add", +function(a){ +if(this.expectedModCount==this.list.modCount){ +var b=this.link.next; +var c=new java.util.LinkedList.Link(a,this.link,b); +this.link.next=c; +b.previous=c; +this.link=c; +this.lastLink=null; +this.pos++; +this.expectedModCount++; +this.list.$size++; +this.list.modCount++; +}else{ +throw new java.util.ConcurrentModificationException(); +}},"~O"); +Clazz_overrideMethod(c$,"hasNext", +function(){ +return this.link.next!==this.list.voidLink; +}); +Clazz_overrideMethod(c$,"hasPrevious", +function(){ +return this.link!==this.list.voidLink; +}); +Clazz_overrideMethod(c$,"next", +function(){ +if(this.expectedModCount==this.list.modCount){ +var a=this.link.next; +if(a!==this.list.voidLink){ +this.lastLink=this.link=a; +this.pos++; +return this.link.data; +}throw new java.util.NoSuchElementException(); +}throw new java.util.ConcurrentModificationException(); +}); +Clazz_overrideMethod(c$,"nextIndex", +function(){ +return this.pos+1; +}); +Clazz_overrideMethod(c$,"previous", +function(){ +if(this.expectedModCount==this.list.modCount){ +if(this.link!==this.list.voidLink){ +this.lastLink=this.link; +this.link=this.link.previous; +this.pos--; +return this.lastLink.data; +}throw new java.util.NoSuchElementException(); +}throw new java.util.ConcurrentModificationException(); +}); +Clazz_overrideMethod(c$,"previousIndex", +function(){ +return this.pos; +}); +Clazz_overrideMethod(c$,"remove", +function(){ +if(this.expectedModCount==this.list.modCount){ +if(this.lastLink!=null){ +var a=this.lastLink.next; +var b=this.lastLink.previous; +a.previous=b; +b.next=a; +if(this.lastLink===this.link){ +this.pos--; +}this.link=b; +this.lastLink=null; +this.expectedModCount++; +this.list.$size--; +this.list.modCount++; +}else{ +throw new IllegalStateException(); +}}else{ +throw new java.util.ConcurrentModificationException(); +}}); +Clazz_overrideMethod(c$,"set", +function(a){ +if(this.expectedModCount==this.list.modCount){ +if(this.lastLink!=null){ +this.lastLink.data=a; +}else{ +throw new IllegalStateException(); +}}else{ +throw new java.util.ConcurrentModificationException(); +}},"~O"); +c$=Clazz_p0p(); +}); +Clazz_declarePackage ("JU"); +Clazz_load (["JU.T3"], "JU.V3", null, function () { +c$ = Clazz_declareType (JU, "V3", JU.T3); +Clazz_makeConstructor (c$, +function () { +}); +c$.newV = Clazz_defineMethod (c$, "newV", +function (t) { +return JU.V3.new3 (t.x, t.y, t.z); +}, "JU.T3"); +c$.newVsub = Clazz_defineMethod (c$, "newVsub", +function (t1, t2) { +return JU.V3.new3 (t1.x - t2.x, t1.y - t2.y, t1.z - t2.z); +}, "JU.T3,JU.T3"); +c$.new3 = Clazz_defineMethod (c$, "new3", +function (x, y, z) { +var v = new JU.V3 (); +v.x = x; +v.y = y; +v.z = z; +return v; +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "angle", +function (v1) { +var xx = this.y * v1.z - this.z * v1.y; +var yy = this.z * v1.x - this.x * v1.z; +var zz = this.x * v1.y - this.y * v1.x; +var cross = Math.sqrt (xx * xx + yy * yy + zz * zz); +return Math.abs (Math.atan2 (cross, this.dot (v1))); +}, "JU.V3"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.util.Vector"], "javax.swing.ButtonGroup", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.buttons = null; +this.selection = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "ButtonGroup"); +Clazz_prepareFields (c$, function () { +this.buttons = new java.util.Vector (); +}); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "add", +function (b) { +if (b == null) { +return; +}this.buttons.addElement (b); +if (b.isSelected ()) { +if (this.selection == null) { +this.selection = b.getModel (); +} else { +b.setSelected (false); +}}b.getModel ().setGroup (this); +}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "remove", +function (b) { +if (b == null) { +return; +}this.buttons.removeElement (b); +if (b.getModel () === this.selection) { +this.selection = null; +}b.getModel ().setGroup (null); +}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "clearSelection", +function () { +if (this.selection != null) { +var oldSelection = this.selection; +this.selection = null; +oldSelection.setSelected (false); +}}); +Clazz_defineMethod (c$, "getElements", +function () { +return this.buttons.elements (); +}); +Clazz_defineMethod (c$, "getSelection", +function () { +return this.selection; +}); +Clazz_defineMethod (c$, "setSelected", +function (m, b) { +if (b && m != null && m !== this.selection) { +var oldSelection = this.selection; +this.selection = m; +if (oldSelection != null) { +oldSelection.setSelected (false); +}m.setSelected (true); +}}, "javax.swing.ButtonModel,~B"); +Clazz_defineMethod (c$, "isSelected", +function (m) { +return (m === this.selection); +}, "javax.swing.ButtonModel"); +Clazz_defineMethod (c$, "getButtonCount", +function () { +if (this.buttons == null) { +return 0; +} else { +return this.buttons.size (); +}}); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["jssun.awt.PaintEventDispatcher"], "javax.swing.SwingPaintEventDispatcher", ["javax.swing.RootPaneContainer", "jssun.awt.SunToolkit"], function () { +c$ = Clazz_declareType (javax.swing, "SwingPaintEventDispatcher", jssun.awt.PaintEventDispatcher); +Clazz_overrideMethod (c$, "shouldDoNativeBackgroundErase", +function (c) { +return javax.swing.SwingPaintEventDispatcher.ERASE_BACKGROUND || !(Clazz_instanceOf (c, javax.swing.RootPaneContainer)); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "queueSurfaceDataReplacing", +function (c, r) { +if (Clazz_instanceOf (c, javax.swing.RootPaneContainer)) { +var appContext = jssun.awt.SunToolkit.targetToAppContext (c); +return true; +}return Clazz_superCall (this, javax.swing.SwingPaintEventDispatcher, "queueSurfaceDataReplacing", [c, r]); +}, "java.awt.Component,Runnable"); +Clazz_defineStatics (c$, +"SHOW_FROM_DOUBLE_BUFFER", false, +"ERASE_BACKGROUND", false); +{ +javax.swing.SwingPaintEventDispatcher.SHOW_FROM_DOUBLE_BUFFER = false; +javax.swing.SwingPaintEventDispatcher.ERASE_BACKGROUND = true; +}}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (["java.util.HashSet", "$.IdentityHashMap"], "jssun.awt.AWTAutoShutdown", ["java.awt.AWTEvent"], function () { +c$ = Clazz_decorateAsClass (function () { +this.busyThreadSet = null; +this.toolkitThreadBusy = false; +this.peerMap = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "AWTAutoShutdown", null, Runnable); +Clazz_prepareFields (c$, function () { +this.busyThreadSet = new java.util.HashSet (7); +this.peerMap = new java.util.IdentityHashMap (); +}); +Clazz_makeConstructor (c$, + function () { +}); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function () { +return (jssun.awt.AWTAutoShutdown.theInstance == null ? (jssun.awt.AWTAutoShutdown.theInstance = new jssun.awt.AWTAutoShutdown ()) : jssun.awt.AWTAutoShutdown.theInstance); +}); +c$.notifyToolkitThreadBusy = Clazz_defineMethod (c$, "notifyToolkitThreadBusy", +function () { +jssun.awt.AWTAutoShutdown.getInstance ().setToolkitBusy (true); +}); +c$.notifyToolkitThreadFree = Clazz_defineMethod (c$, "notifyToolkitThreadFree", +function () { +jssun.awt.AWTAutoShutdown.getInstance ().setToolkitBusy (false); +}); +Clazz_defineMethod (c$, "notifyThreadBusy", +function (thread) { +this.busyThreadSet.add (thread); +}, "Thread"); +Clazz_defineMethod (c$, "notifyThreadFree", +function (thread) { +this.busyThreadSet.remove (thread); +}, "Thread"); +Clazz_defineMethod (c$, "notifyPeerMapUpdated", +function () { +if (!this.isReadyToShutdown ()) { +this.activateBlockerThread (); +}}); +Clazz_defineMethod (c$, "isReadyToShutdown", + function () { +return (!this.toolkitThreadBusy && this.peerMap.isEmpty () && this.busyThreadSet.isEmpty ()); +}); +Clazz_defineMethod (c$, "setToolkitBusy", + function (busy) { +if (busy != this.toolkitThreadBusy) { +if (busy != this.toolkitThreadBusy) { +if (busy) { +this.toolkitThreadBusy = busy; +} else { +this.toolkitThreadBusy = busy; +}}}}, "~B"); +Clazz_overrideMethod (c$, "run", +function () { +}); +c$.getShutdownEvent = Clazz_defineMethod (c$, "getShutdownEvent", +function () { +return ((Clazz_isClassDefined ("jssun.awt.AWTAutoShutdown$1") ? 0 : jssun.awt.AWTAutoShutdown.$AWTAutoShutdown$1$ ()), Clazz_innerTypeInstance (jssun.awt.AWTAutoShutdown$1, this, null, jssun.awt.AWTAutoShutdown.getInstance (), 0)); +}); +Clazz_defineMethod (c$, "activateBlockerThread", + function () { +}); +Clazz_defineMethod (c$, "registerPeer", +function (target, peer) { +this.peerMap.put (target, peer); +this.notifyPeerMapUpdated (); +}, "~O,~O"); +Clazz_defineMethod (c$, "unregisterPeer", +function (target, peer) { +if (this.peerMap.get (target) === peer) { +this.peerMap.remove (target); +}}, "~O,~O"); +Clazz_defineMethod (c$, "getPeer", +function (target) { +return this.peerMap.get (target); +}, "~O"); +Clazz_defineMethod (c$, "dumpPeers", +function (aLog) { +aLog.fine ("Mapped peers:"); +for (var key, $key = this.peerMap.keySet ().iterator (); $key.hasNext () && ((key = $key.next ()) || true);) { +aLog.fine (key + "->" + this.peerMap.get (key)); +} +}, "java.util.logging.Logger"); +c$.$AWTAutoShutdown$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (jssun.awt, "AWTAutoShutdown$1", java.awt.AWTEvent); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"theInstance", null); +}); +Clazz_declarePackage ("jssun.awt"); +c$ = Clazz_decorateAsClass (function () { +this.event = null; +this.next = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "EventQueueItem"); +Clazz_makeConstructor (c$, +function (evt) { +this.event = evt; +}, "java.awt.AWTEvent"); +Clazz_declarePackage ("jssun.awt"); +Clazz_declareInterface (jssun.awt, "ModalExclude"); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (["java.awt.peer.CanvasPeer", "$.LightweightPeer", "$.PanelPeer"], "jssun.awt.NullComponentPeer", ["java.lang.IllegalStateException", "$.UnsupportedOperationException", "java.awt.Dimension", "$.Insets", "$.Point", "$.Rectangle"], function () { +c$ = Clazz_declareType (jssun.awt, "NullComponentPeer", null, [java.awt.peer.LightweightPeer, java.awt.peer.CanvasPeer, java.awt.peer.PanelPeer]); +Clazz_overrideMethod (c$, "isObscured", +function () { +return false; +}); +Clazz_overrideMethod (c$, "canDetermineObscurity", +function () { +return false; +}); +Clazz_overrideMethod (c$, "isFocusable", +function () { +return false; +}); +Clazz_overrideMethod (c$, "setVisible", +function (b) { +}, "~B"); +Clazz_defineMethod (c$, "show", +function () { +}); +Clazz_defineMethod (c$, "hide", +function () { +}); +Clazz_overrideMethod (c$, "setEnabled", +function (b) { +}, "~B"); +Clazz_defineMethod (c$, "enable", +function () { +}); +Clazz_defineMethod (c$, "disable", +function () { +}); +Clazz_overrideMethod (c$, "paint", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "repaint", +function (tm, x, y, width, height) { +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "print", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "setBounds", +function (x, y, width, height, op) { +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "reshape", +function (x, y, width, height) { +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "coalescePaintEvent", +function (e) { +}, "java.awt.event.PaintEvent"); +Clazz_defineMethod (c$, "handleEvent", +function (e) { +return false; +}, "java.awt.Event"); +Clazz_defineMethod (c$, "handleEvent", +function (arg0) { +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "getPreferredSize", +function () { +return new java.awt.Dimension (1, 1); +}); +Clazz_overrideMethod (c$, "getMinimumSize", +function () { +return new java.awt.Dimension (1, 1); +}); +Clazz_overrideMethod (c$, "getToolkit", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getColorModel", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getGraphics", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getGraphicsConfiguration", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +return null; +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "dispose", +function () { +}); +Clazz_overrideMethod (c$, "setForeground", +function (c) { +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setBackground", +function (c) { +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setFont", +function (f) { +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "updateCursorImmediately", +function () { +}); +Clazz_defineMethod (c$, "setCursor", +function (cursor) { +}, "java.awt.Cursor"); +Clazz_overrideMethod (c$, "requestFocus", +function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { +return false; +}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); +Clazz_defineMethod (c$, "createImage", +function (producer) { +return null; +}, "java.awt.image.ImageProducer"); +Clazz_defineMethod (c$, "createImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "prepareImage", +function (img, w, h, o) { +return false; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "checkImage", +function (img, w, h, o) { +return 0; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "preferredSize", +function () { +return this.getPreferredSize (); +}); +Clazz_defineMethod (c$, "minimumSize", +function () { +return this.getMinimumSize (); +}); +Clazz_overrideMethod (c$, "getLocationOnScreen", +function () { +return new java.awt.Point (0, 0); +}); +Clazz_overrideMethod (c$, "getInsets", +function () { +return this.insets (); +}); +Clazz_overrideMethod (c$, "beginValidate", +function () { +}); +Clazz_overrideMethod (c$, "endValidate", +function () { +}); +Clazz_defineMethod (c$, "insets", +function () { +return new java.awt.Insets (0, 0, 0, 0); +}); +Clazz_defineMethod (c$, "isPaintPending", +function () { +return false; +}); +Clazz_overrideMethod (c$, "handlesWheelScrolling", +function () { +return false; +}); +Clazz_overrideMethod (c$, "createVolatileImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "beginLayout", +function () { +}); +Clazz_overrideMethod (c$, "endLayout", +function () { +}); +Clazz_overrideMethod (c$, "getBackBuffer", +function () { +throw new IllegalStateException ("Page-flipping is not allowed on a lightweight component"); +}); +Clazz_overrideMethod (c$, "destroyBuffers", +function () { +}); +Clazz_overrideMethod (c$, "isReparentSupported", +function () { +return false; +}); +Clazz_overrideMethod (c$, "reparent", +function (newNativeParent) { +throw new UnsupportedOperationException (); +}, "java.awt.peer.ContainerPeer"); +Clazz_defineMethod (c$, "restack", +function () { +throw new UnsupportedOperationException (); +}); +Clazz_defineMethod (c$, "isRestackSupported", +function () { +return false; +}); +Clazz_overrideMethod (c$, "layout", +function () { +}); +Clazz_overrideMethod (c$, "getBounds", +function () { +return new java.awt.Rectangle (0, 0, 0, 0); +}); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (null, "jssun.awt.PaintEventDispatcher", ["java.awt.Rectangle", "java.awt.event.PaintEvent"], function () { +c$ = Clazz_declareType (jssun.awt, "PaintEventDispatcher"); +c$.setPaintEventDispatcher = Clazz_defineMethod (c$, "setPaintEventDispatcher", +function (dispatcher) { +{ +jssun.awt.PaintEventDispatcher.dispatcher = dispatcher; +}}, "jssun.awt.PaintEventDispatcher"); +c$.getPaintEventDispatcher = Clazz_defineMethod (c$, "getPaintEventDispatcher", +function () { +{ +if (jssun.awt.PaintEventDispatcher.dispatcher == null) { +jssun.awt.PaintEventDispatcher.dispatcher = new jssun.awt.PaintEventDispatcher (); +}return jssun.awt.PaintEventDispatcher.dispatcher; +}}); +Clazz_defineMethod (c$, "createPaintEvent", +function (target, x, y, w, h) { +return new java.awt.event.PaintEvent (target, 800, new java.awt.Rectangle (x, y, w, h)); +}, "java.awt.Component,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "shouldDoNativeBackgroundErase", +function (c) { +return true; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "queueSurfaceDataReplacing", +function (c, r) { +return false; +}, "java.awt.Component,Runnable"); +Clazz_defineStatics (c$, +"dispatcher", null); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (null, "jssun.awt.PostEventQueue", ["jssun.awt.EventQueueItem", "$.SunToolkit", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.queueHead = null; +this.queueTail = null; +this.eventQueue = null; +Clazz_instantialize (this, arguments); +}, jssun.awt, "PostEventQueue"); +Clazz_makeConstructor (c$, +function (eq) { +this.eventQueue = eq; +}, "java.awt.EventQueue"); +Clazz_defineMethod (c$, "noEvents", +function () { +return this.queueHead == null; +}); +Clazz_defineMethod (c$, "flush", +function () { +if (this.queueHead != null) { +var tempQueue; +{ +tempQueue = this.queueHead; +this.queueHead = this.queueTail = null; +while (tempQueue != null) { +swingjs.JSToolkit.alert ("postevent IS NOT IMPLEMENTED " + tempQueue.event); +this.eventQueue.postEvent (tempQueue.event); +tempQueue = tempQueue.next; +} +}}}); +Clazz_defineMethod (c$, "postEvent", +function (event) { +var item = new jssun.awt.EventQueueItem (event); +{ +if (this.queueHead == null) { +this.queueHead = this.queueTail = item; +} else { +this.queueTail.next = item; +this.queueTail = item; +}}jssun.awt.SunToolkit.wakeupEventQueue (this.eventQueue, false); +}, "java.awt.AWTEvent"); +}); +Clazz_declarePackage ("jssun.java2d"); +Clazz_load (["java.awt.Graphics2D"], "jssun.java2d.SunGraphics2D", ["java.awt.geom.AffineTransform"], function () { +c$ = Clazz_decorateAsClass (function () { +this.transformState = 0; +this.foregroundColor = null; +this.backgroundColor = null; +this.$transform = null; +this.transX = 0; +this.transY = 0; +this.hints = null; +Clazz_instantialize (this, arguments); +}, jssun.java2d, "SunGraphics2D", java.awt.Graphics2D); +Clazz_defineMethod (c$, "clone", +function () { +return this.clone0 (); +}); +Clazz_defineMethod (c$, "clone0", +function () { +try { +var g; +{ +g = Clazz_clone(this); +}g.$transform = new java.awt.geom.AffineTransform (this.$transform); +if (this.hints != null) { +g.hints = this.hints.clone (); +}return g; +} catch (e) { +if (Clazz_exceptionOf (e, CloneNotSupportedException)) { +} else { +throw e; +} +} +return null; +}); +Clazz_defineMethod (c$, "create", +function () { +return this.clone0 (); +}); +Clazz_defineStatics (c$, +"TRANSFORM_GENERIC", 4, +"TRANSFORM_TRANSLATESCALE", 3, +"TRANSFORM_ANY_TRANSLATE", 2, +"TRANSFORM_INT_TRANSLATE", 1, +"TRANSFORM_ISIDENT", 0); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (null, "javax.swing.UIManager", ["java.util.ArrayList", "java.util.Locale", "javax.swing.RepaintManager", "$.SwingPaintEventDispatcher", "$.SwingUtilities", "jssun.awt.PaintEventDispatcher", "swingjs.JSToolkit"], function () { +c$ = Clazz_declareType (javax.swing, "UIManager"); +c$.getLookAndFeelDefaults = Clazz_defineMethod (c$, "getLookAndFeelDefaults", +function () { +return javax.swing.UIManager.uid; +}); +c$.getInstalledLookAndFeels = Clazz_defineMethod (c$, "getInstalledLookAndFeels", +function () { +return javax.swing.UIManager.installedLAFs; +}); +c$.setInstalledLookAndFeels = Clazz_defineMethod (c$, "setInstalledLookAndFeels", +function (infos) { +swingjs.JSToolkit.notImplemented (null); +}, "~A"); +c$.installLookAndFeel = Clazz_defineMethod (c$, "installLookAndFeel", +function (info) { +swingjs.JSToolkit.notImplemented (null); +}, "javax.swing.UIManager.LookAndFeelInfo"); +c$.installLookAndFeel = Clazz_defineMethod (c$, "installLookAndFeel", +function (name, className) { +swingjs.JSToolkit.notImplemented (null); +}, "~S,~S"); +c$.getLookAndFeel = Clazz_defineMethod (c$, "getLookAndFeel", +function () { +return (javax.swing.UIManager.laf == null ? (javax.swing.UIManager.laf = swingjs.JSToolkit.getInstance ("swingjs.plaf.HTML5LookAndFeel")) : javax.swing.UIManager.laf); +}); +c$.setLookAndFeel = Clazz_defineMethod (c$, "setLookAndFeel", +function (newLookAndFeel) { +}, "javax.swing.LookAndFeel"); +c$.setLookAndFeel = Clazz_defineMethod (c$, "setLookAndFeel", +function (className) { +var lnfClass = javax.swing.SwingUtilities.loadSystemClass (className); +javax.swing.UIManager.setLookAndFeel ((lnfClass.newInstance ())); +}, "~S"); +c$.getSystemLookAndFeelClassName = Clazz_defineMethod (c$, "getSystemLookAndFeelClassName", +function () { +return javax.swing.UIManager.getCrossPlatformLookAndFeelClassName (); +}); +c$.getCrossPlatformLookAndFeelClassName = Clazz_defineMethod (c$, "getCrossPlatformLookAndFeelClassName", +function () { +return "swingjs.plaf.HTML5LookAndFeel"; +}); +c$.getDefaults = Clazz_defineMethod (c$, "getDefaults", +function () { +javax.swing.UIManager.maybeInitialize (); +return javax.swing.UIManager.uid; +}); +c$.getFont = Clazz_defineMethod (c$, "getFont", +function (key) { +return javax.swing.UIManager.getDefaults ().getFont (key); +}, "~O"); +c$.getFont = Clazz_defineMethod (c$, "getFont", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getFont (key, l); +}, "~O,java.util.Locale"); +c$.getColor = Clazz_defineMethod (c$, "getColor", +function (key) { +return javax.swing.UIManager.getDefaults ().getColor (key); +}, "~O"); +c$.getColor = Clazz_defineMethod (c$, "getColor", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getColor (key, l); +}, "~O,java.util.Locale"); +c$.getIcon = Clazz_defineMethod (c$, "getIcon", +function (key) { +return javax.swing.UIManager.getDefaults ().getIcon (key); +}, "~O"); +c$.getIcon = Clazz_defineMethod (c$, "getIcon", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getIcon (key, l); +}, "~O,java.util.Locale"); +c$.getBorder = Clazz_defineMethod (c$, "getBorder", +function (key) { +return javax.swing.UIManager.getDefaults ().getBorder (key); +}, "~O"); +c$.getBorder = Clazz_defineMethod (c$, "getBorder", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getBorder (key, l); +}, "~O,java.util.Locale"); +c$.getString = Clazz_defineMethod (c$, "getString", +function (key) { +return javax.swing.UIManager.getDefaults ().getString (key); +}, "~O"); +c$.getString = Clazz_defineMethod (c$, "getString", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getString (key, l); +}, "~O,java.util.Locale"); +c$.getString = Clazz_defineMethod (c$, "getString", +function (key, c) { +var l = (c == null) ? java.util.Locale.getDefault () : c.getLocale (); +return javax.swing.UIManager.getString (key, l); +}, "~O,java.awt.Component"); +c$.getInt = Clazz_defineMethod (c$, "getInt", +function (key) { +return javax.swing.UIManager.getDefaults ().getInt (key); +}, "~O"); +c$.getInt = Clazz_defineMethod (c$, "getInt", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getInt (key, l); +}, "~O,java.util.Locale"); +c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", +function (key) { +return javax.swing.UIManager.getDefaults ().getBoolean (key); +}, "~O"); +c$.getBoolean = Clazz_defineMethod (c$, "getBoolean", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getBoolean (key, l); +}, "~O,java.util.Locale"); +c$.getInsets = Clazz_defineMethod (c$, "getInsets", +function (key) { +return javax.swing.UIManager.getDefaults ().getInsets (key); +}, "~O"); +c$.getInsets = Clazz_defineMethod (c$, "getInsets", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getInsets (key, l); +}, "~O,java.util.Locale"); +c$.getDimension = Clazz_defineMethod (c$, "getDimension", +function (key) { +return javax.swing.UIManager.getDefaults ().getDimension (key); +}, "~O"); +c$.getDimension = Clazz_defineMethod (c$, "getDimension", +function (key, l) { +return javax.swing.UIManager.getDefaults ().getDimension (key, l); +}, "~O,java.util.Locale"); +c$.get = Clazz_defineMethod (c$, "get", +function (key) { +return javax.swing.UIManager.getDefaults ().get (key); +}, "~O"); +c$.get = Clazz_defineMethod (c$, "get", +function (key, l) { +return javax.swing.UIManager.getDefaults ().get (key, l); +}, "~O,java.util.Locale"); +c$.put = Clazz_defineMethod (c$, "put", +function (key, value) { +return javax.swing.UIManager.getDefaults ().put (key, value); +}, "~O,~O"); +c$.getUI = Clazz_defineMethod (c$, "getUI", +function (target) { +javax.swing.UIManager.maybeInitialize (); +var ui = null; +ui = javax.swing.UIManager.getDefaults ().getUI (target); +if (ui == null) System.out.println (target.getUIClassID () + " has not been implemented"); +return ui; +}, "javax.swing.JComponent"); +c$.addPropertyChangeListener = Clazz_defineMethod (c$, "addPropertyChangeListener", +function (listener) { +}, "java.beans.PropertyChangeListener"); +c$.removePropertyChangeListener = Clazz_defineMethod (c$, "removePropertyChangeListener", +function (listener) { +}, "java.beans.PropertyChangeListener"); +c$.getPropertyChangeListeners = Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +return new Array (0); +}); +c$.maybeInitialize = Clazz_defineMethod (c$, "maybeInitialize", + function () { +if (javax.swing.UIManager.uid == null) { +javax.swing.UIManager.uid = swingjs.JSToolkit.getLookAndFeelDefaults (); +javax.swing.UIManager.initialize (); +}}); +c$.initialize = Clazz_defineMethod (c$, "initialize", + function () { +if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { +jssun.awt.PaintEventDispatcher.setPaintEventDispatcher ( new javax.swing.SwingPaintEventDispatcher ()); +}}); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.name = null; +this.className = null; +Clazz_instantialize (this, arguments); +}, javax.swing.UIManager, "LookAndFeelInfo"); +Clazz_makeConstructor (c$, +function (a, b) { +this.name = a; +this.className = b; +}, "~S,~S"); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_defineMethod (c$, "getClassName", +function () { +return this.className; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return this.getClass ().getName () + "[" + this.getName () + " " + this.getClassName () + "]"; +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"installedLAFs", null); +{ +var iLAFs = new java.util.ArrayList (4); +iLAFs.add ( new javax.swing.UIManager.LookAndFeelInfo ("HTML5", "swingjs.plaf.HTML5LookAndFeel")); +javax.swing.UIManager.installedLAFs = iLAFs.toArray ( new Array (iLAFs.size ())); +}Clazz_defineStatics (c$, +"laf", null, +"uid", null); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.util.Hashtable", "java.util.Locale"], "javax.swing.UIDefaults", ["java.lang.Boolean", "$.Error", "java.util.HashMap", "$.Vector", "java.awt.Color", "$.Dimension", "$.Font", "$.Insets", "javax.swing.Icon", "$.SwingUtilities", "javax.swing.border.Border", "javax.swing.event.SwingPropertyChangeSupport", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.changeSupport = null; +this.resourceBundles = null; +this.defaultLocale = null; +this.resourceCache = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "UIDefaults", java.util.Hashtable); +Clazz_prepareFields (c$, function () { +this.defaultLocale = java.util.Locale.getDefault (); +}); +Clazz_makeConstructor (c$, +function () { +this.construct (700, .75); +}); +Clazz_makeConstructor (c$, +function (initialCapacity, loadFactor) { +Clazz_superConstructor (this, javax.swing.UIDefaults, [initialCapacity, loadFactor]); +this.resourceCache = new java.util.HashMap (); +}, "~N,~N"); +Clazz_makeConstructor (c$, +function (keyValueList) { +Clazz_superConstructor (this, javax.swing.UIDefaults, [Clazz_doubleToInt (keyValueList.length / 2)]); +for (var i = 0; i < keyValueList.length; i += 2) { +Clazz_superCall (this, javax.swing.UIDefaults, "put", [keyValueList[i], keyValueList[i + 1]]); +} +}, "~A"); +Clazz_defineMethod (c$, "get", +function (key) { +var value = this.getFromHashtable (key); +return (value != null) ? value : this.getFromResourceBundle (key, null); +}, "~O"); +Clazz_defineMethod (c$, "getFromHashtable", + function (key) { +var value = Clazz_superCall (this, javax.swing.UIDefaults, "get", [key]); +if (value == null && (Clazz_instanceOf (key, String))) { +var skey = key; +if (skey.endsWith (".font") || skey.endsWith (".background") || skey.endsWith (".foreground")) value = Clazz_superCall (this, javax.swing.UIDefaults, "get", ["*" + skey.substring (skey.lastIndexOf ("."))]); +}if ((value !== javax.swing.UIDefaults.PENDING) && !(Clazz_instanceOf (value, javax.swing.UIDefaults.ActiveValue)) && !(Clazz_instanceOf (value, javax.swing.UIDefaults.LazyValue))) { +return value; +}if (!(Clazz_instanceOf (value, javax.swing.UIDefaults.ActiveValue))) { +return value; +}if (Clazz_instanceOf (value, javax.swing.UIDefaults.LazyValue)) { +try { +value = (value).createValue (this); +} finally { +if (value == null) { +Clazz_superCall (this, javax.swing.UIDefaults, "remove", [key]); +} else { +Clazz_superCall (this, javax.swing.UIDefaults, "put", [key, value]); +}} +} else { +value = (value).createValue (this); +}return value; +}, "~O"); +Clazz_defineMethod (c$, "get", +function (key, l) { +var value = this.getFromHashtable (key); +return (value != null) ? value : this.getFromResourceBundle (key, l); +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getFromResourceBundle", + function (key, l) { +if (this.resourceBundles == null || this.resourceBundles.isEmpty () || !(Clazz_instanceOf (key, String))) { +return null; +}if (l == null) { +if (this.defaultLocale == null) return null; + else l = this.defaultLocale; +}{ +return this.getResourceCache (l).get (key); +}}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getResourceCache", + function (l) { +return null; +}, "java.util.Locale"); +Clazz_defineMethod (c$, "put", +function (key, value) { +var oldValue = (value == null) ? Clazz_superCall (this, javax.swing.UIDefaults, "remove", [key]) : Clazz_superCall (this, javax.swing.UIDefaults, "put", [key, value]); +if (Clazz_instanceOf (key, String)) { +this.firePropertyChange (key, oldValue, value); +}return oldValue; +}, "~O,~O"); +Clazz_defineMethod (c$, "putDefaults", +function (keyValueList) { +for (var i = 0, max = keyValueList.length; i < max; i += 2) { +var value = keyValueList[i + 1]; +if (value == null) { +Clazz_superCall (this, javax.swing.UIDefaults, "remove", [keyValueList[i]]); +} else { +Clazz_superCall (this, javax.swing.UIDefaults, "put", [keyValueList[i], value]); +}} +this.firePropertyChange ("UIDefaults", null, null); +}, "~A"); +Clazz_defineMethod (c$, "getFont", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, java.awt.Font)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getFont", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, java.awt.Font)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getColor", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, java.awt.Color)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getColor", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, java.awt.Color)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getIcon", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, javax.swing.Icon)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getIcon", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, javax.swing.Icon)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getBorder", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, javax.swing.border.Border)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getBorder", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, javax.swing.border.Border)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getString", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, String)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getString", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, String)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getInt", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, Integer)) ? (value).intValue () : 0; +}, "~O"); +Clazz_defineMethod (c$, "getInt", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, Integer)) ? (value).intValue () : 0; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getBoolean", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, Boolean)) ? (value).booleanValue () : false; +}, "~O"); +Clazz_defineMethod (c$, "getBoolean", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, Boolean)) ? (value).booleanValue () : false; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getInsets", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, java.awt.Insets)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getInsets", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, java.awt.Insets)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getDimension", +function (key) { +var value = this.get (key); +return (Clazz_instanceOf (value, java.awt.Dimension)) ? value : null; +}, "~O"); +Clazz_defineMethod (c$, "getDimension", +function (key, l) { +var value = this.get (key, l); +return (Clazz_instanceOf (value, java.awt.Dimension)) ? value : null; +}, "~O,java.util.Locale"); +Clazz_defineMethod (c$, "getUIClass", +function (uiClassID, uiClassLoader) { +try { +var className = this.get (uiClassID); +if (className != null) { +var cls = this.get (className); +if (cls == null) { +if (uiClassLoader == null) { +cls = javax.swing.SwingUtilities.loadSystemClass (className); +} else { +cls = uiClassLoader.loadClass (className); +}if (cls != null) { +this.put (className, cls); +}}return cls; +}} catch (e$$) { +if (Clazz_exceptionOf (e$$, ClassNotFoundException)) { +var e = e$$; +{ +return null; +} +} else if (Clazz_exceptionOf (e$$, ClassCastException)) { +var e = e$$; +{ +return null; +} +} else { +throw e$$; +} +} +return null; +}, "~S,ClassLoader"); +Clazz_defineMethod (c$, "getUIClass", +function (uiClassID) { +return this.getUIClass (uiClassID, null); +}, "~S"); +Clazz_defineMethod (c$, "getUIError", +function (msg) { +System.err.println ("UIDefaults.getUI() failed: " + msg); +try { +throw new Error (); +} catch (e) { +e.printStackTrace (); +} +}, "~S"); +Clazz_defineMethod (c$, "getUI", +function (target) { +return swingjs.JSToolkit.getComponentUI (target); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "addPropertyChangeListener", +function (listener) { +if (this.changeSupport == null) { +this.changeSupport = new javax.swing.event.SwingPropertyChangeSupport (this); +}this.changeSupport.addPropertyChangeListener (listener); +}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "removePropertyChangeListener", +function (listener) { +if (this.changeSupport != null) { +this.changeSupport.removePropertyChangeListener (listener); +}}, "java.beans.PropertyChangeListener"); +Clazz_defineMethod (c$, "getPropertyChangeListeners", +function () { +if (this.changeSupport == null) { +return new Array (0); +}return this.changeSupport.getPropertyChangeListeners (); +}); +Clazz_defineMethod (c$, "firePropertyChange", +function (propertyName, oldValue, newValue) { +if (this.changeSupport != null) { +this.changeSupport.firePropertyChange (propertyName, oldValue, newValue); +}}, "~S,~O,~O"); +Clazz_defineMethod (c$, "addResourceBundle", +function (bundleName) { +if (bundleName == null) { +return; +}if (this.resourceBundles == null) { +this.resourceBundles = new java.util.Vector (5); +}if (!this.resourceBundles.contains (bundleName)) { +this.resourceBundles.add (bundleName); +this.resourceCache.clear (); +}}, "~S"); +Clazz_defineMethod (c$, "removeResourceBundle", +function (bundleName) { +if (this.resourceBundles != null) { +this.resourceBundles.remove (bundleName); +}this.resourceCache.clear (); +}, "~S"); +Clazz_defineMethod (c$, "setDefaultLocale", +function (l) { +this.defaultLocale = l; +}, "java.util.Locale"); +Clazz_defineMethod (c$, "getDefaultLocale", +function () { +return this.defaultLocale; +}); +Clazz_declareInterface (javax.swing.UIDefaults, "LazyValue"); +Clazz_declareInterface (javax.swing.UIDefaults, "ActiveValue"); +c$.PENDING = c$.prototype.PENDING = String.instantialize ("Pending"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (null, "javax.swing.LookAndFeel", ["javax.swing.JPasswordField", "$.UIManager", "javax.swing.plaf.UIResource", "jssun.swing.DefaultLayoutStyle", "swingjs.JSToolkit"], function () { +c$ = Clazz_declareType (javax.swing, "LookAndFeel"); +c$.installColors = Clazz_defineMethod (c$, "installColors", +function (c, defaultBgName, defaultFgName) { +var bg = c.getBackground (); +if (bg == null || Clazz_instanceOf (bg, javax.swing.plaf.UIResource)) c.setBackground (javax.swing.UIManager.getColor (defaultBgName)); +var fg = c.getForeground (); +if (fg == null || Clazz_instanceOf (fg, javax.swing.plaf.UIResource)) c.setForeground (javax.swing.UIManager.getColor (defaultFgName)); +}, "javax.swing.JComponent,~S,~S"); +c$.installColorsAndFont = Clazz_defineMethod (c$, "installColorsAndFont", +function (c, defaultBgName, defaultFgName, defaultFontName) { +var f = c.getFont (); +if (f == null || Clazz_instanceOf (f, javax.swing.plaf.UIResource)) { +c.setFont (javax.swing.UIManager.getFont (defaultFontName)); +}javax.swing.LookAndFeel.installColors (c, defaultBgName, defaultFgName); +}, "javax.swing.JComponent,~S,~S,~S"); +c$.installBorder = Clazz_defineMethod (c$, "installBorder", +function (c, defaultBorderName) { +swingjs.JSToolkit.notImplemented (null); +}, "javax.swing.JComponent,~S"); +c$.uninstallBorder = Clazz_defineMethod (c$, "uninstallBorder", +function (c) { +swingjs.JSToolkit.notImplemented (null); +}, "javax.swing.JComponent"); +c$.installProperty = Clazz_defineMethod (c$, "installProperty", +function (c, propertyName, propertyValue) { +if (Clazz_instanceOf (c, javax.swing.JPasswordField)) { +if (!(c).customSetUIProperty (propertyName, propertyValue)) { +c.setUIProperty (propertyName, propertyValue); +}} else { +c.setUIProperty (propertyName, propertyValue); +}}, "javax.swing.JComponent,~S,~O"); +c$.makeKeyBindings = Clazz_defineMethod (c$, "makeKeyBindings", +function (keyBindingList) { +swingjs.JSToolkit.notImplemented (null); +return null; +}, "~A"); +c$.makeInputMap = Clazz_defineMethod (c$, "makeInputMap", +function (keys) { +swingjs.JSToolkit.notImplemented (null); +return null; +}, "~A"); +c$.makeComponentInputMap = Clazz_defineMethod (c$, "makeComponentInputMap", +function (c, keys) { +swingjs.JSToolkit.notImplemented (null); +return null; +}, "javax.swing.JComponent,~A"); +c$.loadKeyBindings = Clazz_defineMethod (c$, "loadKeyBindings", +function (retMap, keys) { +swingjs.JSToolkit.notImplemented (null); +}, "javax.swing.InputMap,~A"); +c$.makeIcon = Clazz_defineMethod (c$, "makeIcon", +function (baseClass, gifFile) { +swingjs.JSToolkit.notImplemented (null); +return null; +}, "Class,~S"); +Clazz_defineMethod (c$, "getLayoutStyle", +function () { +return jssun.swing.DefaultLayoutStyle.getInstance (); +}); +Clazz_defineMethod (c$, "provideErrorFeedback", +function (component) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.Component"); +c$.getDesktopPropertyValue = Clazz_defineMethod (c$, "getDesktopPropertyValue", +function (systemPropertyName, fallbackValue) { +swingjs.JSToolkit.notImplemented (null); +return fallbackValue; +}, "~S,~O"); +Clazz_defineMethod (c$, "getDisabledIcon", +function (component, icon) { +swingjs.JSToolkit.notImplemented (null); +return null; +}, "javax.swing.JComponent,javax.swing.Icon"); +Clazz_defineMethod (c$, "getDisabledSelectedIcon", +function (component, icon) { +return this.getDisabledIcon (component, icon); +}, "javax.swing.JComponent,javax.swing.Icon"); +Clazz_defineMethod (c$, "getSupportsWindowDecorations", +function () { +return false; +}); +Clazz_defineMethod (c$, "initialize", +function () { +}); +Clazz_defineMethod (c$, "uninitialize", +function () { +}); +Clazz_defineMethod (c$, "getDefaults", +function () { +return null; +}); +Clazz_overrideMethod (c$, "toString", +function () { +return "[" + this.getDescription () + " - " + this.getClass ().getName () + "]"; +}); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.lang.Enum"], "javax.swing.DropMode", null, function () { +c$ = Clazz_declareType (javax.swing, "DropMode", Enum); +Clazz_defineEnumConstant (c$, "USE_SELECTION", 0, []); +Clazz_defineEnumConstant (c$, "ON", 1, []); +Clazz_defineEnumConstant (c$, "INSERT", 2, []); +Clazz_defineEnumConstant (c$, "INSERT_ROWS", 3, []); +Clazz_defineEnumConstant (c$, "INSERT_COLS", 4, []); +Clazz_defineEnumConstant (c$, "ON_OR_INSERT", 5, []); +Clazz_defineEnumConstant (c$, "ON_OR_INSERT_ROWS", 6, []); +Clazz_defineEnumConstant (c$, "ON_OR_INSERT_COLS", 7, []); +}); +Clazz_declarePackage ("java.awt.font"); +Clazz_load (null, "java.awt.font.FontRenderContext", ["java.awt.RenderingHints", "java.awt.geom.AffineTransform"], function () { +c$ = Clazz_decorateAsClass (function () { +this.tx = null; +this.aaHintValue = null; +this.fmHintValue = null; +this.defaulting = false; +Clazz_instantialize (this, arguments); +}, java.awt.font, "FontRenderContext"); +Clazz_makeConstructor (c$, +function () { +this.defaulting = true; +}); +Clazz_makeConstructor (c$, +function (tx, isAntiAliased, usesFractionalMetrics) { +if (tx != null && !tx.isIdentity ()) { +this.tx = new java.awt.geom.AffineTransform (tx); +}}, "java.awt.geom.AffineTransform,~B,~B"); +Clazz_makeConstructor (c$, +function (tx, aaHint, fmHint) { +if (tx != null && !tx.isIdentity ()) { +this.tx = new java.awt.geom.AffineTransform (tx); +}this.aaHintValue = aaHint; +this.fmHintValue = fmHint; +}, "java.awt.geom.AffineTransform,~O,~O"); +Clazz_defineMethod (c$, "isTransformed", +function () { +if (!this.defaulting) { +return this.tx != null; +} else { +return !this.getTransform ().isIdentity (); +}}); +Clazz_defineMethod (c$, "getTransformType", +function () { +if (!this.defaulting) { +if (this.tx == null) { +return 0; +} else { +return this.tx.getType (); +}} else { +return this.getTransform ().getType (); +}}); +Clazz_defineMethod (c$, "getTransform", +function () { +return (this.tx == null) ? new java.awt.geom.AffineTransform () : new java.awt.geom.AffineTransform (this.tx); +}); +Clazz_defineMethod (c$, "isAntiAliased", +function () { +return !(this.aaHintValue === java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF || this.aaHintValue === java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT); +}); +Clazz_defineMethod (c$, "usesFractionalMetrics", +function () { +return !(this.fmHintValue === java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_OFF || this.fmHintValue === java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT); +}); +Clazz_defineMethod (c$, "getAntiAliasingHint", +function () { +if (this.defaulting) { +if (this.isAntiAliased ()) { +return java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_ON; +} else { +return java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF; +}}return this.aaHintValue; +}); +Clazz_defineMethod (c$, "getFractionalMetricsHint", +function () { +if (this.defaulting) { +if (this.usesFractionalMetrics ()) { +return java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_ON; +} else { +return java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_OFF; +}}return this.fmHintValue; +}); +Clazz_defineMethod (c$, "equals", +function (obj) { +try { +return this.equals (obj); +} catch (e) { +if (Clazz_exceptionOf (e, ClassCastException)) { +return false; +} else { +throw e; +} +} +}, "~O"); +Clazz_defineMethod (c$, "equals", +function (rhs) { +if (this === rhs) { +return true; +}if (rhs == null) { +return false; +}if (!rhs.defaulting && !this.defaulting) { +if (rhs.aaHintValue === this.aaHintValue && rhs.fmHintValue === this.fmHintValue) { +return this.tx == null ? rhs.tx == null : this.tx.equals (rhs.tx); +}return false; +} else { +return rhs.getAntiAliasingHint () === this.getAntiAliasingHint () && rhs.getFractionalMetricsHint () === this.getFractionalMetricsHint () && rhs.getTransform ().equals (this.getTransform ()); +}}, "java.awt.font.FontRenderContext"); +Clazz_defineMethod (c$, "hashCode", +function () { +var hash = this.tx == null ? 0 : this.tx.hashCode (); +if (this.defaulting) { +hash += this.getAntiAliasingHint ().hashCode (); +hash += this.getFractionalMetricsHint ().hashCode (); +} else { +hash += this.aaHintValue.hashCode (); +hash += this.fmHintValue.hashCode (); +}return hash; +}); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.AWTEvent"], "java.awt.event.InputMethodEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.when = 0; +this.text = null; +this.committedCharacterCount = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "InputMethodEvent", java.awt.AWTEvent); +Clazz_defineMethod (c$, "getText", +function () { +return this.text; +}); +Clazz_defineMethod (c$, "getCommittedCharacterCount", +function () { +return this.committedCharacterCount; +}); +Clazz_defineMethod (c$, "getWhen", +function () { +return this.when; +}); +Clazz_defineStatics (c$, +"INPUT_METHOD_FIRST", 1100, +"INPUT_METHOD_TEXT_CHANGED", 1100, +"CARET_POSITION_CHANGED", 1101, +"INPUT_METHOD_LAST", 1101); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.event.ComponentAdapter", "javax.swing.JComponent"], "javax.swing.JViewport", ["java.lang.IllegalArgumentException", "java.applet.Applet", "java.awt.Dimension", "$.Insets", "$.Point", "$.Rectangle", "$.Window", "javax.swing.CellRendererPane", "$.RepaintManager", "$.SwingUtilities", "$.UIManager", "$.ViewportLayout", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.isViewSizeSet = false; +this.lastPaintPosition = null; +this.backingStore = false; +this.backingStoreImage = null; +this.scrollUnderway = false; +this.viewListener = null; +this.changeEvent = null; +this.scrollMode = 1; +this.repaintAll = false; +this.waitingForRepaint = false; +this.inBlitPaint = false; +this.hasHadValidView = false; +if (!Clazz_isClassDefined ("javax.swing.JViewport.ViewListener")) { +javax.swing.JViewport.$JViewport$ViewListener$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "JViewport", javax.swing.JComponent); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JViewport); +this.setLayout (this.createLayoutManager ()); +this.setOpaque (true); +this.updateUI (); +this.setInheritsPopupMenu (true); +}); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "ViewportUI"; +}); +Clazz_overrideMethod (c$, "addImpl", +function (child, constraints, index) { +this.setView (child); +return child; +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "remove", +function (child) { +child.removeComponentListener (this.viewListener); +this.removeChild (child); +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "scrollRectToVisible", +function (contentRect) { +var view = this.getView (); +if (view == null) { +return; +} else { +if (!view.isValid ()) { +this.validateView (); +}var dx = 0; +var dy = 0; +dx = this.positionAdjustment (this.getWidth (), contentRect.width, contentRect.x); +dy = this.positionAdjustment (this.getHeight (), contentRect.height, contentRect.y); +if (dx != 0 || dy != 0) { +var viewPosition = this.getViewPosition (); +var viewSize = view.getSize (); +var startX = viewPosition.x; +var startY = viewPosition.y; +var extent = this.getExtentSize (); +viewPosition.x -= dx; +viewPosition.y -= dy; +if (view.isValid ()) { +if (this.getParent ().getComponentOrientation ().isLeftToRight ()) { +if (viewPosition.x + extent.width > viewSize.width) { +viewPosition.x = Math.max (0, viewSize.width - extent.width); +} else if (viewPosition.x < 0) { +viewPosition.x = 0; +}} else { +if (extent.width > viewSize.width) { +viewPosition.x = viewSize.width - extent.width; +} else { +viewPosition.x = Math.max (0, Math.min (viewSize.width - extent.width, viewPosition.x)); +}}if (viewPosition.y + extent.height > viewSize.height) { +viewPosition.y = Math.max (0, viewSize.height - extent.height); +} else if (viewPosition.y < 0) { +viewPosition.y = 0; +}}if (viewPosition.x != startX || viewPosition.y != startY) { +this.setViewPosition (viewPosition); +this.scrollUnderway = false; +}}}}, "java.awt.Rectangle"); +Clazz_defineMethod (c$, "validateView", + function () { +var validateRoot = null; +for (var c = this; c != null; c = c.getParent ()) { +if ((Clazz_instanceOf (c, javax.swing.CellRendererPane)) || !c.isLightweight ()) { +return; +}if ((Clazz_instanceOf (c, javax.swing.JComponent)) && ((c).isValidateRoot ())) { +validateRoot = c; +break; +}} +if (validateRoot == null) { +return; +}var root = null; +for (var c = validateRoot; c != null; c = c.getParent ()) { +if (!c.isLightweight ()) { +return; +}if ((Clazz_instanceOf (c, java.awt.Window)) || (Clazz_instanceOf (c, java.applet.Applet))) { +root = c; +break; +}} +if (root == null) { +return; +}validateRoot.validate (); +var rm = javax.swing.RepaintManager.currentManager (this); +if (rm != null) { +rm.removeInvalidComponent (validateRoot); +}}); +Clazz_defineMethod (c$, "positionAdjustment", + function (parentWidth, childWidth, childAt) { +if (childAt >= 0 && childWidth + childAt <= parentWidth) { +return 0; +}if (childAt <= 0 && childWidth + childAt >= parentWidth) { +return 0; +}if (childAt > 0 && childWidth <= parentWidth) { +return -childAt + parentWidth - childWidth; +}if (childAt >= 0 && childWidth >= parentWidth) { +return -childAt; +}if (childAt <= 0 && childWidth <= parentWidth) { +return -childAt; +}if (childAt < 0 && childWidth >= parentWidth) { +return -childAt + parentWidth - childWidth; +}return 0; +}, "~N,~N,~N"); +Clazz_overrideMethod (c$, "setBorder", +function (border) { +if (border != null) { +throw new IllegalArgumentException ("JViewport.setBorder() not supported"); +}}, "javax.swing.border.Border"); +Clazz_defineMethod (c$, "getInsets", +function () { +return new java.awt.Insets (0, 0, 0, 0); +}); +Clazz_defineMethod (c$, "getInsets", +function (insets) { +insets.left = insets.top = insets.right = insets.bottom = 0; +return insets; +}, "java.awt.Insets"); +Clazz_defineMethod (c$, "getBackingStoreGraphics", + function (g) { +var bsg = this.backingStoreImage.getGraphics (); +bsg.setColor (g.getColor ()); +bsg.setFont (g.getFont ()); +bsg.setClip (g.getClipBounds ()); +return bsg; +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintViaBackingStore", + function (g) { +var bsg = this.getBackingStoreGraphics (g); +try { +Clazz_superCall (this, javax.swing.JViewport, "paint", [bsg]); +g.drawImage (this.backingStoreImage, 0, 0, this); +} finally { +bsg.dispose (); +} +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "paintViaBackingStore", + function (g, oClip) { +var bsg = this.getBackingStoreGraphics (g); +try { +Clazz_superCall (this, javax.swing.JViewport, "paint", [bsg]); +g.setClip (oClip); +g.drawImage (this.backingStoreImage, 0, 0, this); +} finally { +bsg.dispose (); +} +}, "java.awt.Graphics,java.awt.Rectangle"); +Clazz_defineMethod (c$, "isOptimizedDrawingEnabled", +function () { +return false; +}); +Clazz_overrideMethod (c$, "isPaintingOrigin", +function () { +if (this.scrollMode == 2) { +return true; +}return false; +}); +Clazz_defineMethod (c$, "getViewLocation", + function () { +var view = this.getView (); +if (view != null) { +return view.getLocation (); +} else { +return new java.awt.Point (0, 0); +}}); +Clazz_defineMethod (c$, "paint", +function (g) { +var width = this.getWidth (); +var height = this.getHeight (); +if ((width <= 0) || (height <= 0)) { +return; +}if (this.inBlitPaint) { +Clazz_superCall (this, javax.swing.JViewport, "paint", [g]); +return; +}if (this.repaintAll) { +this.repaintAll = false; +var clipB = g.getClipBounds (); +} else if (this.waitingForRepaint) { +var clipB = g.getClipBounds (); +if (clipB.width >= this.getWidth () && clipB.height >= this.getHeight ()) { +this.waitingForRepaint = false; +}}if (!this.backingStore || this.isBlitting () || this.getView () == null) { +Clazz_superCall (this, javax.swing.JViewport, "paint", [g]); +this.lastPaintPosition = this.getViewLocation (); +return; +}var viewBounds = this.getView ().getBounds (); +if (!this.isOpaque ()) { +g.clipRect (0, 0, viewBounds.width, viewBounds.height); +}if (this.backingStoreImage == null) { +this.backingStoreImage = this.createImage (width, height); +var clip = g.getClipBounds (); +if (clip.width != width || clip.height != height) { +if (!this.isOpaque ()) { +g.setClip (0, 0, Math.min (viewBounds.width, width), Math.min (viewBounds.height, height)); +} else { +g.setClip (0, 0, width, height); +}this.paintViaBackingStore (g, clip); +} else { +this.paintViaBackingStore (g); +}} else { +if (!this.scrollUnderway || this.lastPaintPosition.equals (this.getViewLocation ())) { +this.paintViaBackingStore (g); +} else { +var blitFrom = new java.awt.Point (); +var blitTo = new java.awt.Point (); +var blitSize = new java.awt.Dimension (); +var blitPaint = new java.awt.Rectangle (); +var newLocation = this.getViewLocation (); +var dx = newLocation.x - this.lastPaintPosition.x; +var dy = newLocation.y - this.lastPaintPosition.y; +var canBlit = this.computeBlit (dx, dy, blitFrom, blitTo, blitSize, blitPaint); +if (!canBlit) { +this.paintViaBackingStore (g); +} else { +var bdx = blitTo.x - blitFrom.x; +var bdy = blitTo.y - blitFrom.y; +var clip = g.getClipBounds (); +g.setClip (0, 0, width, height); +var bsg = this.getBackingStoreGraphics (g); +try { +bsg.copyArea (blitFrom.x, blitFrom.y, blitSize.width, blitSize.height, bdx, bdy); +g.setClip (clip.x, clip.y, clip.width, clip.height); +var r = viewBounds.intersection (blitPaint); +bsg.setClip (r); +Clazz_superCall (this, javax.swing.JViewport, "paint", [bsg]); +g.drawImage (this.backingStoreImage, 0, 0, this); +} finally { +bsg.dispose (); +} +}}}this.lastPaintPosition = this.getViewLocation (); +this.scrollUnderway = false; +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "reshape", +function (x, y, w, h) { +var sizeChanged = (this.getWidth () != w) || (this.getHeight () != h); +if (sizeChanged) { +this.backingStoreImage = null; +}Clazz_superCall (this, javax.swing.JViewport, "reshape", [x, y, w, h]); +if (sizeChanged) { +this.fireStateChanged (); +}}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setScrollMode", +function (mode) { +this.scrollMode = mode; +if (mode == 2) { +this.backingStore = true; +} else { +this.backingStore = false; +}}, "~N"); +Clazz_defineMethod (c$, "getScrollMode", +function () { +return this.scrollMode; +}); +Clazz_defineMethod (c$, "isBackingStoreEnabled", +function () { +return this.scrollMode == 2; +}); +Clazz_defineMethod (c$, "setBackingStoreEnabled", +function (enabled) { +if (enabled) { +this.setScrollMode (2); +} else { +this.setScrollMode (1); +}}, "~B"); +Clazz_defineMethod (c$, "isBlitting", + function () { +var view = this.getView (); +return (this.scrollMode == 1) && (Clazz_instanceOf (view, javax.swing.JComponent)) && (view).isOpaque (); +}); +Clazz_defineMethod (c$, "getView", +function () { +return (this.getComponentCount () > 0) ? this.getComponent (0) : null; +}); +Clazz_defineMethod (c$, "setView", +function (view) { +var n = this.getComponentCount (); +for (var i = n - 1; i >= 0; i--) { +this.remove (this.getComponent (i)); +} +this.isViewSizeSet = false; +if (view != null) { +this.addImplSAEM (view, null, -1); +this.viewListener = this.createViewListener (); +view.addComponentListener (this.viewListener); +}if (this.hasHadValidView) { +this.fireStateChanged (); +} else if (view != null) { +this.hasHadValidView = true; +}this.revalidate (); +this.repaint (); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getViewSize", +function () { +var view = this.getView (); +if (view == null) { +return new java.awt.Dimension (0, 0); +} else if (this.isViewSizeSet) { +return view.getSize (); +} else { +return view.getPreferredSize (); +}}); +Clazz_defineMethod (c$, "setViewSize", +function (newSize) { +var view = this.getView (); +if (view != null) { +var oldSize = view.getSize (); +if (!newSize.equals (oldSize)) { +this.scrollUnderway = false; +view.setSize (newSize); +this.isViewSizeSet = true; +this.fireStateChanged (); +}}}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "getViewPosition", +function () { +var view = this.getView (); +if (view != null) { +var p = view.getLocation (); +p.x = -p.x; +p.y = -p.y; +return p; +} else { +return new java.awt.Point (0, 0); +}}); +Clazz_defineMethod (c$, "setViewPosition", +function (p) { +var view = this.getView (); +if (view == null) { +return; +}var oldX; +var oldY; +var x = p.x; +var y = p.y; +if (Clazz_instanceOf (view, javax.swing.JComponent)) { +var c = view; +oldX = c.getX (); +oldY = c.getY (); +} else { +var r = view.getBounds (); +oldX = r.x; +oldY = r.y; +}var newX = -x; +var newY = -y; +if ((oldX != newX) || (oldY != newY)) { +if (!this.waitingForRepaint && this.isBlitting () && this.canUseWindowBlitter ()) { +var rm = javax.swing.RepaintManager.currentManager (this); +var jview = view; +var dirty = rm.getDirtyRegion (jview); +if (dirty == null || !dirty.contains (jview.getVisibleRect ())) { +rm.beginPaint (); +try { +var g = javax.swing.JComponent.safelyGetGraphics (this, javax.swing.SwingUtilities.getRoot (this)); +this.flushViewDirtyRegion (g, dirty); +view.setLocation (newX, newY); +g.setClip (0, 0, this.getWidth (), Math.min (this.getHeight (), jview.getHeight ())); +this.repaintAll = (this.windowBlitPaint (g) && this.needsRepaintAfterBlit ()); +g.dispose (); +rm.markCompletelyClean (this.getParent ()); +rm.markCompletelyClean (this); +rm.markCompletelyClean (jview); +} finally { +rm.endPaint (); +} +} else { +view.setLocation (newX, newY); +this.repaintAll = false; +}} else { +this.scrollUnderway = true; +view.setLocation (newX, newY); +this.repaintAll = false; +}this.fireStateChanged (); +}}, "java.awt.Point"); +Clazz_defineMethod (c$, "getViewRect", +function () { +return new java.awt.Rectangle (this.getViewPosition (), this.getExtentSize ()); +}); +Clazz_defineMethod (c$, "computeBlit", +function (dx, dy, blitFrom, blitTo, blitSize, blitPaint) { +var dxAbs = Math.abs (dx); +var dyAbs = Math.abs (dy); +var extentSize = this.getExtentSize (); +if ((dx == 0) && (dy != 0) && (dyAbs < extentSize.height)) { +if (dy < 0) { +blitFrom.y = -dy; +blitTo.y = 0; +blitPaint.y = extentSize.height + dy; +} else { +blitFrom.y = 0; +blitTo.y = dy; +blitPaint.y = 0; +}blitPaint.x = blitFrom.x = blitTo.x = 0; +blitSize.width = extentSize.width; +blitSize.height = extentSize.height - dyAbs; +blitPaint.width = extentSize.width; +blitPaint.height = dyAbs; +return true; +} else if ((dy == 0) && (dx != 0) && (dxAbs < extentSize.width)) { +if (dx < 0) { +blitFrom.x = -dx; +blitTo.x = 0; +blitPaint.x = extentSize.width + dx; +} else { +blitFrom.x = 0; +blitTo.x = dx; +blitPaint.x = 0; +}blitPaint.y = blitFrom.y = blitTo.y = 0; +blitSize.width = extentSize.width - dxAbs; +blitSize.height = extentSize.height; +blitPaint.width = dxAbs; +blitPaint.height = extentSize.height; +return true; +} else { +return false; +}}, "~N,~N,java.awt.Point,java.awt.Point,java.awt.Dimension,java.awt.Rectangle"); +Clazz_defineMethod (c$, "getExtentSize", +function () { +return this.getSize (); +}); +Clazz_defineMethod (c$, "toViewCoordinates", +function (size) { +return new java.awt.Dimension (size); +}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "toViewCoordinates", +function (p) { +return new java.awt.Point (p); +}, "java.awt.Point"); +Clazz_defineMethod (c$, "setExtentSize", +function (newExtent) { +var oldExtent = this.getExtentSize (); +if (!newExtent.equals (oldExtent)) { +this.setSize (newExtent); +this.fireStateChanged (); +}}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "createViewListener", +function () { +return Clazz_innerTypeInstance (javax.swing.JViewport.ViewListener, this, null); +}); +Clazz_defineMethod (c$, "createLayoutManager", +function () { +return javax.swing.ViewportLayout.SHARED_INSTANCE; +}); +Clazz_defineMethod (c$, "addChangeListener", +function (l) { +this.listenerList.add (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "removeChangeListener", +function (l) { +this.listenerList.remove (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "getChangeListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.ChangeListener); +}); +Clazz_defineMethod (c$, "fireStateChanged", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.ChangeListener) { +if (this.changeEvent == null) { +this.changeEvent = new javax.swing.event.ChangeEvent (this); +}(listeners[i + 1]).stateChanged (this.changeEvent); +}} +}); +Clazz_defineMethod (c$, "repaint", +function (tm, x, y, w, h) { +var parent = this.getParent (); +if (parent != null) parent.repaint (tm, x + this.getX (), y + this.getY (), w, h); + else Clazz_superCall (this, javax.swing.JViewport, "repaint", [tm, x, y, w, h]); +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paramString", +function () { +var isViewSizeSetString = (this.isViewSizeSet ? "true" : "false"); +var lastPaintPositionString = (this.lastPaintPosition != null ? this.lastPaintPosition.toString () : ""); +var scrollUnderwayString = (this.scrollUnderway ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JViewport, "paramString", []) + ",isViewSizeSet=" + isViewSizeSetString + ",lastPaintPosition=" + lastPaintPositionString + ",scrollUnderway=" + scrollUnderwayString; +}); +Clazz_defineMethod (c$, "firePropertyChangeObject", +function (propertyName, oldValue, newValue) { +Clazz_superCall (this, javax.swing.JViewport, "firePropertyChangeObject", [propertyName, oldValue, newValue]); +if (propertyName.equals (javax.swing.JViewport.EnableWindowBlit)) { +if (newValue != null) { +this.setScrollMode (1); +} else { +this.setScrollMode (0); +}}}, "~S,~O,~O"); +Clazz_defineMethod (c$, "needsRepaintAfterBlit", + function () { +var heavyParent = this.getParent (); +while (heavyParent != null && heavyParent.isLightweight ()) { +heavyParent = heavyParent.getParent (); +} +if (heavyParent != null) { +}return true; +}); +Clazz_defineMethod (c$, "flushViewDirtyRegion", + function (g, dirty) { +var view = this.getView (); +if (dirty != null && dirty.width > 0 && dirty.height > 0) { +dirty.x += view.getX (); +dirty.y += view.getY (); +var clip = g.getClipBounds (); +if (clip == null) { +g.setClip (0, 0, this.getWidth (), this.getHeight ()); +}g.clipRect (dirty.x, dirty.y, dirty.width, dirty.height); +clip = g.getClipBounds (); +if (clip.width > 0 && clip.height > 0) { +this.paintView (g); +}}}, "java.awt.Graphics,java.awt.Rectangle"); +Clazz_defineMethod (c$, "windowBlitPaint", + function (g) { +var width = this.getWidth (); +var height = this.getHeight (); +if ((width == 0) || (height == 0)) { +return false; +}var retValue; +var rm = javax.swing.RepaintManager.currentManager (this); +var view = this.getView (); +if (this.lastPaintPosition == null || this.lastPaintPosition.equals (this.getViewLocation ())) { +this.paintView (g); +retValue = false; +} else { +var blitFrom = new java.awt.Point (); +var blitTo = new java.awt.Point (); +var blitSize = new java.awt.Dimension (); +var blitPaint = new java.awt.Rectangle (); +var newLocation = this.getViewLocation (); +var dx = newLocation.x - this.lastPaintPosition.x; +var dy = newLocation.y - this.lastPaintPosition.y; +var canBlit = this.computeBlit (dx, dy, blitFrom, blitTo, blitSize, blitPaint); +if (!canBlit) { +this.paintView (g); +retValue = false; +} else { +var r = view.getBounds ().intersection (blitPaint); +r.x -= view.getX (); +r.y -= view.getY (); +this.blitDoubleBuffered (view, g, r.x, r.y, r.width, r.height, blitFrom.x, blitFrom.y, blitTo.x, blitTo.y, blitSize.width, blitSize.height); +retValue = true; +}}this.lastPaintPosition = this.getViewLocation (); +return retValue; +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "blitDoubleBuffered", + function (view, g, clipX, clipY, clipW, clipH, blitFromX, blitFromY, blitToX, blitToY, blitW, blitH) { +var rm = javax.swing.RepaintManager.currentManager (this); +var bdx = blitToX - blitFromX; +var bdy = blitToY - blitFromY; +var x = view.getX (); +var y = view.getY (); +g.translate (x, y); +g.setClip (clipX, clipY, clipW, clipH); +view.paintForceDoubleBuffered (g); +g.translate (-x, -y); +}, "javax.swing.JComponent,java.awt.Graphics,~N,~N,~N,~N,~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paintView", + function (g) { +var clip = g.getClipBounds (); +var view = this.getView (); +if (view.getWidth () >= this.getWidth ()) { +var x = view.getX (); +var y = view.getY (); +g.translate (x, y); +g.setClip (clip.x - x, clip.y - y, clip.width, clip.height); +view.paintForceDoubleBuffered (g); +g.translate (-x, -y); +g.setClip (clip.x, clip.y, clip.width, clip.height); +} else { +try { +this.inBlitPaint = true; +this.paintForceDoubleBuffered (g); +} finally { +this.inBlitPaint = false; +} +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "canUseWindowBlitter", + function () { +if (!this.isShowing () || (!(Clazz_instanceOf (this.getParent (), javax.swing.JComponent)) && !(Clazz_instanceOf (this.getView (), javax.swing.JComponent)))) { +return false; +}if (this.isPainting ()) { +return false; +}var dirtyRegion = javax.swing.RepaintManager.currentManager (this).getDirtyRegion (this.getParent ()); +if (dirtyRegion != null && dirtyRegion.width > 0 && dirtyRegion.height > 0) { +return false; +}var clip = new java.awt.Rectangle (0, 0, this.getWidth (), this.getHeight ()); +var oldClip = new java.awt.Rectangle (); +var tmp2 = null; +var parent; +var lastParent = null; +var x; +var y; +var w; +var h; +for (parent = this; parent != null && javax.swing.JComponent.isLightweightComponent (parent); parent = parent.getParent ()) { +x = parent.getX (); +y = parent.getY (); +w = parent.getWidth (); +h = parent.getHeight (); +oldClip.setBounds (clip); +javax.swing.SwingUtilities.computeIntersection (0, 0, w, h, clip); +if (!clip.equals (oldClip)) return false; +if (lastParent != null && Clazz_instanceOf (parent, javax.swing.JComponent) && !(parent).isOptimizedDrawingEnabled ()) { +var comps = parent.getComponents (); +var index = 0; +for (var i = comps.length - 1; i >= 0; i--) { +if (comps[i] === lastParent) { +index = i - 1; +break; +}} +while (index >= 0) { +tmp2 = comps[index].getBounds (tmp2); +if (tmp2.intersects (clip)) return false; +index--; +} +}clip.x += x; +clip.y += y; +lastParent = parent; +} +if (parent == null) { +return false; +}return true; +}); +c$.$JViewport$ViewListener$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +Clazz_instantialize (this, arguments); +}, javax.swing.JViewport, "ViewListener", java.awt.event.ComponentAdapter); +Clazz_overrideMethod (c$, "componentResized", +function (a) { +this.b$["javax.swing.JViewport"].fireStateChanged (); +this.b$["javax.swing.JViewport"].revalidate (); +}, "java.awt.event.ComponentEvent"); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"$uiClassID", "ViewportUI", +"EnableWindowBlit", "EnableWindowBlit", +"BLIT_SCROLL_MODE", 1, +"BACKINGSTORE_SCROLL_MODE", 2, +"SIMPLE_SCROLL_MODE", 0); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.ComponentListener"], "java.awt.event.ComponentAdapter", null, function () { +c$ = Clazz_declareType (java.awt.event, "ComponentAdapter", null, java.awt.event.ComponentListener); +Clazz_overrideMethod (c$, "componentResized", +function (e) { +}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "componentMoved", +function (e) { +}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "componentShown", +function (e) { +}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "componentHidden", +function (e) { +}, "java.awt.event.ComponentEvent"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Container"], "javax.swing.CellRendererPane", null, function () { +c$ = Clazz_declareType (javax.swing, "CellRendererPane", java.awt.Container); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.CellRendererPane); +this.setLayout (null); +this.setVisible (false); +}); +Clazz_overrideMethod (c$, "invalidate", +function () { +}); +Clazz_overrideMethod (c$, "paint", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "update", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "addImpl", +function (x, constraints, index) { +if (x.getParent () === this) { +return null; +} else { +return this.addImplSAEM (x, constraints, index); +}}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "paintComponent", +function (g, c, p, x, y, w, h, shouldValidate) { +if (c == null) { +if (p != null) { +var oldColor = g.getColor (); +g.setColor (p.getBackground ()); +g.fillRect (x, y, w, h); +g.setColor (oldColor); +}return; +}if (c.getParent () !== this) { +this.add (c); +}c.setBounds (x, y, w, h); +if (shouldValidate) { +c.validate (); +}var cg = g.create4 (x, y, w, h); +try { +c.paint (cg); +} finally { +cg.dispose (); +} +c.setBounds (-w, -h, 0, 0); +}, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N,~B"); +Clazz_defineMethod (c$, "paintComponent", +function (g, c, p, x, y, w, h) { +this.paintComponent (g, c, p, x, y, w, h, false); +}, "java.awt.Graphics,java.awt.Component,java.awt.Container,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paintComponent", +function (g, c, p, r) { +this.paintComponent (g, c, p, r.x, r.y, r.width, r.height); +}, "java.awt.Graphics,java.awt.Component,java.awt.Container,java.awt.Rectangle"); +}); +Clazz_declarePackage ("jssun.awt"); +c$ = Clazz_declareType (jssun.awt, "AWTAccessor"); +c$.setWindowAccessor = Clazz_defineMethod (c$, "setWindowAccessor", +function (wa) { +jssun.awt.AWTAccessor.windowAccessor = wa; +}, "jssun.awt.AWTAccessor.WindowAccessor"); +c$.getWindowAccessor = Clazz_defineMethod (c$, "getWindowAccessor", +function () { +return jssun.awt.AWTAccessor.windowAccessor; +}); +c$.setComponentAccessor = Clazz_defineMethod (c$, "setComponentAccessor", +function (ca) { +jssun.awt.AWTAccessor.componentAccessor = ca; +}, "jssun.awt.AWTAccessor.ComponentAccessor"); +c$.getComponentAccessor = Clazz_defineMethod (c$, "getComponentAccessor", +function () { +return jssun.awt.AWTAccessor.componentAccessor; +}); +c$.setAWTEventAccessor = Clazz_defineMethod (c$, "setAWTEventAccessor", +function (aea) { +jssun.awt.AWTAccessor.awtEventAccessor = aea; +}, "jssun.awt.AWTAccessor.AWTEventAccessor"); +c$.getAWTEventAccessor = Clazz_defineMethod (c$, "getAWTEventAccessor", +function () { +return jssun.awt.AWTAccessor.awtEventAccessor; +}); +c$.setEventQueueAccessor = Clazz_defineMethod (c$, "setEventQueueAccessor", +function (eqa) { +jssun.awt.AWTAccessor.eventQueueAccessor = eqa; +}, "jssun.awt.AWTAccessor.EventQueueAccessor"); +c$.getEventQueueAccessor = Clazz_defineMethod (c$, "getEventQueueAccessor", +function () { +return jssun.awt.AWTAccessor.eventQueueAccessor; +}); +Clazz_declareInterface (jssun.awt.AWTAccessor, "WindowAccessor"); +Clazz_declareInterface (jssun.awt.AWTAccessor, "ComponentAccessor"); +Clazz_declareInterface (jssun.awt.AWTAccessor, "KeyboardFocusManagerAccessor"); +Clazz_declareInterface (jssun.awt.AWTAccessor, "AWTEventAccessor"); +Clazz_declareInterface (jssun.awt.AWTAccessor, "EventQueueAccessor"); +Clazz_declareInterface (jssun.awt.AWTAccessor, "CursorAccessor"); +Clazz_declareInterface (jssun.awt.AWTAccessor, "ClientPropertyKeyAccessor"); +Clazz_defineStatics (c$, +"componentAccessor", null, +"windowAccessor", null, +"awtEventAccessor", null, +"eventQueueAccessor", null); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.LayoutManager"], "javax.swing.ViewportLayout", ["java.awt.Dimension", "javax.swing.Scrollable"], function () { +c$ = Clazz_declareType (javax.swing, "ViewportLayout", null, java.awt.LayoutManager); +Clazz_overrideMethod (c$, "addLayoutComponent", +function (name, c) { +}, "~S,java.awt.Component"); +Clazz_overrideMethod (c$, "removeLayoutComponent", +function (c) { +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "preferredLayoutSize", +function (parent) { +var view = (parent).getView (); +if (view == null) { +return new java.awt.Dimension (0, 0); +} else if (Clazz_instanceOf (view, javax.swing.Scrollable)) { +return (view).getPreferredScrollableViewportSize (); +} else { +return view.getPreferredSize (); +}}, "java.awt.Container"); +Clazz_overrideMethod (c$, "minimumLayoutSize", +function (parent) { +return new java.awt.Dimension (4, 4); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "layoutContainer", +function (parent) { +var vp = parent; +var view = vp.getView (); +var scrollableView = null; +if (view == null) { +return; +} else if (Clazz_instanceOf (view, javax.swing.Scrollable)) { +scrollableView = view; +}var insets = vp.getInsets (); +var viewPrefSize = view.getPreferredSize (); +var vpSize = vp.getSize (); +var extentSize = vp.toViewCoordinates (vpSize); +var viewSize = new java.awt.Dimension (viewPrefSize); +if (scrollableView != null) { +if (scrollableView.getScrollableTracksViewportWidth ()) { +viewSize.width = vpSize.width; +}if (scrollableView.getScrollableTracksViewportHeight ()) { +viewSize.height = vpSize.height; +}}var viewPosition = vp.getViewPosition (); +if (scrollableView == null || vp.getParent () == null || vp.getParent ().getComponentOrientation ().isLeftToRight ()) { +if ((viewPosition.x + extentSize.width) > viewSize.width) { +viewPosition.x = Math.max (0, viewSize.width - extentSize.width); +}} else { +if (extentSize.width > viewSize.width) { +viewPosition.x = viewSize.width - extentSize.width; +} else { +viewPosition.x = Math.max (0, Math.min (viewSize.width - extentSize.width, viewPosition.x)); +}}if ((viewPosition.y + extentSize.height) > viewSize.height) { +viewPosition.y = Math.max (0, viewSize.height - extentSize.height); +}if (scrollableView == null) { +if ((viewPosition.x == 0) && (vpSize.width > viewPrefSize.width)) { +viewSize.width = vpSize.width; +}if ((viewPosition.y == 0) && (vpSize.height > viewPrefSize.height)) { +viewSize.height = vpSize.height; +}}vp.setViewPosition (viewPosition); +vp.setViewSize (viewSize); +}, "java.awt.Container"); +c$.SHARED_INSTANCE = c$.prototype.SHARED_INSTANCE = new javax.swing.ViewportLayout (); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.CaretListener", null, function () { +Clazz_declareInterface (javax.swing.event, "CaretListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.BoundedRangeModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultBoundedRangeModel", ["java.lang.IllegalArgumentException", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.changeEvent = null; +this.listenerList = null; +this.value = 0; +this.extent = 0; +this.min = 0; +this.max = 100; +this.isAdjusting = false; +Clazz_instantialize (this, arguments); +}, javax.swing, "DefaultBoundedRangeModel", null, javax.swing.BoundedRangeModel); +Clazz_prepareFields (c$, function () { +this.listenerList = new javax.swing.event.EventListenerList (); +}); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_makeConstructor (c$, +function (value, extent, min, max) { +if ((max >= min) && (value >= min) && ((value + extent) >= value) && ((value + extent) <= max)) { +this.value = value; +this.extent = extent; +this.min = min; +this.max = max; +} else { +throw new IllegalArgumentException ("invalid range properties"); +}}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getValue", +function () { +return this.value; +}); +Clazz_overrideMethod (c$, "getExtent", +function () { +return this.extent; +}); +Clazz_overrideMethod (c$, "getMinimum", +function () { +return this.min; +}); +Clazz_overrideMethod (c$, "getMaximum", +function () { +return this.max; +}); +Clazz_overrideMethod (c$, "setValue", +function (n) { +n = Math.min (n, 2147483647 - this.extent); +var newValue = Math.max (n, this.min); +if (newValue + this.extent > this.max) { +newValue = this.max - this.extent; +}this.setRangeProperties (newValue, this.extent, this.min, this.max, this.isAdjusting); +}, "~N"); +Clazz_overrideMethod (c$, "setExtent", +function (n) { +var newExtent = Math.max (0, n); +if (this.value + newExtent > this.max) { +newExtent = this.max - this.value; +}this.setRangeProperties (this.value, newExtent, this.min, this.max, this.isAdjusting); +}, "~N"); +Clazz_overrideMethod (c$, "setMinimum", +function (n) { +var newMax = Math.max (n, this.max); +var newValue = Math.max (n, this.value); +var newExtent = Math.min (newMax - newValue, this.extent); +this.setRangeProperties (newValue, newExtent, n, newMax, this.isAdjusting); +}, "~N"); +Clazz_overrideMethod (c$, "setMaximum", +function (n) { +var newMin = Math.min (n, this.min); +var newExtent = Math.min (n - newMin, this.extent); +var newValue = Math.min (n - newExtent, this.value); +this.setRangeProperties (newValue, newExtent, newMin, n, this.isAdjusting); +}, "~N"); +Clazz_overrideMethod (c$, "setValueIsAdjusting", +function (b) { +this.setRangeProperties (this.value, this.extent, this.min, this.max, b); +}, "~B"); +Clazz_overrideMethod (c$, "getValueIsAdjusting", +function () { +return this.isAdjusting; +}); +Clazz_overrideMethod (c$, "setRangeProperties", +function (newValue, newExtent, newMin, newMax, adjusting) { +if (newMin > newMax) { +newMin = newMax; +}if (newValue > newMax) { +newMax = newValue; +}if (newValue < newMin) { +newMin = newValue; +}if ((newExtent + newValue) > newMax) { +newExtent = newMax - newValue; +}if (newExtent < 0) { +newExtent = 0; +}var isChange = (newValue != this.value) || (newExtent != this.extent) || (newMin != this.min) || (newMax != this.max) || (adjusting != this.isAdjusting); +if (isChange) { +this.value = newValue; +this.extent = newExtent; +this.min = newMin; +this.max = newMax; +this.isAdjusting = adjusting; +this.fireStateChanged (); +}}, "~N,~N,~N,~N,~B"); +Clazz_overrideMethod (c$, "addChangeListener", +function (l) { +this.listenerList.add (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_overrideMethod (c$, "removeChangeListener", +function (l) { +this.listenerList.remove (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "getChangeListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.ChangeListener); +}); +Clazz_defineMethod (c$, "fireStateChanged", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.ChangeListener) { +if (this.changeEvent == null) { +this.changeEvent = new javax.swing.event.ChangeEvent (this); +}(listeners[i + 1]).stateChanged (this.changeEvent); +}} +}); +Clazz_overrideMethod (c$, "toString", +function () { +var modelString = "value=" + this.getValue () + ", " + "extent=" + this.getExtent () + ", " + "min=" + this.getMinimum () + ", " + "max=" + this.getMaximum () + ", " + "adj=" + this.getValueIsAdjusting (); +return this.getClass ().getName () + "[" + modelString + "]"; +}); +Clazz_defineMethod (c$, "getListeners", +function (listenerType) { +return this.listenerList.getListeners (listenerType); +}, "Class"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "BoundedRangeModel"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.AWTKeyStroke"], "javax.swing.KeyStroke", null, function () { +c$ = Clazz_declareType (javax.swing, "KeyStroke", java.awt.AWTKeyStroke); +c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", +function (keyChar) { +{ +java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); +return java.awt.AWTKeyStroke.getAWTKeyStroke (keyChar); +}}, "~S"); +c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", +function (keyChar, onKeyRelease) { +return new javax.swing.KeyStroke (keyChar, 0, 0, onKeyRelease); +}, "~S,~B"); +c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", +function (keyChar, modifiers) { +{ +java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); +return java.awt.AWTKeyStroke.getAWTKeyStroke (keyChar, modifiers); +}}, "Character,~N"); +c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", +function (keyCode, modifiers, onKeyRelease) { +{ +java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); +return java.awt.AWTKeyStroke.getAWTKeyStroke (keyCode, modifiers, onKeyRelease); +}}, "~N,~N,~B"); +c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", +function (keyCode, modifiers) { +{ +java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); +return java.awt.AWTKeyStroke.getAWTKeyStroke (keyCode, modifiers); +}}, "~N,~N"); +c$.getKeyStrokeForEvent = Clazz_defineMethod (c$, "getKeyStrokeForEvent", +function (anEvent) { +{ +java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); +return java.awt.AWTKeyStroke.getAWTKeyStrokeForEvent (anEvent); +}}, "java.awt.event.KeyEvent"); +c$.getKeyStroke = Clazz_defineMethod (c$, "getKeyStroke", +function (s) { +if (s == null || s.length == 0) { +return null; +}{ +java.awt.AWTKeyStroke.registerSubclass (javax.swing.KeyStroke); +try { +return java.awt.AWTKeyStroke.getAWTKeyStroke (s); +} catch (e) { +if (Clazz_exceptionOf (e, IllegalArgumentException)) { +return null; +} else { +throw e; +} +} +}}, "~S"); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (null, ["java.awt.AWTKeyStroke", "$.VKCollection"], ["java.io.ObjectStreamException", "java.lang.IllegalArgumentException", "$.StringBuilder", "java.util.Collections", "$.HashMap", "$.StringTokenizer", "java.awt.event.KeyEvent", "jssun.awt.AppContext"], function () { +c$ = Clazz_decorateAsClass (function () { +this.keyChar = '\uffff'; +this.keyCode = 0; +this.modifiers = 0; +this.onKeyRelease = false; +Clazz_instantialize (this, arguments); +}, java.awt, "AWTKeyStroke"); +c$.getAWTKeyStrokeClass = Clazz_defineMethod (c$, "getAWTKeyStrokeClass", + function () { +var clazz = jssun.awt.AppContext.getAppContext ().get (java.awt.AWTKeyStroke); +if (clazz == null) { +clazz = java.awt.AWTKeyStroke; +jssun.awt.AppContext.getAppContext ().put (java.awt.AWTKeyStroke, java.awt.AWTKeyStroke); +}return clazz; +}); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_makeConstructor (c$, +function (keyChar, keyCode, modifiers, onKeyRelease) { +this.keyChar = keyChar; +this.keyCode = keyCode; +this.modifiers = modifiers; +this.onKeyRelease = onKeyRelease; +}, "~S,~N,~N,~B"); +c$.registerSubclass = Clazz_defineMethod (c$, "registerSubclass", +function (subclass) { +}, "Class"); +c$.getCachedStroke = Clazz_defineMethod (c$, "getCachedStroke", + function (keyChar, keyCode, modifiers, onKeyRelease) { +return null; +}, "~S,~N,~N,~B"); +c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", +function (keyChar) { +return java.awt.AWTKeyStroke.getCachedStroke (keyChar, 0, 0, false); +}, "~S"); +c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", +function (keyChar, modifiers) { +if (keyChar == null) { +throw new IllegalArgumentException ("keyChar cannot be null"); +}return java.awt.AWTKeyStroke.getCachedStroke (keyChar.charValue (), 0, modifiers, false); +}, "Character,~N"); +c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", +function (keyCode, modifiers, onKeyRelease) { +return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', keyCode, modifiers, onKeyRelease); +}, "~N,~N,~B"); +c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", +function (keyCode, modifiers) { +return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', keyCode, modifiers, false); +}, "~N,~N"); +c$.getAWTKeyStrokeForEvent = Clazz_defineMethod (c$, "getAWTKeyStrokeForEvent", +function (anEvent) { +var id = anEvent.getID (); +switch (id) { +case 401: +case 402: +return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', anEvent.getKeyCode (), anEvent.getModifiers (), (id == 402)); +case 400: +return java.awt.AWTKeyStroke.getCachedStroke (anEvent.getKeyChar (), 0, anEvent.getModifiers (), false); +default: +return null; +} +}, "java.awt.event.KeyEvent"); +c$.getAWTKeyStroke = Clazz_defineMethod (c$, "getAWTKeyStroke", +function (s) { +if (s == null) { +throw new IllegalArgumentException ("String cannot be null"); +}var errmsg = "String formatted incorrectly"; +var st = new java.util.StringTokenizer (s, " "); +var mask = 0; +var released = false; +var typed = false; +var pressed = false; +{ +if (java.awt.AWTKeyStroke.modifierKeywords == null) { +var uninitializedMap = new java.util.HashMap (8, 1.0); +uninitializedMap.put ("shift", Integer.$valueOf (65)); +uninitializedMap.put ("control", Integer.$valueOf (130)); +uninitializedMap.put ("ctrl", Integer.$valueOf (130)); +uninitializedMap.put ("meta", Integer.$valueOf (260)); +uninitializedMap.put ("alt", Integer.$valueOf (520)); +uninitializedMap.put ("altGraph", Integer.$valueOf (8224)); +uninitializedMap.put ("button1", Integer.$valueOf (1024)); +uninitializedMap.put ("button2", Integer.$valueOf (2048)); +uninitializedMap.put ("button3", Integer.$valueOf (4096)); +java.awt.AWTKeyStroke.modifierKeywords = java.util.Collections.synchronizedMap (uninitializedMap); +}}var count = st.countTokens (); +for (var i = 1; i <= count; i++) { +var token = st.nextToken (); +if (typed) { +if (token.length != 1 || i != count) { +throw new IllegalArgumentException ("String formatted incorrectly"); +}return java.awt.AWTKeyStroke.getCachedStroke (token.charAt (0), 0, mask, false); +}if (pressed || released || i == count) { +if (i != count) { +throw new IllegalArgumentException ("String formatted incorrectly"); +}var keyCodeName = "VK_" + token; +var keyCode = java.awt.AWTKeyStroke.getVKValue (keyCodeName); +return java.awt.AWTKeyStroke.getCachedStroke ('\uffff', keyCode, mask, released); +}if (token.equals ("released")) { +released = true; +continue; +}if (token.equals ("pressed")) { +pressed = true; +continue; +}if (token.equals ("typed")) { +typed = true; +continue; +}var tokenMask = java.awt.AWTKeyStroke.modifierKeywords.get (token); +if (tokenMask != null) { +mask |= tokenMask.intValue (); +} else { +throw new IllegalArgumentException ("String formatted incorrectly"); +}} +throw new IllegalArgumentException ("String formatted incorrectly"); +}, "~S"); +c$.getVKCollection = Clazz_defineMethod (c$, "getVKCollection", + function () { +if (java.awt.AWTKeyStroke.vks == null) { +java.awt.AWTKeyStroke.vks = new java.awt.VKCollection (); +}return java.awt.AWTKeyStroke.vks; +}); +c$.getVKValue = Clazz_defineMethod (c$, "getVKValue", + function (key) { +var vkCollect = java.awt.AWTKeyStroke.getVKCollection (); +var value = vkCollect.findCode (key); +if (value == null) { +var keyCode = 0; +var errmsg = "String formatted incorrectly"; +try { +keyCode = java.awt.event.KeyEvent.getField (key).getInt (java.awt.event.KeyEvent); +} catch (e$$) { +if (Clazz_exceptionOf (e$$, NoSuchFieldException)) { +var nsfe = e$$; +{ +throw new IllegalArgumentException ("String formatted incorrectly"); +} +} else if (Clazz_exceptionOf (e$$, IllegalAccessException)) { +var iae = e$$; +{ +throw new IllegalArgumentException ("String formatted incorrectly"); +} +} else { +throw e$$; +} +} +value = Integer.$valueOf (keyCode); +vkCollect.put (key, value); +}return value.intValue (); +}, "~S"); +Clazz_defineMethod (c$, "getKeyChar", +function () { +return this.keyChar; +}); +Clazz_defineMethod (c$, "getKeyCode", +function () { +return this.keyCode; +}); +Clazz_defineMethod (c$, "getModifiers", +function () { +return this.modifiers; +}); +Clazz_defineMethod (c$, "isOnKeyRelease", +function () { +return this.onKeyRelease; +}); +Clazz_defineMethod (c$, "getKeyEventType", +function () { +if (this.keyCode == 0) { +return 400; +} else { +return (this.onKeyRelease) ? 402 : 401; +}}); +Clazz_overrideMethod (c$, "hashCode", +function () { +return (((this.keyChar).charCodeAt (0)) + 1) * (2 * (this.keyCode + 1)) * (this.modifiers + 1) + (this.onKeyRelease ? 1 : 2); +}); +Clazz_defineMethod (c$, "equals", +function (anObject) { +if (Clazz_instanceOf (anObject, java.awt.AWTKeyStroke)) { +var ks = anObject; +return (ks.keyChar == this.keyChar && ks.keyCode == this.keyCode && ks.onKeyRelease == this.onKeyRelease && ks.modifiers == this.modifiers); +}return false; +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +if (this.keyCode == 0) { +return java.awt.AWTKeyStroke.getModifiersText (this.modifiers) + "typed " + this.keyChar; +} else { +return java.awt.AWTKeyStroke.getModifiersText (this.modifiers) + (this.onKeyRelease ? "released" : "pressed") + " " + java.awt.AWTKeyStroke.getVKText (this.keyCode); +}}); +c$.getModifiersText = Clazz_defineMethod (c$, "getModifiersText", +function (modifiers) { +var buf = new StringBuilder (); +if ((modifiers & 64) != 0) { +buf.append ("shift "); +}if ((modifiers & 128) != 0) { +buf.append ("ctrl "); +}if ((modifiers & 256) != 0) { +buf.append ("meta "); +}if ((modifiers & 512) != 0) { +buf.append ("alt "); +}if ((modifiers & 8192) != 0) { +buf.append ("altGraph "); +}if ((modifiers & 1024) != 0) { +buf.append ("button1 "); +}if ((modifiers & 2048) != 0) { +buf.append ("button2 "); +}if ((modifiers & 4096) != 0) { +buf.append ("button3 "); +}return buf.toString (); +}, "~N"); +c$.getVKText = Clazz_defineMethod (c$, "getVKText", +function (keyCode) { +return "UNKNOWN"; +}, "~N"); +Clazz_defineMethod (c$, "readResolve", +function () { +{ +var newClass = this.getClass (); +var awtKeyStrokeClass = java.awt.AWTKeyStroke.getAWTKeyStrokeClass (); +if (!newClass.equals (awtKeyStrokeClass)) { +java.awt.AWTKeyStroke.registerSubclass (newClass); +}return java.awt.AWTKeyStroke.getCachedStroke (this.keyChar, this.keyCode, this.modifiers, this.onKeyRelease); +}}); +Clazz_defineStatics (c$, +"modifierKeywords", null, +"vks", null); +c$ = Clazz_decorateAsClass (function () { +this.code2name = null; +this.name2code = null; +Clazz_instantialize (this, arguments); +}, java.awt, "VKCollection"); +Clazz_makeConstructor (c$, +function () { +this.code2name = new java.util.HashMap (); +this.name2code = new java.util.HashMap (); +}); +Clazz_defineMethod (c$, "put", +function (name, code) { +this.code2name.put (code, name); +this.name2code.put (name, code); +}, "~S,Integer"); +Clazz_defineMethod (c$, "findCode", +function (name) { +return this.name2code.get (name); +}, "~S"); +Clazz_defineMethod (c$, "findName", +function (code) { +return this.code2name.get (code); +}, "Integer"); +}); +Clazz_load(["java.util.Enumeration"],"java.util.StringTokenizer",["java.lang.NullPointerException","java.util.NoSuchElementException"],function(){ +c$=Clazz_decorateAsClass(function(){ +this.string=null; +this.delimiters=null; +this.returnDelimiters=false; +this.position=0; +Clazz_instantialize(this,arguments); +},java.util,"StringTokenizer",null,java.util.Enumeration); +Clazz_makeConstructor(c$, +function(string){ +this.construct(string," \t\n\r\f",false); +},"~S"); +Clazz_makeConstructor(c$, +function(string,delimiters){ +this.construct(string,delimiters,false); +},"~S,~S"); +Clazz_makeConstructor(c$, +function(string,delimiters,returnDelimiters){ +if(string!=null){ +this.string=string; +this.delimiters=delimiters; +this.returnDelimiters=returnDelimiters; +this.position=0; +}else throw new NullPointerException(); +},"~S,~S,~B"); +Clazz_defineMethod(c$,"countTokens", +function(){ +var count=0; +var inToken=false; +for(var i=this.position,length=this.string.length;i=0){ +if(this.returnDelimiters)count++; +if(inToken){ +count++; +inToken=false; +}}else{ +inToken=true; +}} +if(inToken)count++; +return count; +}); +Clazz_overrideMethod(c$,"hasMoreElements", +function(){ +return this.hasMoreTokens(); +}); +Clazz_defineMethod(c$,"hasMoreTokens", +function(){ +var length=this.string.length; +if(this.position=0)return String.valueOf(this.string.charAt(this.position++)); +for(this.position++;this.position=0)return this.string.substring(i,this.position); + +return this.string.substring(i); +}while(i=0)i++; + +this.position=i; +if(i=0)return this.string.substring(i,this.position); + +return this.string.substring(i); +}}throw new java.util.NoSuchElementException(); +}); +Clazz_defineMethod(c$,"nextToken", +function(delims){ +this.delimiters=delims; +return this.nextToken(); +},"~S"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.InputMap"], "javax.swing.ComponentInputMap", ["java.lang.IllegalArgumentException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.component = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "ComponentInputMap", javax.swing.InputMap); +Clazz_makeConstructor (c$, +function (component) { +Clazz_superConstructor (this, javax.swing.ComponentInputMap, []); +this.component = component; +if (component == null) { +throw new IllegalArgumentException ("ComponentInputMaps must be associated with a non-null JComponent"); +}}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "setParent", +function (map) { +if (this.getParent () === map) { +return; +}if (map != null && (!(Clazz_instanceOf (map, javax.swing.ComponentInputMap)) || (map).getComponent () !== this.getComponent ())) { +throw new IllegalArgumentException ("ComponentInputMaps must have a parent ComponentInputMap associated with the same component"); +}Clazz_superCall (this, javax.swing.ComponentInputMap, "setParent", [map]); +this.getComponent ().componentInputMapChanged (this); +}, "javax.swing.InputMap"); +Clazz_defineMethod (c$, "getComponent", +function () { +return this.component; +}); +Clazz_defineMethod (c$, "put", +function (keyStroke, actionMapKey) { +Clazz_superCall (this, javax.swing.ComponentInputMap, "put", [keyStroke, actionMapKey]); +if (this.getComponent () != null) { +this.getComponent ().componentInputMapChanged (this); +}}, "javax.swing.KeyStroke,~O"); +Clazz_defineMethod (c$, "remove", +function (key) { +Clazz_superCall (this, javax.swing.ComponentInputMap, "remove", [key]); +if (this.getComponent () != null) { +this.getComponent ().componentInputMapChanged (this); +}}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "clear", +function () { +var oldSize = this.size (); +Clazz_superCall (this, javax.swing.ComponentInputMap, "clear", []); +if (oldSize > 0 && this.getComponent () != null) { +this.getComponent ().componentInputMapChanged (this); +}}); +}); +Clazz_declarePackage ("jssun.swing"); +Clazz_load (["javax.swing.LayoutStyle"], "jssun.swing.DefaultLayoutStyle", ["java.lang.IllegalArgumentException", "$.NullPointerException", "javax.swing.Icon", "$.JCheckBox", "$.JLabel", "$.JRadioButton", "$.UIManager", "javax.swing.plaf.UIResource"], function () { +c$ = Clazz_declareType (jssun.swing, "DefaultLayoutStyle", javax.swing.LayoutStyle); +c$.getInstance = Clazz_overrideMethod (c$, "getInstance", +function () { +return jssun.swing.DefaultLayoutStyle.INSTANCE; +}); +Clazz_overrideMethod (c$, "getPreferredGap", +function (component1, component2, type, position, parent) { +if (component1 == null || component2 == null || type == null) { +throw new NullPointerException (); +}this.checkPosition (position); +if (type === javax.swing.LayoutStyle.ComponentPlacement.INDENT && (position == 3 || position == 7)) { +var indent = this.getIndent (component1, position); +if (indent > 0) { +return indent; +}}return (type === javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) ? 12 : 6; +}, "javax.swing.JComponent,javax.swing.JComponent,javax.swing.LayoutStyle.ComponentPlacement,~N,java.awt.Container"); +Clazz_overrideMethod (c$, "getContainerGap", +function (component, position, parent) { +if (component == null) { +throw new NullPointerException (); +}this.checkPosition (position); +return 6; +}, "javax.swing.JComponent,~N,java.awt.Container"); +Clazz_defineMethod (c$, "isLabelAndNonlabel", +function (c1, c2, position) { +if (position == 3 || position == 7) { +var c1Label = (Clazz_instanceOf (c1, javax.swing.JLabel)); +var c2Label = (Clazz_instanceOf (c2, javax.swing.JLabel)); +return ((c1Label || c2Label) && (c1Label != c2Label)); +}return false; +}, "javax.swing.JComponent,javax.swing.JComponent,~N"); +Clazz_defineMethod (c$, "getButtonGap", +function (source, target, position, offset) { +offset -= this.getButtonGap (source, position); +if (offset > 0) { +offset -= this.getButtonGap (target, this.flipDirection (position)); +}if (offset < 0) { +return 0; +}return offset; +}, "javax.swing.JComponent,javax.swing.JComponent,~N,~N"); +Clazz_defineMethod (c$, "getButtonGap", +function (source, position, offset) { +offset -= this.getButtonGap (source, position); +return Math.max (offset, 0); +}, "javax.swing.JComponent,~N,~N"); +Clazz_defineMethod (c$, "getButtonGap", +function (c, position) { +var classID = c.getUIClassID (); +if ((classID === "CheckBoxUI" || classID === "RadioButtonUI") && !(c).isBorderPainted ()) { +var border = c.getBorder (); +if (Clazz_instanceOf (border, javax.swing.plaf.UIResource)) { +return this.getInset (c, position); +}}return 0; +}, "javax.swing.JComponent,~N"); +Clazz_defineMethod (c$, "checkPosition", + function (position) { +if (position != 1 && position != 5 && position != 7 && position != 3) { +throw new IllegalArgumentException (); +}}, "~N"); +Clazz_defineMethod (c$, "flipDirection", +function (position) { +switch (position) { +case 1: +return 5; +case 5: +return 1; +case 3: +return 7; +case 7: +return 3; +} +return 0; +}, "~N"); +Clazz_defineMethod (c$, "getIndent", +function (c, position) { +var classID = c.getUIClassID (); +if (classID === "CheckBoxUI" || classID === "RadioButtonUI") { +var button = c; +var insets = c.getInsets (); +var icon = this.getIcon (button); +var gap = button.getIconTextGap (); +if (this.isLeftAligned (button, position)) { +return insets.left + icon.getIconWidth () + gap; +} else if (this.isRightAligned (button, position)) { +return insets.right + icon.getIconWidth () + gap; +}}return 0; +}, "javax.swing.JComponent,~N"); +Clazz_defineMethod (c$, "getIcon", + function (button) { +var icon = button.getIcon (); +if (icon != null) { +return icon; +}var key = null; +if (Clazz_instanceOf (button, javax.swing.JCheckBox)) { +key = "CheckBox.icon"; +} else if (Clazz_instanceOf (button, javax.swing.JRadioButton)) { +key = "RadioButton.icon"; +}if (key != null) { +var oIcon = javax.swing.UIManager.get (key); +if (Clazz_instanceOf (oIcon, javax.swing.Icon)) { +return oIcon; +}}return null; +}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "isLeftAligned", + function (button, position) { +if (position == 7) { +var ltr = button.getComponentOrientation ().isLeftToRight (); +var hAlign = button.getHorizontalAlignment (); +return ((ltr && (hAlign == 2 || hAlign == 10)) || (!ltr && (hAlign == 11))); +}return false; +}, "javax.swing.AbstractButton,~N"); +Clazz_defineMethod (c$, "isRightAligned", + function (button, position) { +if (position == 3) { +var ltr = button.getComponentOrientation ().isLeftToRight (); +var hAlign = button.getHorizontalAlignment (); +return ((ltr && (hAlign == 4 || hAlign == 11)) || (!ltr && (hAlign == 10))); +}return false; +}, "javax.swing.AbstractButton,~N"); +Clazz_defineMethod (c$, "getInset", + function (c, position) { +return this.getInset (c.getInsets (), position); +}, "javax.swing.JComponent,~N"); +Clazz_defineMethod (c$, "getInset", + function (insets, position) { +if (insets == null) { +return 0; +}switch (position) { +case 1: +return insets.top; +case 5: +return insets.bottom; +case 3: +return insets.right; +case 7: +return insets.left; +} +return 0; +}, "java.awt.Insets,~N"); +c$.INSTANCE = c$.prototype.INSTANCE = new jssun.swing.DefaultLayoutStyle (); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.lang.Enum"], "javax.swing.LayoutStyle", ["javax.swing.UIManager", "jssun.awt.AppContext"], function () { +c$ = Clazz_declareType (javax.swing, "LayoutStyle"); +c$.setInstance = Clazz_defineMethod (c$, "setInstance", +function (style) { +{ +if (style == null) { +jssun.awt.AppContext.getAppContext ().remove (javax.swing.LayoutStyle); +} else { +jssun.awt.AppContext.getAppContext ().put (javax.swing.LayoutStyle, style); +}}}, "javax.swing.LayoutStyle"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function () { +var style; +{ +style = jssun.awt.AppContext.getAppContext ().get (javax.swing.LayoutStyle); +}if (style == null) { +return javax.swing.UIManager.getLookAndFeel ().getLayoutStyle (); +}return style; +}); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.LayoutStyle, "ComponentPlacement", Enum); +Clazz_defineEnumConstant (c$, "RELATED", 0, []); +Clazz_defineEnumConstant (c$, "UNRELATED", 1, []); +Clazz_defineEnumConstant (c$, "INDENT", 2, []); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JToggleButton"], "javax.swing.JCheckBox", ["java.lang.Boolean", "javax.swing.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.flat = false; +Clazz_instantialize (this, arguments); +}, javax.swing, "JCheckBox", javax.swing.JToggleButton); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, false); +}); +Clazz_makeConstructor (c$, +function (icon) { +this.construct (null, icon, false); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (icon, selected) { +this.construct (null, icon, selected); +}, "javax.swing.Icon,~B"); +Clazz_makeConstructor (c$, +function (text) { +this.construct (text, null, false); +}, "~S"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (text, selected) { +this.construct (text, null, selected); +}, "~S,~B"); +Clazz_makeConstructor (c$, +function (text, icon) { +this.construct (text, icon, false); +}, "~S,javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text, icon, selected) { +Clazz_superConstructor (this, javax.swing.JCheckBox, [text, icon, selected]); +this.setUIProperty ("borderPainted", Boolean.FALSE); +this.setHorizontalAlignment (10); +}, "~S,javax.swing.Icon,~B"); +Clazz_defineMethod (c$, "setBorderPaintedFlat", +function (b) { +var oldValue = this.flat; +this.flat = b; +this.firePropertyChangeBool ("borderPaintedFlat", oldValue, this.flat); +if (b != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "isBorderPaintedFlat", +function () { +return this.flat; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "CheckBoxUI"; +}); +Clazz_overrideMethod (c$, "setIconFromAction", +function (a) { +}, "javax.swing.Action"); +Clazz_defineStatics (c$, +"BORDER_PAINTED_FLAT_CHANGED_PROPERTY", "borderPaintedFlat", +"$$uiClassID", "CheckBoxUI"); +}); +Clazz_declarePackage ("java.awt"); +Clazz_declareInterface (java.awt, "ItemSelectable"); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.AWTEvent"], "java.awt.event.ItemEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.item = null; +this.stateChange = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "ItemEvent", java.awt.AWTEvent); +Clazz_makeConstructor (c$, +function (source, id, item, stateChange) { +Clazz_superConstructor (this, java.awt.event.ItemEvent, [source, id]); +this.item = item; +this.stateChange = stateChange; +}, "java.awt.ItemSelectable,~N,~O,~N"); +Clazz_defineMethod (c$, "getItemSelectable", +function () { +return this.source; +}); +Clazz_defineMethod (c$, "getItem", +function () { +return this.item; +}); +Clazz_defineMethod (c$, "getStateChange", +function () { +return this.stateChange; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 701: +typeStr = "ITEM_STATE_CHANGED"; +break; +default: +typeStr = "unknown type"; +} +var stateStr; +switch (this.stateChange) { +case 1: +stateStr = "SELECTED"; +break; +case 2: +stateStr = "DESELECTED"; +break; +default: +stateStr = "unknown type"; +} +return typeStr + ",item=" + this.item + ",stateChange=" + stateStr; +}); +Clazz_defineStatics (c$, +"ITEM_FIRST", 701, +"ITEM_LAST", 701, +"ITEM_STATE_CHANGED", 701, +"SELECTED", 1, +"DESELECTED", 2); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.ButtonModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultButtonModel", ["java.awt.EventQueue", "java.awt.event.ActionEvent", "$.ActionListener", "$.InputEvent", "$.ItemEvent", "$.ItemListener", "javax.swing.UIManager", "javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.stateMask = 0; +this.actionCommand = null; +this.group = null; +this.mnemonic = 0; +this.changeEvent = null; +this.listenerList = null; +this.menuItem = false; +Clazz_instantialize (this, arguments); +}, javax.swing, "DefaultButtonModel", null, javax.swing.ButtonModel); +Clazz_prepareFields (c$, function () { +this.listenerList = new javax.swing.event.EventListenerList (); +}); +Clazz_makeConstructor (c$, +function () { +this.stateMask = 0; +this.setEnabled (true); +}); +Clazz_overrideMethod (c$, "setActionCommand", +function (actionCommand) { +this.actionCommand = actionCommand; +}, "~S"); +Clazz_overrideMethod (c$, "getActionCommand", +function () { +return this.actionCommand; +}); +Clazz_overrideMethod (c$, "isArmed", +function () { +return (this.stateMask & 1) != 0; +}); +Clazz_overrideMethod (c$, "isSelected", +function () { +return (this.stateMask & 2) != 0; +}); +Clazz_overrideMethod (c$, "isEnabled", +function () { +return (this.stateMask & 8) != 0; +}); +Clazz_overrideMethod (c$, "isPressed", +function () { +return (this.stateMask & 4) != 0; +}); +Clazz_overrideMethod (c$, "isRollover", +function () { +return (this.stateMask & 16) != 0; +}); +Clazz_overrideMethod (c$, "setArmed", +function (b) { +if (this.isMenuItem () && javax.swing.UIManager.getBoolean ("MenuItem.disabledAreNavigable")) { +if ((this.isArmed () == b)) { +return; +}} else { +if ((this.isArmed () == b) || !this.isEnabled ()) { +return; +}}if (b) { +this.stateMask |= 1; +} else { +this.stateMask &= -2; +}this.fireStateChanged (); +}, "~B"); +Clazz_overrideMethod (c$, "setEnabled", +function (b) { +if (this.isEnabled () == b) { +return; +}if (b) { +this.stateMask |= 8; +} else { +this.stateMask &= -9; +this.stateMask &= -2; +this.stateMask &= -5; +}this.fireStateChanged (); +}, "~B"); +Clazz_overrideMethod (c$, "setSelected", +function (b) { +if (this.isSelected () == b) { +return; +}if (b) { +this.stateMask |= 2; +} else { +this.stateMask &= -3; +}this.fireItemStateChanged ( new java.awt.event.ItemEvent (this, 701, this, b ? 1 : 2)); +this.fireStateChanged (); +}, "~B"); +Clazz_overrideMethod (c$, "setPressed", +function (b) { +if ((this.isPressed () == b) || !this.isEnabled ()) { +return; +}if (b) { +this.stateMask |= 4; +} else { +this.stateMask &= -5; +}if (!this.isPressed () && this.isArmed ()) { +var modifiers = 0; +var currentEvent = java.awt.EventQueue.getCurrentEvent (); +if (Clazz_instanceOf (currentEvent, java.awt.event.InputEvent)) { +modifiers = (currentEvent).getModifiers (); +} else if (Clazz_instanceOf (currentEvent, java.awt.event.ActionEvent)) { +modifiers = (currentEvent).getModifiers (); +}this.fireActionPerformed ( new java.awt.event.ActionEvent (this, 1001, this.getActionCommand (), java.awt.EventQueue.getMostRecentEventTime (), modifiers)); +}this.fireStateChanged (); +}, "~B"); +Clazz_overrideMethod (c$, "setRollover", +function (b) { +if ((this.isRollover () == b) || !this.isEnabled ()) { +return; +}if (b) { +this.stateMask |= 16; +} else { +this.stateMask &= -17; +}this.fireStateChanged (); +}, "~B"); +Clazz_overrideMethod (c$, "setMnemonic", +function (key) { +this.mnemonic = key; +this.fireStateChanged (); +}, "~N"); +Clazz_overrideMethod (c$, "getMnemonic", +function () { +return this.mnemonic; +}); +Clazz_overrideMethod (c$, "addChangeListener", +function (l) { +this.listenerList.add (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_overrideMethod (c$, "removeChangeListener", +function (l) { +this.listenerList.remove (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "getChangeListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.ChangeListener); +}); +Clazz_defineMethod (c$, "fireStateChanged", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.ChangeListener) { +if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); +(listeners[i + 1]).stateChanged (this.changeEvent); +}} +}); +Clazz_overrideMethod (c$, "addActionListener", +function (l) { +this.listenerList.add (java.awt.event.ActionListener, l); +}, "java.awt.event.ActionListener"); +Clazz_overrideMethod (c$, "removeActionListener", +function (l) { +this.listenerList.remove (java.awt.event.ActionListener, l); +}, "java.awt.event.ActionListener"); +Clazz_defineMethod (c$, "getActionListeners", +function () { +return this.listenerList.getListeners (java.awt.event.ActionListener); +}); +Clazz_defineMethod (c$, "fireActionPerformed", +function (e) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === java.awt.event.ActionListener) { +(listeners[i + 1]).actionPerformed (e); +}} +}, "java.awt.event.ActionEvent"); +Clazz_overrideMethod (c$, "addItemListener", +function (l) { +this.listenerList.add (java.awt.event.ItemListener, l); +}, "java.awt.event.ItemListener"); +Clazz_overrideMethod (c$, "removeItemListener", +function (l) { +this.listenerList.remove (java.awt.event.ItemListener, l); +}, "java.awt.event.ItemListener"); +Clazz_defineMethod (c$, "getItemListeners", +function () { +return this.listenerList.getListeners (java.awt.event.ItemListener); +}); +Clazz_defineMethod (c$, "fireItemStateChanged", +function (e) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === java.awt.event.ItemListener) { +(listeners[i + 1]).itemStateChanged (e); +}} +}, "java.awt.event.ItemEvent"); +Clazz_defineMethod (c$, "getListeners", +function (listenerType) { +return this.listenerList.getListeners (listenerType); +}, "Class"); +Clazz_overrideMethod (c$, "getSelectedObjects", +function () { +return null; +}); +Clazz_overrideMethod (c$, "setGroup", +function (group) { +this.group = group; +}, "javax.swing.ButtonGroup"); +Clazz_defineMethod (c$, "getGroup", +function () { +return this.group; +}); +Clazz_defineMethod (c$, "isMenuItem", +function () { +return this.menuItem; +}); +Clazz_defineMethod (c$, "setMenuItem", +function (menuItem) { +this.menuItem = menuItem; +}, "~B"); +Clazz_defineStatics (c$, +"ARMED", 1, +"SELECTED", 2, +"PRESSED", 4, +"ENABLED", 8, +"ROLLOVER", 16); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.LayoutManager2"], "javax.swing.OverlayLayout", ["java.awt.AWTError", "$.Dimension", "javax.swing.SizeRequirements"], function () { +c$ = Clazz_decorateAsClass (function () { +this.target = null; +this.xChildren = null; +this.yChildren = null; +this.xTotal = null; +this.yTotal = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "OverlayLayout", null, java.awt.LayoutManager2); +Clazz_makeConstructor (c$, +function (target) { +this.target = target; +}, "java.awt.Container"); +Clazz_defineMethod (c$, "getTarget", +function () { +return this.target; +}); +Clazz_overrideMethod (c$, "invalidateLayout", +function (target) { +this.checkContainer (target); +this.xChildren = null; +this.yChildren = null; +this.xTotal = null; +this.yTotal = null; +}, "java.awt.Container"); +Clazz_defineMethod (c$, "addLayoutComponent", +function (name, comp) { +this.invalidateLayout (comp.getParent ()); +}, "~S,java.awt.Component"); +Clazz_overrideMethod (c$, "removeLayoutComponent", +function (comp) { +this.invalidateLayout (comp.getParent ()); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "addLayoutComponent", +function (comp, constraints) { +this.invalidateLayout (comp.getParent ()); +}, "java.awt.Component,~O"); +Clazz_overrideMethod (c$, "preferredLayoutSize", +function (target) { +this.checkContainer (target); +this.checkRequests (); +var size = new java.awt.Dimension (this.xTotal.preferred, this.yTotal.preferred); +var insets = target.getInsets (); +size.width += insets.left + insets.right; +size.height += insets.top + insets.bottom; +return size; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "minimumLayoutSize", +function (target) { +this.checkContainer (target); +this.checkRequests (); +var size = new java.awt.Dimension (this.xTotal.minimum, this.yTotal.minimum); +var insets = target.getInsets (); +size.width += insets.left + insets.right; +size.height += insets.top + insets.bottom; +return size; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "maximumLayoutSize", +function (target) { +this.checkContainer (target); +this.checkRequests (); +var size = new java.awt.Dimension (this.xTotal.maximum, this.yTotal.maximum); +var insets = target.getInsets (); +size.width += insets.left + insets.right; +size.height += insets.top + insets.bottom; +return size; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayoutAlignmentX", +function (target) { +this.checkContainer (target); +this.checkRequests (); +return this.xTotal.alignment; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayoutAlignmentY", +function (target) { +this.checkContainer (target); +this.checkRequests (); +return this.yTotal.alignment; +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "layoutContainer", +function (target) { +this.checkContainer (target); +this.checkRequests (); +var nChildren = target.getComponentCount (); +var xOffsets = Clazz_newIntArray (nChildren, 0); +var xSpans = Clazz_newIntArray (nChildren, 0); +var yOffsets = Clazz_newIntArray (nChildren, 0); +var ySpans = Clazz_newIntArray (nChildren, 0); +var alloc = target.getSize (); +var $in = target.getInsets (); +alloc.width -= $in.left + $in.right; +alloc.height -= $in.top + $in.bottom; +javax.swing.SizeRequirements.calculateAlignedPositions (alloc.width, this.xTotal, this.xChildren, xOffsets, xSpans); +javax.swing.SizeRequirements.calculateAlignedPositions (alloc.height, this.yTotal, this.yChildren, yOffsets, ySpans); +for (var i = 0; i < nChildren; i++) { +var c = target.getComponent (i); +c.setBounds ($in.left + xOffsets[i], $in.top + yOffsets[i], xSpans[i], ySpans[i]); +} +}, "java.awt.Container"); +Clazz_defineMethod (c$, "checkContainer", +function (target) { +if (this.target !== target) { +throw new java.awt.AWTError ("OverlayLayout can't be shared"); +}}, "java.awt.Container"); +Clazz_defineMethod (c$, "checkRequests", +function () { +if (this.xChildren == null || this.yChildren == null) { +var n = this.target.getComponentCount (); +this.xChildren = new Array (n); +this.yChildren = new Array (n); +for (var i = 0; i < n; i++) { +var c = this.target.getComponent (i); +var min = c.getMinimumSize (); +var typ = c.getPreferredSize (); +var max = c.getMaximumSize (); +this.xChildren[i] = new javax.swing.SizeRequirements (min.width, typ.width, max.width, c.getAlignmentX ()); +this.yChildren[i] = new javax.swing.SizeRequirements (min.height, typ.height, max.height, c.getAlignmentY ()); +} +this.xTotal = javax.swing.SizeRequirements.getAlignedSizeRequirements (this.xChildren); +this.yTotal = javax.swing.SizeRequirements.getAlignedSizeRequirements (this.yChildren); +}}); +}); +Clazz_declarePackage ("javax.swing"); +c$ = Clazz_decorateAsClass (function () { +this.minimum = 0; +this.preferred = 0; +this.maximum = 0; +this.alignment = 0; +Clazz_instantialize (this, arguments); +}, javax.swing, "SizeRequirements"); +Clazz_makeConstructor (c$, +function () { +this.minimum = 0; +this.preferred = 0; +this.maximum = 0; +this.alignment = 0.5; +}); +Clazz_makeConstructor (c$, +function (min, pref, max, a) { +this.minimum = min; +this.preferred = pref; +this.maximum = max; +this.alignment = a > 1.0 ? 1.0 : a < 0.0 ? 0.0 : a; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "toString", +function () { +return "[" + this.minimum + "," + this.preferred + "," + this.maximum + "]@" + this.alignment; +}); +c$.getTiledSizeRequirements = Clazz_defineMethod (c$, "getTiledSizeRequirements", +function (children) { +var total = new javax.swing.SizeRequirements (); +for (var i = 0; i < children.length; i++) { +var req = children[i]; +total.minimum = Math.min (total.minimum + req.minimum, 2147483647); +total.preferred = Math.min (total.preferred + req.preferred, 2147483647); +total.maximum = Math.min (total.maximum + req.maximum, 2147483647); +} +return total; +}, "~A"); +c$.getAlignedSizeRequirements = Clazz_defineMethod (c$, "getAlignedSizeRequirements", +function (children) { +var totalAscent = new javax.swing.SizeRequirements (); +var totalDescent = new javax.swing.SizeRequirements (); +for (var i = 0; i < children.length; i++) { +var req = children[i]; +var ascent = Clazz_floatToInt (req.alignment * req.minimum); +var descent = req.minimum - ascent; +totalAscent.minimum = Math.max (ascent, totalAscent.minimum); +totalDescent.minimum = Math.max (descent, totalDescent.minimum); +ascent = Clazz_floatToInt (req.alignment * req.preferred); +descent = req.preferred - ascent; +totalAscent.preferred = Math.max (ascent, totalAscent.preferred); +totalDescent.preferred = Math.max (descent, totalDescent.preferred); +ascent = Clazz_floatToInt (req.alignment * req.maximum); +descent = req.maximum - ascent; +totalAscent.maximum = Math.max (ascent, totalAscent.maximum); +totalDescent.maximum = Math.max (descent, totalDescent.maximum); +} +var min = Math.min (totalAscent.minimum + totalDescent.minimum, 2147483647); +var pref = Math.min (totalAscent.preferred + totalDescent.preferred, 2147483647); +var max = Math.min (totalAscent.maximum + totalDescent.maximum, 2147483647); +var alignment = 0.0; +if (min > 0) { +alignment = totalAscent.minimum / min; +alignment = alignment > 1.0 ? 1.0 : alignment < 0.0 ? 0.0 : alignment; +}return new javax.swing.SizeRequirements (min, pref, max, alignment); +}, "~A"); +c$.calculateTiledPositions = Clazz_defineMethod (c$, "calculateTiledPositions", +function (allocated, total, children, offsets, spans) { +javax.swing.SizeRequirements.calcTiled (allocated, total, children, offsets, spans, true); +}, "~N,javax.swing.SizeRequirements,~A,~A,~A"); +c$.calculateTiledPositions = Clazz_defineMethod (c$, "calculateTiledPositions", +function (allocated, total, children, offsets, spans, forward) { +javax.swing.SizeRequirements.calcTiled (allocated, total, children, offsets, spans, forward); +}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); +c$.calcTiled = Clazz_defineMethod (c$, "calcTiled", +function (allocated, total, children, offsets, spans, forward) { +var min = 0; +var pref = 0; +var max = 0; +for (var i = 0; i < children.length; i++) { +min += children[i].minimum; +pref += children[i].preferred; +max += children[i].maximum; +} +if (allocated >= pref) { +javax.swing.SizeRequirements.expandedTile (allocated, min, pref, max, children, offsets, spans, forward); +} else { +javax.swing.SizeRequirements.compressedTile (allocated, min, pref, max, children, offsets, spans, forward); +}}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); +c$.compressedTile = Clazz_defineMethod (c$, "compressedTile", + function (allocated, min, pref, max, request, offsets, spans, forward) { +var totalPlay = Math.min (pref - allocated, pref - min); +var factor = (pref - min == 0) ? 0.0 : totalPlay / (pref - min); +var totalOffset; +if (forward) { +totalOffset = 0; +for (var i = 0; i < spans.length; i++) { +offsets[i] = totalOffset; +var req = request[i]; +var play = factor * (req.preferred - req.minimum); +spans[i] = Clazz_floatToInt (req.preferred - play); +totalOffset = Math.min (totalOffset + spans[i], 2147483647); +} +} else { +totalOffset = allocated; +for (var i = 0; i < spans.length; i++) { +var req = request[i]; +var play = factor * (req.preferred - req.minimum); +spans[i] = Clazz_floatToInt (req.preferred - play); +offsets[i] = totalOffset - spans[i]; +totalOffset = Math.max (totalOffset - spans[i], 0); +} +}}, "~N,~N,~N,~N,~A,~A,~A,~B"); +c$.expandedTile = Clazz_defineMethod (c$, "expandedTile", + function (allocated, min, pref, max, request, offsets, spans, forward) { +var totalPlay = Math.min (allocated - pref, max - pref); +var factor = (max - pref == 0) ? 0.0 : totalPlay / (max - pref); +var totalOffset; +if (forward) { +totalOffset = 0; +for (var i = 0; i < spans.length; i++) { +offsets[i] = totalOffset; +var req = request[i]; +var play = Clazz_floatToInt (factor * (req.maximum - req.preferred)); +spans[i] = Math.min (req.preferred + play, 2147483647); +totalOffset = Math.min (totalOffset + spans[i], 2147483647); +} +} else { +totalOffset = allocated; +for (var i = 0; i < spans.length; i++) { +var req = request[i]; +var play = Clazz_floatToInt (factor * (req.maximum - req.preferred)); +spans[i] = Math.min (req.preferred + play, 2147483647); +offsets[i] = totalOffset - spans[i]; +totalOffset = Math.max (totalOffset - spans[i], 0); +} +}}, "~N,~N,~N,~N,~A,~A,~A,~B"); +c$.calculateAlignedPositions = Clazz_defineMethod (c$, "calculateAlignedPositions", +function (allocated, total, children, offsets, spans) { +javax.swing.SizeRequirements.calcAligned (allocated, total, children, offsets, spans, true); +}, "~N,javax.swing.SizeRequirements,~A,~A,~A"); +c$.calcAligned = Clazz_defineMethod (c$, "calcAligned", +function (allocated, total, children, offsets, spans, normal) { +var totalAlignment = normal ? total.alignment : 1.0 - total.alignment; +var totalAscent = Clazz_floatToInt (allocated * totalAlignment); +var totalDescent = allocated - totalAscent; +for (var i = 0; i < children.length; i++) { +var req = children[i]; +var alignment = normal ? req.alignment : 1.0 - req.alignment; +var maxAscent = Clazz_floatToInt (req.maximum * alignment); +var maxDescent = req.maximum - maxAscent; +var ascent = Math.min (totalAscent, maxAscent); +var descent = Math.min (totalDescent, maxDescent); +offsets[i] = totalAscent - ascent; +spans[i] = Math.min (ascent + descent, 2147483647); +} +}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); +c$.calculateAlignedPositions = Clazz_defineMethod (c$, "calculateAlignedPositions", +function (allocated, total, children, offsets, spans, normal) { +javax.swing.SizeRequirements.calcAligned (allocated, total, children, offsets, spans, normal); +}, "~N,javax.swing.SizeRequirements,~A,~A,~A,~B"); +c$.adjustSizes = Clazz_defineMethod (c$, "adjustSizes", +function (delta, children) { +return Clazz_newIntArray (0, 0); +}, "~N,~A"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent", "$.SwingConstants"], "javax.swing.JLabel", ["java.lang.IllegalArgumentException", "javax.swing.SwingUtilities", "$.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.mnemonic = '\0'; +this.mnemonicIndex = -1; +this.text = ""; +this.defaultIcon = null; +this.disabledIcon = null; +this.disabledIconSet = false; +this.verticalAlignment = 0; +this.horizontalAlignment = 10; +this.verticalTextPosition = 0; +this.horizontalTextPosition = 11; +this.iconTextGap = 4; +this.labelFor = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JLabel", javax.swing.JComponent, javax.swing.SwingConstants); +Clazz_makeConstructor (c$, +function (text, icon, horizontalAlignment) { +Clazz_superConstructor (this, javax.swing.JLabel, []); +this.setText (text); +this.setIcon (icon); +this.setHorizontalAlignment (horizontalAlignment); +this.updateUI (); +this.setAlignmentX (0.0); +}, "~S,javax.swing.Icon,~N"); +Clazz_makeConstructor (c$, +function (text, horizontalAlignment) { +this.construct (text, null, horizontalAlignment); +}, "~S,~N"); +Clazz_makeConstructor (c$, +function (text) { +this.construct (text, null, 10); +}, "~S"); +Clazz_makeConstructor (c$, +function (image, horizontalAlignment) { +this.construct (null, image, horizontalAlignment); +}, "javax.swing.Icon,~N"); +Clazz_makeConstructor (c$, +function (image) { +this.construct (null, image, 0); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function () { +this.construct ("", null, 10); +}); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_defineMethod (c$, "setUI", +function (ui) { +Clazz_superCall (this, javax.swing.JLabel, "setUI", [ui]); +if (!this.disabledIconSet && this.disabledIcon != null) { +this.setDisabledIcon (null); +}}, "javax.swing.plaf.LabelUI"); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "LabelUI"; +}); +Clazz_defineMethod (c$, "getText", +function () { +return this.text; +}); +Clazz_defineMethod (c$, "setText", +function (text) { +var oldValue = this.text; +this.text = text; +this.firePropertyChangeObject ("text", oldValue, text); +this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (text, this.getDisplayedMnemonic ())); +if (text == null || oldValue == null || !text.equals (oldValue)) { +this.revalidate (); +this.repaint (); +}}, "~S"); +Clazz_defineMethod (c$, "getIcon", +function () { +return this.defaultIcon; +}); +Clazz_defineMethod (c$, "setIcon", +function (icon) { +var oldValue = this.defaultIcon; +this.defaultIcon = icon; +if ((this.defaultIcon !== oldValue) && !this.disabledIconSet) { +this.disabledIcon = null; +}this.firePropertyChangeObject ("icon", oldValue, this.defaultIcon); +if (this.defaultIcon !== oldValue) { +if ((this.defaultIcon == null) || (oldValue == null) || (this.defaultIcon.getIconWidth () != oldValue.getIconWidth ()) || (this.defaultIcon.getIconHeight () != oldValue.getIconHeight ())) { +this.revalidate (); +}this.repaint (); +}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "getDisabledIcon", +function () { +if (!this.disabledIconSet && this.disabledIcon == null && this.defaultIcon != null) { +this.disabledIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledIcon (this, this.defaultIcon); +if (this.disabledIcon != null) { +this.firePropertyChangeObject ("disabledIcon", null, this.disabledIcon); +}}return this.disabledIcon; +}); +Clazz_defineMethod (c$, "setDisabledIcon", +function (disabledIcon) { +var oldValue = this.disabledIcon; +this.disabledIcon = disabledIcon; +this.disabledIconSet = (disabledIcon != null); +this.firePropertyChangeObject ("disabledIcon", oldValue, disabledIcon); +if (disabledIcon !== oldValue) { +if (disabledIcon == null || oldValue == null || disabledIcon.getIconWidth () != oldValue.getIconWidth () || disabledIcon.getIconHeight () != oldValue.getIconHeight ()) { +this.revalidate (); +}if (!this.isEnabled ()) { +this.repaint (); +}}}, "javax.swing.Icon"); +Clazz_defineMethod (c$, "setDisplayedMnemonic", +function (key) { +var oldKey = this.mnemonic; +this.mnemonic = key; +this.firePropertyChangeInt ("displayedMnemonic", oldKey, this.mnemonic); +this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (this.getText (), this.mnemonic)); +if (key != oldKey) { +this.revalidate (); +this.repaint (); +}}, "~N"); +Clazz_defineMethod (c$, "setDisplayedMnemonic", +function (aChar) { +var vk = (aChar).charCodeAt (0); +if (vk >= 97 && vk <= 122) vk -= (32); +this.setDisplayedMnemonic (vk); +}, "~S"); +Clazz_defineMethod (c$, "getDisplayedMnemonic", +function () { +return this.mnemonic; +}); +Clazz_defineMethod (c$, "setDisplayedMnemonicIndex", +function (index) { +var oldValue = this.mnemonicIndex; +if (index == -1) { +this.mnemonicIndex = -1; +} else { +var text = this.getText (); +var textLength = (text == null) ? 0 : text.length; +if (index < -1 || index >= textLength) { +throw new IllegalArgumentException ("index == " + index); +}}this.mnemonicIndex = index; +this.firePropertyChangeInt ("displayedMnemonicIndex", oldValue, index); +if (index != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~N"); +Clazz_defineMethod (c$, "getDisplayedMnemonicIndex", +function () { +return this.mnemonicIndex; +}); +Clazz_defineMethod (c$, "checkHorizontalKey", +function (key, message) { +if ((key == 2) || (key == 0) || (key == 4) || (key == 10) || (key == 11)) { +return key; +} else { +throw new IllegalArgumentException (message); +}}, "~N,~S"); +Clazz_defineMethod (c$, "checkVerticalKey", +function (key, message) { +if ((key == 1) || (key == 0) || (key == 3)) { +return key; +} else { +throw new IllegalArgumentException (message); +}}, "~N,~S"); +Clazz_defineMethod (c$, "getIconTextGap", +function () { +return this.iconTextGap; +}); +Clazz_defineMethod (c$, "setIconTextGap", +function (iconTextGap) { +var oldValue = this.iconTextGap; +this.iconTextGap = iconTextGap; +this.firePropertyChangeInt ("iconTextGap", oldValue, iconTextGap); +if (iconTextGap != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~N"); +Clazz_defineMethod (c$, "getVerticalAlignment", +function () { +return this.verticalAlignment; +}); +Clazz_defineMethod (c$, "setVerticalAlignment", +function (alignment) { +if (alignment == this.verticalAlignment) return; +var oldValue = this.verticalAlignment; +this.verticalAlignment = this.checkVerticalKey (alignment, "verticalAlignment"); +this.firePropertyChangeInt ("verticalAlignment", oldValue, this.verticalAlignment); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getHorizontalAlignment", +function () { +return this.horizontalAlignment; +}); +Clazz_defineMethod (c$, "setHorizontalAlignment", +function (alignment) { +if (alignment == this.horizontalAlignment) return; +var oldValue = this.horizontalAlignment; +this.horizontalAlignment = this.checkHorizontalKey (alignment, "horizontalAlignment"); +this.firePropertyChangeInt ("horizontalAlignment", oldValue, this.horizontalAlignment); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getVerticalTextPosition", +function () { +return this.verticalTextPosition; +}); +Clazz_defineMethod (c$, "setVerticalTextPosition", +function (textPosition) { +if (textPosition == this.verticalTextPosition) return; +var old = this.verticalTextPosition; +this.verticalTextPosition = this.checkVerticalKey (textPosition, "verticalTextPosition"); +this.firePropertyChangeInt ("verticalTextPosition", old, this.verticalTextPosition); +this.revalidate (); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "getHorizontalTextPosition", +function () { +return this.horizontalTextPosition; +}); +Clazz_defineMethod (c$, "setHorizontalTextPosition", +function (textPosition) { +var old = this.horizontalTextPosition; +this.horizontalTextPosition = this.checkHorizontalKey (textPosition, "horizontalTextPosition"); +this.firePropertyChangeInt ("horizontalTextPosition", old, this.horizontalTextPosition); +this.revalidate (); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "imageUpdate", +function (img, infoflags, x, y, w, h) { +if (!this.isShowing () || !javax.swing.SwingUtilities.doesIconReferenceImage (this.getIcon (), img) && !javax.swing.SwingUtilities.doesIconReferenceImage (this.disabledIcon, img)) { +return false; +}return Clazz_superCall (this, javax.swing.JLabel, "imageUpdate", [img, infoflags, x, y, w, h]); +}, "java.awt.Image,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paramString", +function () { +var textString = (this.text != null ? this.text : ""); +var defaultIconString = ((this.defaultIcon != null) && (this.defaultIcon !== this) ? this.defaultIcon.toString () : ""); +var disabledIconString = ((this.disabledIcon != null) && (this.disabledIcon !== this) ? this.disabledIcon.toString () : ""); +var labelForString = (this.labelFor != null ? this.labelFor.toString () : ""); +var verticalAlignmentString; +if (this.verticalAlignment == 1) { +verticalAlignmentString = "TOP"; +} else if (this.verticalAlignment == 0) { +verticalAlignmentString = "CENTER"; +} else if (this.verticalAlignment == 3) { +verticalAlignmentString = "BOTTOM"; +} else verticalAlignmentString = ""; +var horizontalAlignmentString; +if (this.horizontalAlignment == 2) { +horizontalAlignmentString = "LEFT"; +} else if (this.horizontalAlignment == 0) { +horizontalAlignmentString = "CENTER"; +} else if (this.horizontalAlignment == 4) { +horizontalAlignmentString = "RIGHT"; +} else if (this.horizontalAlignment == 10) { +horizontalAlignmentString = "LEADING"; +} else if (this.horizontalAlignment == 11) { +horizontalAlignmentString = "TRAILING"; +} else horizontalAlignmentString = ""; +var verticalTextPositionString; +if (this.verticalTextPosition == 1) { +verticalTextPositionString = "TOP"; +} else if (this.verticalTextPosition == 0) { +verticalTextPositionString = "CENTER"; +} else if (this.verticalTextPosition == 3) { +verticalTextPositionString = "BOTTOM"; +} else verticalTextPositionString = ""; +var horizontalTextPositionString; +if (this.horizontalTextPosition == 2) { +horizontalTextPositionString = "LEFT"; +} else if (this.horizontalTextPosition == 0) { +horizontalTextPositionString = "CENTER"; +} else if (this.horizontalTextPosition == 4) { +horizontalTextPositionString = "RIGHT"; +} else if (this.horizontalTextPosition == 10) { +horizontalTextPositionString = "LEADING"; +} else if (this.horizontalTextPosition == 11) { +horizontalTextPositionString = "TRAILING"; +} else horizontalTextPositionString = ""; +return Clazz_superCall (this, javax.swing.JLabel, "paramString", []) + ",defaultIcon=" + defaultIconString + ",disabledIcon=" + disabledIconString + ",horizontalAlignment=" + horizontalAlignmentString + ",horizontalTextPosition=" + horizontalTextPositionString + ",iconTextGap=" + this.iconTextGap + ",labelFor=" + labelForString + ",text=" + textString + ",verticalAlignment=" + verticalAlignmentString + ",verticalTextPosition=" + verticalTextPositionString; +}); +Clazz_defineMethod (c$, "getLabelFor", +function () { +return this.labelFor; +}); +Clazz_defineMethod (c$, "setLabelFor", +function (c) { +var oldC = this.labelFor; +this.labelFor = c; +this.firePropertyChangeObject ("labelFor", oldC, c); +if (Clazz_instanceOf (oldC, javax.swing.JComponent)) { +(oldC).putClientProperty ("labeledBy", null); +}if (Clazz_instanceOf (c, javax.swing.JComponent)) { +(c).putClientProperty ("labeledBy", this); +}}, "java.awt.Component"); +Clazz_defineStatics (c$, +"$uiClassID", "LabelUI", +"LABELED_BY_PROPERTY", "labeledBy"); +}); +Clazz_declarePackage ("javax.swing.border"); +Clazz_declareInterface (javax.swing.border, "Border"); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "RootPaneContainer"); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.awt.event.MouseEvent"], "javax.swing.event.MenuDragMouseEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.path = null; +this.manager = null; +Clazz_instantialize (this, arguments); +}, javax.swing.event, "MenuDragMouseEvent", java.awt.event.MouseEvent); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, clickCount, popupTrigger, p, m) { +Clazz_superConstructor (this, javax.swing.event.MenuDragMouseEvent, [source, id, when, modifiers, x, y, clickCount, popupTrigger]); +this.path = p; +this.manager = m; +}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~B,~A,javax.swing.MenuSelectionManager"); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, p, m) { +Clazz_superConstructor (this, javax.swing.event.MenuDragMouseEvent, [source, id, when, modifiers, x, y, xAbs, yAbs, clickCount, popupTrigger, 0]); +this.path = p; +this.manager = m; +}, "java.awt.Component,~N,~N,~N,~N,~N,~N,~N,~N,~B,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "getPath", +function () { +return this.path; +}); +Clazz_defineMethod (c$, "getMenuSelectionManager", +function () { +return this.manager; +}); +}); +Clazz_declarePackage ("jssun.swing"); +Clazz_load (["javax.swing.Action"], "jssun.swing.UIAction", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.name = null; +Clazz_instantialize (this, arguments); +}, jssun.swing, "UIAction", null, javax.swing.Action); +Clazz_makeConstructor (c$, +function (name) { +this.name = name; +}, "~S"); +Clazz_defineMethod (c$, "getName", +function () { +return this.name; +}); +Clazz_overrideMethod (c$, "getValue", +function (key) { +if (key === "Name") { +return this.name; +}return null; +}, "~S"); +Clazz_overrideMethod (c$, "putValue", +function (key, value) { +}, "~S,~O"); +Clazz_overrideMethod (c$, "setEnabled", +function (b) { +}, "~B"); +Clazz_defineMethod (c$, "isEnabled", +function () { +return this.isEnabled (null); +}); +Clazz_defineMethod (c$, "isEnabled", +function (sender) { +return true; +}, "~O"); +Clazz_overrideMethod (c$, "addPropertyChangeListener", +function (listener) { +}, "java.beans.PropertyChangeListener"); +Clazz_overrideMethod (c$, "removePropertyChangeListener", +function (listener) { +}, "java.beans.PropertyChangeListener"); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_declareInterface (jssun.awt, "RequestFocusController"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.event.ComponentListener", "java.beans.PropertyChangeListener", "javax.swing.event.EventListenerList"], "javax.swing.AncestorNotifier", ["java.awt.Window", "javax.swing.JComponent", "javax.swing.event.AncestorEvent", "$.AncestorListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.firstInvisibleAncestor = null; +this.listenerList = null; +this.root = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "AncestorNotifier", null, [java.awt.event.ComponentListener, java.beans.PropertyChangeListener]); +Clazz_prepareFields (c$, function () { +this.listenerList = new javax.swing.event.EventListenerList (); +}); +Clazz_makeConstructor (c$, +function (root) { +this.root = root; +this.addListeners (root, true); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "addAncestorListener", +function (l) { +this.listenerList.add (javax.swing.event.AncestorListener, l); +}, "javax.swing.event.AncestorListener"); +Clazz_defineMethod (c$, "removeAncestorListener", +function (l) { +this.listenerList.remove (javax.swing.event.AncestorListener, l); +}, "javax.swing.event.AncestorListener"); +Clazz_defineMethod (c$, "getAncestorListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.AncestorListener); +}); +Clazz_defineMethod (c$, "fireAncestorAdded", +function (source, id, ancestor, ancestorParent) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.AncestorListener) { +var ancestorEvent = new javax.swing.event.AncestorEvent (source, id, ancestor, ancestorParent); +(listeners[i + 1]).ancestorAdded (ancestorEvent); +}} +}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); +Clazz_defineMethod (c$, "fireAncestorRemoved", +function (source, id, ancestor, ancestorParent) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.AncestorListener) { +var ancestorEvent = new javax.swing.event.AncestorEvent (source, id, ancestor, ancestorParent); +(listeners[i + 1]).ancestorRemoved (ancestorEvent); +}} +}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); +Clazz_defineMethod (c$, "fireAncestorMoved", +function (source, id, ancestor, ancestorParent) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.AncestorListener) { +var ancestorEvent = new javax.swing.event.AncestorEvent (source, id, ancestor, ancestorParent); +(listeners[i + 1]).ancestorMoved (ancestorEvent); +}} +}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); +Clazz_defineMethod (c$, "removeAllListeners", +function () { +this.removeListeners (this.root); +}); +Clazz_defineMethod (c$, "addListeners", +function (ancestor, addToFirst) { +var a; +this.firstInvisibleAncestor = null; +for (a = ancestor; this.firstInvisibleAncestor == null; a = a.getParent ()) { +if (addToFirst || a !== ancestor) { +a.addComponentListener (this); +if (Clazz_instanceOf (a, javax.swing.JComponent)) { +var jAncestor = a; +jAncestor.addPropertyChangeListener (this); +}}if (!a.isVisible () || a.getParent () == null || Clazz_instanceOf (a, java.awt.Window)) { +this.firstInvisibleAncestor = a; +}} +if (Clazz_instanceOf (this.firstInvisibleAncestor, java.awt.Window) && this.firstInvisibleAncestor.isVisible ()) { +this.firstInvisibleAncestor = null; +}}, "java.awt.Component,~B"); +Clazz_defineMethod (c$, "removeListeners", +function (ancestor) { +var a; +for (a = ancestor; a != null; a = a.getParent ()) { +a.removeComponentListener (this); +if (Clazz_instanceOf (a, javax.swing.JComponent)) { +var jAncestor = a; +jAncestor.removePropertyChangeListener (this); +}if (a === this.firstInvisibleAncestor || Clazz_instanceOf (a, java.awt.Window)) { +break; +}} +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "componentResized", +function (e) { +}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "componentMoved", +function (e) { +var source = e.getComponent (); +this.fireAncestorMoved (this.root, 3, source, source.getParent ()); +}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "componentShown", +function (e) { +var ancestor = e.getComponent (); +if (ancestor === this.firstInvisibleAncestor) { +this.addListeners (ancestor, false); +if (this.firstInvisibleAncestor == null) { +this.fireAncestorAdded (this.root, 1, ancestor, ancestor.getParent ()); +}}}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "componentHidden", +function (e) { +var ancestor = e.getComponent (); +var needsNotify = this.firstInvisibleAncestor == null; +if (!(Clazz_instanceOf (ancestor, java.awt.Window))) { +this.removeListeners (ancestor.getParent ()); +}this.firstInvisibleAncestor = ancestor; +if (needsNotify) { +this.fireAncestorRemoved (this.root, 2, ancestor, ancestor.getParent ()); +}}, "java.awt.event.ComponentEvent"); +Clazz_overrideMethod (c$, "propertyChange", +function (evt) { +var s = evt.getPropertyName (); +if (s != null && (s.equals ("parent") || s.equals ("ancestor"))) { +var component = evt.getSource (); +if (evt.getNewValue () != null) { +if (component === this.firstInvisibleAncestor) { +this.addListeners (component, false); +if (this.firstInvisibleAncestor == null) { +this.fireAncestorAdded (this.root, 1, component, component.getParent ()); +}}} else { +var needsNotify = this.firstInvisibleAncestor == null; +var oldParent = evt.getOldValue (); +this.removeListeners (oldParent); +this.firstInvisibleAncestor = component; +if (needsNotify) { +this.fireAncestorRemoved (this.root, 2, component, oldParent); +}}}}, "java.beans.PropertyChangeEvent"); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.awt.AWTEvent"], "javax.swing.event.AncestorEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.ancestor = null; +this.ancestorParent = null; +Clazz_instantialize (this, arguments); +}, javax.swing.event, "AncestorEvent", java.awt.AWTEvent); +Clazz_makeConstructor (c$, +function (source, id, ancestor, ancestorParent) { +Clazz_superConstructor (this, javax.swing.event.AncestorEvent, [source, id]); +this.ancestor = ancestor; +this.ancestorParent = ancestorParent; +}, "javax.swing.JComponent,~N,java.awt.Container,java.awt.Container"); +Clazz_defineMethod (c$, "getAncestor", +function () { +return this.ancestor; +}); +Clazz_defineMethod (c$, "getAncestorParent", +function () { +return this.ancestorParent; +}); +Clazz_defineMethod (c$, "getComponent", +function () { +return this.getSource (); +}); +Clazz_defineStatics (c$, +"ANCESTOR_ADDED", 1, +"ANCESTOR_REMOVED", 2, +"ANCESTOR_MOVED", 3); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.AncestorListener", null, function () { +Clazz_declareInterface (javax.swing.event, "AncestorListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.lang.Enum"], "javax.swing.ClientPropertyKey", null, function () { +c$ = Clazz_declareType (javax.swing, "ClientPropertyKey", Enum); +Clazz_makeConstructor (c$, + function (reportValueNotSerializable) { +}, "~B"); +Clazz_defineEnumConstant (c$, "JComponent_INPUT_VERIFIER", 0, [true]); +Clazz_defineEnumConstant (c$, "JComponent_TRANSFER_HANDLER", 1, [true]); +Clazz_defineEnumConstant (c$, "JComponent_ANCESTOR_NOTIFIER", 2, [true]); +Clazz_defineEnumConstant (c$, "PopupFactory_FORCE_HEAVYWEIGHT_POPUP", 3, [true]); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Dialog", "javax.swing.RootPaneContainer", "$.WindowConstants"], "javax.swing.JDialog", ["java.lang.Boolean", "$.IllegalArgumentException", "javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities", "$.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.defaultCloseOperation = 1; +this.rootPane = null; +this.rootPaneCheckingEnabled = false; +this.transferHandler = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JDialog", java.awt.Dialog, [javax.swing.WindowConstants, javax.swing.RootPaneContainer]); +Clazz_makeConstructor (c$, +function () { +this.construct (Clazz_castNullAs ("java.awt.Frame"), false); +}); +Clazz_makeConstructor (c$, +function (owner) { +this.construct (owner, false); +}, "java.awt.Frame"); +Clazz_makeConstructor (c$, +function (owner, modal) { +this.construct (owner, null, modal); +}, "java.awt.Frame,~B"); +Clazz_makeConstructor (c$, +function (owner, title) { +this.construct (owner, title, false); +}, "java.awt.Frame,~S"); +Clazz_makeConstructor (c$, +function (owner, title, modal) { +Clazz_superConstructor (this, javax.swing.JDialog, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner, title, modal]); +if (owner == null) { +var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); +this.addWindowListener (ownerShutdownListener); +}this.dialogInit (); +}, "java.awt.Frame,~S,~B"); +Clazz_makeConstructor (c$, +function (owner, title, modal, gc) { +Clazz_superConstructor (this, javax.swing.JDialog, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner, title, modal, gc]); +if (owner == null) { +var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); +this.addWindowListener (ownerShutdownListener); +}this.dialogInit (); +}, "java.awt.Frame,~S,~B,java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (owner) { +this.construct (owner, false); +}, "java.awt.Dialog"); +Clazz_makeConstructor (c$, +function (owner, modal) { +this.construct (owner, null, modal); +}, "java.awt.Dialog,~B"); +Clazz_makeConstructor (c$, +function (owner, title) { +this.construct (owner, title, false); +}, "java.awt.Dialog,~S"); +Clazz_makeConstructor (c$, +function (owner, title, modal) { +Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modal]); +this.dialogInit (); +}, "java.awt.Dialog,~S,~B"); +Clazz_makeConstructor (c$, +function (owner, title, modal, gc) { +Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modal, gc]); +this.dialogInit (); +}, "java.awt.Dialog,~S,~B,java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (owner) { +this.construct (owner, java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Window"); +Clazz_makeConstructor (c$, +function (owner, modalityType) { +this.construct (owner, null, modalityType); +}, "java.awt.Window,java.awt.Dialog.ModalityType"); +Clazz_makeConstructor (c$, +function (owner, title) { +this.construct (owner, title, java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Window,~S"); +Clazz_makeConstructor (c$, +function (owner, title, modalityType) { +Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modalityType]); +this.dialogInit (); +}, "java.awt.Window,~S,java.awt.Dialog.ModalityType"); +Clazz_makeConstructor (c$, +function (owner, title, modalityType, gc) { +Clazz_superConstructor (this, javax.swing.JDialog, [owner, title, modalityType, gc]); +this.dialogInit (); +}, "java.awt.Window,~S,java.awt.Dialog.ModalityType,java.awt.GraphicsConfiguration"); +Clazz_defineMethod (c$, "dialogInit", +function () { +this.enableEvents (72); +this.setLocale (javax.swing.JComponent.getDefaultLocale ()); +this.setRootPane (this.createRootPane ()); +this.setRootPaneCheckingEnabled (true); +if (javax.swing.JDialog.isDefaultLookAndFeelDecorated ()) { +var supportsWindowDecorations = javax.swing.UIManager.getLookAndFeel ().getSupportsWindowDecorations (); +if (supportsWindowDecorations) { +this.setUndecorated (true); +this.getRootPane ().setWindowDecorationStyle (2); +}}}); +Clazz_defineMethod (c$, "createRootPane", +function () { +var rp = new javax.swing.JRootPane (); +rp.setOpaque (true); +return rp; +}); +Clazz_defineMethod (c$, "processWindowEvent", +function (e) { +Clazz_superCall (this, javax.swing.JDialog, "processWindowEvent", [e]); +if (e.getID () == 201) { +switch (this.defaultCloseOperation) { +case 1: +this.setVisible (false); +break; +case 2: +this.dispose (); +break; +case 0: +default: +break; +} +}}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "setDefaultCloseOperation", +function (operation) { +if (operation != 0 && operation != 1 && operation != 2) { +throw new IllegalArgumentException ("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, or DISPOSE_ON_CLOSE"); +}var oldValue = this.defaultCloseOperation; +this.defaultCloseOperation = operation; +this.firePropertyChangeInt ("defaultCloseOperation", oldValue, operation); +}, "~N"); +Clazz_defineMethod (c$, "getDefaultCloseOperation", +function () { +return this.defaultCloseOperation; +}); +Clazz_defineMethod (c$, "setTransferHandler", +function (newHandler) { +var oldHandler = this.transferHandler; +this.transferHandler = newHandler; +javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); +this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); +}, "javax.swing.TransferHandler"); +Clazz_defineMethod (c$, "getTransferHandler", +function () { +return this.transferHandler; +}); +Clazz_overrideMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "setJMenuBar", +function (menu) { +this.getRootPane ().setMenuBar (menu); +}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "getJMenuBar", +function () { +return this.getRootPane ().getMenuBar (); +}); +Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", +function () { +return this.rootPaneCheckingEnabled; +}); +Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", +function (enabled) { +this.rootPaneCheckingEnabled = enabled; +}, "~B"); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +if (this.isRootPaneCheckingEnabled ()) { +return this.getContentPane ().add (comp, constraints, index); +}return this.addImplSAEM (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "remove", +function (comp) { +if (comp === this.rootPane) { +this.removeChild (comp); +} else { +this.getContentPane ().removeChild (comp); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "setLayout", +function (manager) { +if (this.isRootPaneCheckingEnabled ()) { +this.getContentPane ().setLayout (manager); +} else { +Clazz_superCall (this, javax.swing.JDialog, "setLayout", [manager]); +}}, "java.awt.LayoutManager"); +Clazz_overrideMethod (c$, "getRootPane", +function () { +return this.rootPane; +}); +Clazz_defineMethod (c$, "setRootPane", +function (root) { +if (this.rootPane != null) { +this.remove (this.rootPane); +}this.rootPane = root; +if (this.rootPane != null) { +var checkingEnabled = this.isRootPaneCheckingEnabled (); +try { +this.setRootPaneCheckingEnabled (false); +this.add (this.rootPane, "Center"); +} finally { +this.setRootPaneCheckingEnabled (checkingEnabled); +} +}}, "javax.swing.JRootPane"); +Clazz_overrideMethod (c$, "getContentPane", +function () { +return this.getRootPane ().getContentPane (); +}); +Clazz_overrideMethod (c$, "setContentPane", +function (contentPane) { +this.getRootPane ().setContentPane (contentPane); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayeredPane", +function () { +return this.getRootPane ().getLayeredPane (); +}); +Clazz_overrideMethod (c$, "setLayeredPane", +function (layeredPane) { +this.getRootPane ().setLayeredPane (layeredPane); +}, "javax.swing.JLayeredPane"); +Clazz_overrideMethod (c$, "getGlassPane", +function () { +return this.getRootPane ().getGlassPane (); +}); +Clazz_overrideMethod (c$, "setGlassPane", +function (glassPane) { +this.getRootPane ().setGlassPane (glassPane); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getGraphics", +function () { +javax.swing.JComponent.getGraphicsInvoked (this); +return Clazz_superCall (this, javax.swing.JDialog, "getGraphics", []); +}); +Clazz_defineMethod (c$, "repaint", +function (time, x, y, width, height) { +if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { +javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); +} else { +Clazz_superCall (this, javax.swing.JDialog, "repaint", [time, x, y, width, height]); +}}, "~N,~N,~N,~N,~N"); +c$.setDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "setDefaultLookAndFeelDecorated", +function (defaultLookAndFeelDecorated) { +if (defaultLookAndFeelDecorated) { +javax.swing.SwingUtilities.appContextPut (javax.swing.JDialog.defaultLookAndFeelDecoratedKey, Boolean.TRUE); +} else { +javax.swing.SwingUtilities.appContextPut (javax.swing.JDialog.defaultLookAndFeelDecoratedKey, Boolean.FALSE); +}}, "~B"); +c$.isDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "isDefaultLookAndFeelDecorated", +function () { +var defaultLookAndFeelDecorated = javax.swing.SwingUtilities.appContextGet (javax.swing.JDialog.defaultLookAndFeelDecoratedKey); +if (defaultLookAndFeelDecorated == null) { +defaultLookAndFeelDecorated = Boolean.FALSE; +}return defaultLookAndFeelDecorated.booleanValue (); +}); +Clazz_defineMethod (c$, "paramString", +function () { +var defaultCloseOperationString; +if (this.defaultCloseOperation == 1) { +defaultCloseOperationString = "HIDE_ON_CLOSE"; +} else if (this.defaultCloseOperation == 2) { +defaultCloseOperationString = "DISPOSE_ON_CLOSE"; +} else if (this.defaultCloseOperation == 0) { +defaultCloseOperationString = "DO_NOTHING_ON_CLOSE"; +} else defaultCloseOperationString = ""; +var rootPaneString = (this.rootPane != null ? this.rootPane.toString () : ""); +var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JDialog, "paramString", []) + ",defaultCloseOperation=" + defaultCloseOperationString + ",rootPane=" + rootPaneString + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; +}); +c$.defaultLookAndFeelDecoratedKey = c$.prototype.defaultLookAndFeelDecoratedKey = new Clazz._O (); +}); +Clazz_declarePackage ("java.awt"); +Clazz_load (["java.lang.Enum", "java.awt.Window"], "java.awt.Dialog", ["java.lang.IllegalArgumentException", "java.awt.Frame", "$.IllegalComponentStateException"], function () { +c$ = Clazz_decorateAsClass (function () { +this.resizable = true; +this.undecorated = false; +this.modal = false; +this.modalityType = null; +this.title = null; +this.isInHide = false; +this.isInDispose = false; +Clazz_instantialize (this, arguments); +}, java.awt, "Dialog", java.awt.Window); +Clazz_makeConstructor (c$, +function (owner) { +this.construct (owner, "", false); +}, "java.awt.Frame"); +Clazz_makeConstructor (c$, +function (owner, modal) { +this.construct (owner, "", modal); +}, "java.awt.Frame,~B"); +Clazz_makeConstructor (c$, +function (owner, title) { +this.construct (owner, title, false); +}, "java.awt.Frame,~S"); +Clazz_makeConstructor (c$, +function (owner, title, modal) { +this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Frame,~S,~B"); +Clazz_makeConstructor (c$, +function (owner, title, modal, gc) { +this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, gc); +}, "java.awt.Frame,~S,~B,java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (owner) { +this.construct (owner, "", false); +}, "java.awt.Dialog"); +Clazz_makeConstructor (c$, +function (owner, title) { +this.construct (owner, title, false); +}, "java.awt.Dialog,~S"); +Clazz_makeConstructor (c$, +function (owner, title, modal) { +this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Dialog,~S,~B"); +Clazz_makeConstructor (c$, +function (owner, title, modal, gc) { +this.construct (owner, title, modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, gc); +}, "java.awt.Dialog,~S,~B,java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (owner) { +this.construct (owner, null, java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Window"); +Clazz_makeConstructor (c$, +function (owner, title) { +this.construct (owner, title, java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Window,~S"); +Clazz_makeConstructor (c$, +function (owner, modalityType) { +this.construct (owner, null, modalityType); +}, "java.awt.Window,java.awt.Dialog.ModalityType"); +Clazz_makeConstructor (c$, +function (owner, title, modalityType) { +Clazz_superConstructor (this, java.awt.Dialog, [owner]); +if ((owner != null) && !(Clazz_instanceOf (owner, java.awt.Frame)) && !(Clazz_instanceOf (owner, java.awt.Dialog))) { +throw new IllegalArgumentException ("Wrong parent window"); +}this.title = title; +this.setModalityType (modalityType); +}, "java.awt.Window,~S,java.awt.Dialog.ModalityType"); +Clazz_makeConstructor (c$, +function (owner, title, modalityType, gc) { +Clazz_superConstructor (this, java.awt.Dialog, [owner, gc]); +if ((owner != null) && !(Clazz_instanceOf (owner, java.awt.Frame)) && !(Clazz_instanceOf (owner, java.awt.Dialog))) { +throw new IllegalArgumentException ("wrong owner window"); +}this.title = title; +this.setModalityType (modalityType); +}, "java.awt.Window,~S,java.awt.Dialog.ModalityType,java.awt.GraphicsConfiguration"); +Clazz_overrideMethod (c$, "constructComponentName", +function () { +{ +return "dialog" + java.awt.Dialog.$nameCounter++; +}}); +Clazz_defineMethod (c$, "addNotify", +function () { +{ +if (this.parent != null) { +this.parent.addNotify (); +}Clazz_superCall (this, java.awt.Dialog, "addNotify", []); +}}); +Clazz_defineMethod (c$, "isModal", +function () { +return this.isModal_NoClientCode (); +}); +Clazz_defineMethod (c$, "isModal_NoClientCode", +function () { +return this.modalityType !== java.awt.Dialog.ModalityType.MODELESS; +}); +Clazz_defineMethod (c$, "setModal", +function (modal) { +this.modal = modal; +this.setModalityType (modal ? java.awt.Dialog.DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS); +}, "~B"); +Clazz_defineMethod (c$, "getModalityType", +function () { +return this.modalityType; +}); +Clazz_defineMethod (c$, "setModalityType", +function (type) { +if (type == null) { +type = java.awt.Dialog.ModalityType.MODELESS; +}if (this.modalityType === type) { +return; +}this.checkModalityPermission (type); +this.modalityType = type; +this.modal = (this.modalityType !== java.awt.Dialog.ModalityType.MODELESS); +}, "java.awt.Dialog.ModalityType"); +Clazz_defineMethod (c$, "getTitle", +function () { +return this.title; +}); +Clazz_defineMethod (c$, "setTitle", +function (title) { +var oldTitle = this.title; +{ +this.title = title; +}this.firePropertyChangeObject ("title", oldTitle, title); +}, "~S"); +Clazz_defineMethod (c$, "show", +function () { +}); +Clazz_defineMethod (c$, "modalityPushed", +function () { +}); +Clazz_defineMethod (c$, "modalityPopped", +function () { +}); +Clazz_defineMethod (c$, "interruptBlocking", +function () { +if (this.isModal ()) { +this.disposeImpl (); +} else if (this.windowClosingException != null) { +this.windowClosingException.fillInStackTrace (); +this.windowClosingException.printStackTrace (); +this.windowClosingException = null; +}}); +Clazz_defineMethod (c$, "hideAndDisposePreHandler", + function () { +this.isInHide = true; +}); +Clazz_defineMethod (c$, "hideAndDisposeHandler", + function () { +this.isInHide = false; +}); +Clazz_defineMethod (c$, "hide", +function () { +this.hideAndDisposePreHandler (); +Clazz_superCall (this, java.awt.Dialog, "hide", []); +if (!this.isInDispose) { +this.hideAndDisposeHandler (); +}}); +Clazz_defineMethod (c$, "doDispose", +function () { +this.isInDispose = true; +Clazz_superCall (this, java.awt.Dialog, "doDispose", []); +this.hideAndDisposeHandler (); +this.isInDispose = false; +}); +Clazz_defineMethod (c$, "isResizable", +function () { +return this.resizable; +}); +Clazz_defineMethod (c$, "setResizable", +function (resizable) { +var testvalid = false; +{ +this.resizable = resizable; +}if (testvalid) { +this.invalidateIfValid (); +}}, "~B"); +Clazz_defineMethod (c$, "setUndecorated", +function (undecorated) { +{ +if (this.isDisplayable ()) { +throw new java.awt.IllegalComponentStateException ("The dialog is displayable."); +}this.undecorated = undecorated; +}}, "~B"); +Clazz_defineMethod (c$, "isUndecorated", +function () { +return this.undecorated; +}); +Clazz_defineMethod (c$, "paramString", +function () { +var str = Clazz_superCall (this, java.awt.Dialog, "paramString", []) + "," + this.modalityType; +if (this.title != null) { +str += ",title=" + this.title; +}return str; +}); +Clazz_defineMethod (c$, "modalShow", +function () { +}); +Clazz_defineMethod (c$, "modalHide", +function () { +}); +Clazz_defineMethod (c$, "shouldBlock", +function (w) { +if (!this.isVisible_NoClientCode () || (!w.isVisible_NoClientCode () && !w.isInShow) || this.isInHide || (w === this) || !this.isModal_NoClientCode ()) { +return false; +}if ((Clazz_instanceOf (w, java.awt.Dialog)) && (w).isInHide) { +return false; +}var blockerToCheck = this; +while (blockerToCheck != null) { +var c = w; +while ((c != null) && (c !== blockerToCheck)) { +c = c.getParent_NoClientCode (); +} +if (c === blockerToCheck) { +return false; +}blockerToCheck = blockerToCheck.getModalBlocker (); +} +switch (this.modalityType) { +case java.awt.Dialog.ModalityType.MODELESS: +return false; +case java.awt.Dialog.ModalityType.DOCUMENT_MODAL: +if (w.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) { +var c = this; +while ((c != null) && (c !== w)) { +c = c.getParent_NoClientCode (); +} +return c === w; +} else { +return this.getDocumentRoot () === w.getDocumentRoot (); +}case java.awt.Dialog.ModalityType.APPLICATION_MODAL: +return !w.isModalExcluded (java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE) && (this.appContext === w.appContext); +case java.awt.Dialog.ModalityType.TOOLKIT_MODAL: +return !w.isModalExcluded (java.awt.Dialog.ModalExclusionType.TOOLKIT_EXCLUDE); +} +return false; +}, "java.awt.Window"); +Clazz_defineMethod (c$, "checkModalityPermission", + function (mt) { +}, "java.awt.Dialog.ModalityType"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.Dialog, "ModalityType", Enum); +Clazz_defineEnumConstant (c$, "MODELESS", 0, []); +Clazz_defineEnumConstant (c$, "DOCUMENT_MODAL", 1, []); +Clazz_defineEnumConstant (c$, "APPLICATION_MODAL", 2, []); +Clazz_defineEnumConstant (c$, "TOOLKIT_MODAL", 3, []); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (java.awt.Dialog, "ModalExclusionType", Enum); +Clazz_defineEnumConstant (c$, "NO_EXCLUDE", 0, []); +Clazz_defineEnumConstant (c$, "APPLICATION_EXCLUDE", 1, []); +Clazz_defineEnumConstant (c$, "TOOLKIT_EXCLUDE", 2, []); +c$ = Clazz_p0p (); +c$.DEFAULT_MODALITY_TYPE = c$.prototype.DEFAULT_MODALITY_TYPE = java.awt.Dialog.ModalityType.APPLICATION_MODAL; +Clazz_defineStatics (c$, +"$base", "dialog", +"$nameCounter", 0); +}); +Clazz_declarePackage ("javax.swing"); +c$ = Clazz_declareInterface (javax.swing, "WindowConstants"); +Clazz_defineStatics (c$, +"DO_NOTHING_ON_CLOSE", 0, +"HIDE_ON_CLOSE", 1, +"DISPOSE_ON_CLOSE", 2, +"EXIT_ON_CLOSE", 3); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Frame", "javax.swing.RootPaneContainer", "$.WindowConstants"], "javax.swing.JFrame", ["java.lang.Boolean", "$.IllegalArgumentException", "javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities", "$.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.defaultCloseOperation = 1; +this.transferHandler = null; +this.rootPane = null; +this.rootPaneCheckingEnabled = false; +Clazz_instantialize (this, arguments); +}, javax.swing, "JFrame", java.awt.Frame, [javax.swing.WindowConstants, javax.swing.RootPaneContainer]); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JFrame); +this.frameInit (); +}); +Clazz_makeConstructor (c$, +function (gc) { +Clazz_superConstructor (this, javax.swing.JFrame, [gc]); +this.frameInit (); +}, "java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (title) { +Clazz_superConstructor (this, javax.swing.JFrame, [title]); +this.frameInit (); +}, "~S"); +Clazz_makeConstructor (c$, +function (title, gc) { +Clazz_superConstructor (this, javax.swing.JFrame, [title, gc]); +this.frameInit (); +}, "~S,java.awt.GraphicsConfiguration"); +Clazz_defineMethod (c$, "frameInit", +function () { +this.enableEvents (72); +this.setLocale (javax.swing.JComponent.getDefaultLocale ()); +this.setRootPane (this.createRootPane ()); +this.setBackground (javax.swing.UIManager.getColor ("control")); +this.setRootPaneCheckingEnabled (true); +if (javax.swing.JFrame.isDefaultLookAndFeelDecorated ()) { +var supportsWindowDecorations = javax.swing.UIManager.getLookAndFeel ().getSupportsWindowDecorations (); +if (supportsWindowDecorations) { +this.setUndecorated (true); +this.getRootPane ().setWindowDecorationStyle (1); +}}}); +Clazz_defineMethod (c$, "createRootPane", +function () { +var rp = new javax.swing.JRootPane (); +rp.setOpaque (true); +return rp; +}); +Clazz_defineMethod (c$, "processWindowEvent", +function (e) { +Clazz_superCall (this, javax.swing.JFrame, "processWindowEvent", [e]); +if (e.getID () == 201) { +switch (this.defaultCloseOperation) { +case 1: +this.setVisible (false); +break; +case 2: +this.dispose (); +break; +case 0: +default: +break; +case 3: +System.exit (0); +break; +} +}}, "java.awt.event.WindowEvent"); +Clazz_defineMethod (c$, "setDefaultCloseOperation", +function (operation) { +if (operation != 0 && operation != 1 && operation != 2 && operation != 3) { +throw new IllegalArgumentException ("defaultCloseOperation must be one of: DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE, DISPOSE_ON_CLOSE, or EXIT_ON_CLOSE"); +}if (this.defaultCloseOperation != operation) { +if (operation == 3) { +var security = System.getSecurityManager (); +if (security != null) { +security.checkExit (0); +}}var oldValue = this.defaultCloseOperation; +this.defaultCloseOperation = operation; +this.firePropertyChangeInt ("defaultCloseOperation", oldValue, operation); +}}, "~N"); +Clazz_defineMethod (c$, "getDefaultCloseOperation", +function () { +return this.defaultCloseOperation; +}); +Clazz_defineMethod (c$, "setTransferHandler", +function (newHandler) { +var oldHandler = this.transferHandler; +this.transferHandler = newHandler; +javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); +this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); +}, "javax.swing.TransferHandler"); +Clazz_defineMethod (c$, "getTransferHandler", +function () { +return this.transferHandler; +}); +Clazz_overrideMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "setJMenuBar", +function (menubar) { +this.getRootPane ().setMenuBar (menubar); +}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "getJMenuBar", +function () { +return this.getRootPane ().getMenuBar (); +}); +Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", +function () { +return this.rootPaneCheckingEnabled; +}); +Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", +function (enabled) { +this.rootPaneCheckingEnabled = enabled; +}, "~B"); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +if (this.isRootPaneCheckingEnabled ()) { +return this.getContentPane ().add (comp, constraints, index); +}return this.addImplSAEM (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "remove", +function (comp) { +if (comp === this.rootPane) { +this.removeChild (comp); +} else { +this.getContentPane ().removeChild (comp); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "setLayout", +function (manager) { +if (this.isRootPaneCheckingEnabled ()) { +this.getContentPane ().setLayout (manager); +} else { +Clazz_superCall (this, javax.swing.JFrame, "setLayout", [manager]); +}}, "java.awt.LayoutManager"); +Clazz_overrideMethod (c$, "getRootPane", +function () { +return this.rootPane; +}); +Clazz_defineMethod (c$, "setRootPane", +function (root) { +if (this.rootPane != null) { +this.remove (this.rootPane); +}this.rootPane = root; +if (this.rootPane != null) { +var checkingEnabled = this.isRootPaneCheckingEnabled (); +try { +this.setRootPaneCheckingEnabled (false); +this.add (this.rootPane, "Center"); +} finally { +this.setRootPaneCheckingEnabled (checkingEnabled); +} +}}, "javax.swing.JRootPane"); +Clazz_overrideMethod (c$, "getContentPane", +function () { +return this.getRootPane ().getContentPane (); +}); +Clazz_overrideMethod (c$, "setContentPane", +function (contentPane) { +this.getRootPane ().setContentPane (contentPane); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayeredPane", +function () { +return this.getRootPane ().getLayeredPane (); +}); +Clazz_overrideMethod (c$, "setLayeredPane", +function (layeredPane) { +this.getRootPane ().setLayeredPane (layeredPane); +}, "javax.swing.JLayeredPane"); +Clazz_overrideMethod (c$, "getGlassPane", +function () { +return this.getRootPane ().getGlassPane (); +}); +Clazz_overrideMethod (c$, "setGlassPane", +function (glassPane) { +this.getRootPane ().setGlassPane (glassPane); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getGraphics", +function () { +javax.swing.JComponent.getGraphicsInvoked (this); +return Clazz_superCall (this, javax.swing.JFrame, "getGraphics", []); +}); +Clazz_defineMethod (c$, "repaint", +function (time, x, y, width, height) { +if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { +javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); +} else { +Clazz_superCall (this, javax.swing.JFrame, "repaint", [time, x, y, width, height]); +}}, "~N,~N,~N,~N,~N"); +c$.setDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "setDefaultLookAndFeelDecorated", +function (defaultLookAndFeelDecorated) { +if (defaultLookAndFeelDecorated) { +javax.swing.SwingUtilities.appContextPut (javax.swing.JFrame.defaultLookAndFeelDecoratedKey, Boolean.TRUE); +} else { +javax.swing.SwingUtilities.appContextPut (javax.swing.JFrame.defaultLookAndFeelDecoratedKey, Boolean.FALSE); +}}, "~B"); +c$.isDefaultLookAndFeelDecorated = Clazz_defineMethod (c$, "isDefaultLookAndFeelDecorated", +function () { +var defaultLookAndFeelDecorated = javax.swing.SwingUtilities.appContextGet (javax.swing.JFrame.defaultLookAndFeelDecoratedKey); +if (defaultLookAndFeelDecorated == null) { +defaultLookAndFeelDecorated = Boolean.FALSE; +}return defaultLookAndFeelDecorated.booleanValue (); +}); +Clazz_defineMethod (c$, "paramString", +function () { +var defaultCloseOperationString; +if (this.defaultCloseOperation == 1) { +defaultCloseOperationString = "HIDE_ON_CLOSE"; +} else if (this.defaultCloseOperation == 2) { +defaultCloseOperationString = "DISPOSE_ON_CLOSE"; +} else if (this.defaultCloseOperation == 0) { +defaultCloseOperationString = "DO_NOTHING_ON_CLOSE"; +} else if (this.defaultCloseOperation == 3) { +defaultCloseOperationString = "EXIT_ON_CLOSE"; +} else defaultCloseOperationString = ""; +var rootPaneString = (this.rootPane != null ? this.rootPane.toString () : ""); +var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JFrame, "paramString", []) + ",defaultCloseOperation=" + defaultCloseOperationString + ",rootPane=" + rootPaneString + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; +}); +Clazz_defineStatics (c$, +"EXIT_ON_CLOSE", 3); +c$.defaultLookAndFeelDecoratedKey = c$.prototype.defaultLookAndFeelDecoratedKey = new Clazz._O (); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Window", "javax.swing.RootPaneContainer"], "javax.swing.JWindow", ["javax.swing.JComponent", "$.JRootPane", "$.RepaintManager", "$.SwingUtilities"], function () { +c$ = Clazz_decorateAsClass (function () { +this.rootPane = null; +this.rootPaneCheckingEnabled = false; +this.transferHandler = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JWindow", java.awt.Window, javax.swing.RootPaneContainer); +Clazz_makeConstructor (c$, +function () { +this.construct (Clazz_castNullAs ("java.awt.Frame")); +}); +Clazz_makeConstructor (c$, +function (gc) { +this.construct (null, gc); +Clazz_superCall (this, javax.swing.JWindow, "setFocusableWindowState", [false]); +}, "java.awt.GraphicsConfiguration"); +Clazz_makeConstructor (c$, +function (owner) { +Clazz_superConstructor (this, javax.swing.JWindow, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner]); +if (owner == null) { +var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); +this.addWindowListener (ownerShutdownListener); +}this.windowInit (); +}, "java.awt.Frame"); +Clazz_makeConstructor (c$, +function (owner) { +Clazz_superConstructor (this, javax.swing.JWindow, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner]); +if (owner == null) { +var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); +this.addWindowListener (ownerShutdownListener); +}this.windowInit (); +}, "java.awt.Window"); +Clazz_makeConstructor (c$, +function (owner, gc) { +Clazz_superConstructor (this, javax.swing.JWindow, [owner == null ? javax.swing.SwingUtilities.getSharedOwnerFrame () : owner, gc]); +if (owner == null) { +var ownerShutdownListener = javax.swing.SwingUtilities.getSharedOwnerFrameShutdownListener (); +this.addWindowListener (ownerShutdownListener); +}this.windowInit (); +}, "java.awt.Window,java.awt.GraphicsConfiguration"); +Clazz_defineMethod (c$, "windowInit", +function () { +this.setLocale (javax.swing.JComponent.getDefaultLocale ()); +this.setRootPane (this.createRootPane ()); +this.setRootPaneCheckingEnabled (true); +}); +Clazz_defineMethod (c$, "createRootPane", +function () { +var rp = new javax.swing.JRootPane (); +rp.setOpaque (true); +return rp; +}); +Clazz_defineMethod (c$, "isRootPaneCheckingEnabled", +function () { +return this.rootPaneCheckingEnabled; +}); +Clazz_defineMethod (c$, "setTransferHandler", +function (newHandler) { +var oldHandler = this.transferHandler; +this.transferHandler = newHandler; +javax.swing.SwingUtilities.installSwingDropTargetAsNecessary (this, this.transferHandler); +this.firePropertyChangeObject ("transferHandler", oldHandler, newHandler); +}, "javax.swing.TransferHandler"); +Clazz_defineMethod (c$, "getTransferHandler", +function () { +return this.transferHandler; +}); +Clazz_overrideMethod (c$, "update", +function (g) { +this.paint (g); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "setRootPaneCheckingEnabled", +function (enabled) { +this.rootPaneCheckingEnabled = enabled; +}, "~B"); +Clazz_overrideMethod (c$, "addImpl", +function (comp, constraints, index) { +if (this.isRootPaneCheckingEnabled ()) { +return this.getContentPane ().add (comp, constraints, index); +}return this.addImplSAEM (comp, constraints, index); +}, "java.awt.Component,~O,~N"); +Clazz_defineMethod (c$, "remove", +function (comp) { +if (comp === this.rootPane) { +this.removeChild (comp); +} else { +this.getContentPane ().removeChild (comp); +}}, "java.awt.Component"); +Clazz_defineMethod (c$, "setLayout", +function (manager) { +if (this.isRootPaneCheckingEnabled ()) { +this.getContentPane ().setLayout (manager); +} else { +Clazz_superCall (this, javax.swing.JWindow, "setLayout", [manager]); +}}, "java.awt.LayoutManager"); +Clazz_overrideMethod (c$, "getRootPane", +function () { +return this.rootPane; +}); +Clazz_defineMethod (c$, "setRootPane", +function (root) { +if (this.rootPane != null) { +this.remove (this.rootPane); +}this.rootPane = root; +if (this.rootPane != null) { +var checkingEnabled = this.isRootPaneCheckingEnabled (); +try { +this.setRootPaneCheckingEnabled (false); +this.add (this.rootPane, "Center"); +} finally { +this.setRootPaneCheckingEnabled (checkingEnabled); +} +}}, "javax.swing.JRootPane"); +Clazz_overrideMethod (c$, "getContentPane", +function () { +return this.getRootPane ().getContentPane (); +}); +Clazz_overrideMethod (c$, "setContentPane", +function (contentPane) { +this.getRootPane ().setContentPane (contentPane); +}, "java.awt.Container"); +Clazz_overrideMethod (c$, "getLayeredPane", +function () { +return this.getRootPane ().getLayeredPane (); +}); +Clazz_overrideMethod (c$, "setLayeredPane", +function (layeredPane) { +this.getRootPane ().setLayeredPane (layeredPane); +}, "javax.swing.JLayeredPane"); +Clazz_overrideMethod (c$, "getGlassPane", +function () { +return this.getRootPane ().getGlassPane (); +}); +Clazz_overrideMethod (c$, "setGlassPane", +function (glassPane) { +this.getRootPane ().setGlassPane (glassPane); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getGraphics", +function () { +javax.swing.JComponent.getGraphicsInvoked (this); +return Clazz_superCall (this, javax.swing.JWindow, "getGraphics", []); +}); +Clazz_defineMethod (c$, "repaint", +function (time, x, y, width, height) { +if (javax.swing.RepaintManager.HANDLE_TOP_LEVEL_PAINT) { +javax.swing.RepaintManager.currentManager (this).addDirtyRegion (this, x, y, width, height); +} else { +Clazz_superCall (this, javax.swing.JWindow, "repaint", [time, x, y, width, height]); +}}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "paramString", +function () { +var rootPaneCheckingEnabledString = (this.rootPaneCheckingEnabled ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JWindow, "paramString", []) + ",rootPaneCheckingEnabled=" + rootPaneCheckingEnabledString; +}); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.util.Hashtable"], "javax.swing.KeyboardManager", ["java.lang.Thread", "java.util.Vector", "java.applet.Applet", "java.awt.Window", "javax.swing.JComponent", "$.JMenuBar", "$.KeyStroke"], function () { +c$ = Clazz_decorateAsClass (function () { +this.containerMap = null; +this.componentKeyStrokeMap = null; +if (!Clazz_isClassDefined ("javax.swing.KeyboardManager.ComponentKeyStrokePair")) { +javax.swing.KeyboardManager.$KeyboardManager$ComponentKeyStrokePair$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "KeyboardManager"); +Clazz_prepareFields (c$, function () { +this.containerMap = new java.util.Hashtable (); +this.componentKeyStrokeMap = new java.util.Hashtable (); +}); +c$.getCurrentManager = Clazz_defineMethod (c$, "getCurrentManager", +function () { +return javax.swing.KeyboardManager.currentManager; +}); +c$.setCurrentManager = Clazz_defineMethod (c$, "setCurrentManager", +function (km) { +javax.swing.KeyboardManager.currentManager = km; +}, "javax.swing.KeyboardManager"); +Clazz_defineMethod (c$, "registerKeyStroke", +function (k, c) { +var topContainer = javax.swing.KeyboardManager.getTopAncestor (c); +if (topContainer == null) { +return; +}var keyMap = this.containerMap.get (topContainer); +if (keyMap == null) { +keyMap = this.registerNewTopContainer (topContainer); +}var tmp = keyMap.get (k); +if (tmp == null) { +keyMap.put (k, c); +} else if (Clazz_instanceOf (tmp, java.util.Vector)) { +var v = tmp; +if (!v.contains (c)) { +v.addElement (c); +}} else if (Clazz_instanceOf (tmp, javax.swing.JComponent)) { +if (tmp !== c) { +var v = new java.util.Vector (); +v.addElement (tmp); +v.addElement (c); +keyMap.put (k, v); +}} else { +System.out.println ("Unexpected condition in registerKeyStroke"); +Thread.dumpStack (); +}this.componentKeyStrokeMap.put (Clazz_innerTypeInstance (javax.swing.KeyboardManager.ComponentKeyStrokePair, this, null, c, k), topContainer); +}, "javax.swing.KeyStroke,javax.swing.JComponent"); +c$.getTopAncestor = Clazz_defineMethod (c$, "getTopAncestor", + function (c) { +for (var p = c.getParent (); p != null; p = p.getParent ()) { +if (Clazz_instanceOf (p, java.awt.Window) && (p).isFocusableWindow () || Clazz_instanceOf (p, java.applet.Applet)) { +return p; +}} +return null; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "unregisterKeyStroke", +function (ks, c) { +var ckp = Clazz_innerTypeInstance (javax.swing.KeyboardManager.ComponentKeyStrokePair, this, null, c, ks); +var topContainer = this.componentKeyStrokeMap.get (ckp); +if (topContainer == null) { +return; +}var keyMap = this.containerMap.get (topContainer); +if (keyMap == null) { +Thread.dumpStack (); +return; +}var tmp = keyMap.get (ks); +if (tmp == null) { +Thread.dumpStack (); +return; +}if (Clazz_instanceOf (tmp, javax.swing.JComponent) && tmp === c) { +keyMap.remove (ks); +} else if (Clazz_instanceOf (tmp, java.util.Vector)) { +var v = tmp; +v.removeElement (c); +if (v.isEmpty ()) { +keyMap.remove (ks); +}}if (keyMap.isEmpty ()) { +this.containerMap.remove (topContainer); +}this.componentKeyStrokeMap.remove (ckp); +}, "javax.swing.KeyStroke,javax.swing.JComponent"); +Clazz_defineMethod (c$, "fireKeyboardAction", +function (e, pressed, topAncestor) { +if (e.isConsumed ()) { +System.out.println ("Aquired pre-used event!"); +Thread.dumpStack (); +}var ks; +if (e.getID () == 400) { +ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyChar ()); +} else { +ks = javax.swing.KeyStroke.getKeyStroke (e.getKeyCode (), e.getModifiers (), !pressed); +}var keyMap = this.containerMap.get (topAncestor); +if (keyMap != null) { +var tmp = keyMap.get (ks); +if (tmp == null) { +} else if (Clazz_instanceOf (tmp, javax.swing.JComponent)) { +var c = tmp; +if (c.isShowing () && c.isEnabled ()) { +this.fireBinding (c, ks, e, pressed); +}} else if (Clazz_instanceOf (tmp, java.util.Vector)) { +var v = tmp; +for (var counter = v.size () - 1; counter >= 0; counter--) { +var c = v.elementAt (counter); +if (c.isShowing () && c.isEnabled ()) { +this.fireBinding (c, ks, e, pressed); +if (e.isConsumed ()) return true; +}} +} else { +System.out.println ("Unexpected condition in fireKeyboardAction " + tmp); +Thread.dumpStack (); +}}if (e.isConsumed ()) { +return true; +}if (keyMap != null) { +var v = keyMap.get (javax.swing.JMenuBar); +if (v != null) { +var iter = v.elements (); +while (iter.hasMoreElements ()) { +var mb = iter.nextElement (); +if (mb.isShowing () && mb.isEnabled ()) { +this.fireBinding (mb, ks, e, pressed); +if (e.isConsumed ()) { +return true; +}}} +}}return e.isConsumed (); +}, "java.awt.event.KeyEvent,~B,java.awt.Container"); +Clazz_defineMethod (c$, "fireBinding", +function (c, ks, e, pressed) { +if (c.processKeyBinding (ks, e, 2, pressed)) { +e.consume (); +}}, "javax.swing.JComponent,javax.swing.KeyStroke,java.awt.event.KeyEvent,~B"); +Clazz_defineMethod (c$, "registerMenuBar", +function (mb) { +var top = javax.swing.KeyboardManager.getTopAncestor (mb); +if (top == null) { +return; +}var keyMap = this.containerMap.get (top); +if (keyMap == null) { +keyMap = this.registerNewTopContainer (top); +}var menuBars = keyMap.get (javax.swing.JMenuBar); +if (menuBars == null) { +menuBars = new java.util.Vector (); +keyMap.put (javax.swing.JMenuBar, menuBars); +}if (!menuBars.contains (mb)) { +menuBars.addElement (mb); +}}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "unregisterMenuBar", +function (mb) { +var topContainer = javax.swing.KeyboardManager.getTopAncestor (mb); +if (topContainer == null) { +return; +}var keyMap = this.containerMap.get (topContainer); +if (keyMap != null) { +var v = keyMap.get (javax.swing.JMenuBar); +if (v != null) { +v.removeElement (mb); +if (v.isEmpty ()) { +keyMap.remove (javax.swing.JMenuBar); +if (keyMap.isEmpty ()) { +this.containerMap.remove (topContainer); +}}}}}, "javax.swing.JMenuBar"); +Clazz_defineMethod (c$, "registerNewTopContainer", +function (topContainer) { +var keyMap = new java.util.Hashtable (); +this.containerMap.put (topContainer, keyMap); +return keyMap; +}, "java.awt.Container"); +c$.$KeyboardManager$ComponentKeyStrokePair$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +this.component = null; +this.keyStroke = null; +Clazz_instantialize (this, arguments); +}, javax.swing.KeyboardManager, "ComponentKeyStrokePair"); +Clazz_makeConstructor (c$, +function (a, b) { +this.component = a; +this.keyStroke = b; +}, "~O,~O"); +Clazz_defineMethod (c$, "equals", +function (a) { +if (!(Clazz_instanceOf (a, javax.swing.KeyboardManager.ComponentKeyStrokePair))) { +return false; +}var b = a; +return ((this.component.equals (b.component)) && (this.keyStroke.equals (b.keyStroke))); +}, "~O"); +Clazz_defineMethod (c$, "hashCode", +function () { +return this.component.hashCode () * this.keyStroke.hashCode (); +}); +c$ = Clazz_p0p (); +}; +c$.currentManager = c$.prototype.currentManager = new javax.swing.KeyboardManager (); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent", "$.MenuElement"], "javax.swing.JMenuBar", ["java.lang.Error", "java.util.Vector", "java.awt.Insets", "javax.swing.DefaultSingleSelectionModel", "$.JMenu", "$.JPopupMenu", "$.KeyboardManager", "$.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.selectionModel = null; +this.$paintBorder = true; +this.margin = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JMenuBar", javax.swing.JComponent, javax.swing.MenuElement); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JMenuBar); +this.setSelectionModel ( new javax.swing.DefaultSingleSelectionModel ()); +this.updateUI (); +}); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "MenuBarUI"; +}); +Clazz_defineMethod (c$, "getSelectionModel", +function () { +return this.selectionModel; +}); +Clazz_defineMethod (c$, "setSelectionModel", +function (model) { +var oldValue = this.selectionModel; +this.selectionModel = model; +this.firePropertyChangeObject ("selectionModel", oldValue, this.selectionModel); +}, "javax.swing.SingleSelectionModel"); +Clazz_defineMethod (c$, "add", +function (c) { +Clazz_superCall (this, javax.swing.JMenuBar, "add", [c]); +return c; +}, "javax.swing.JMenu"); +Clazz_defineMethod (c$, "getMenu", +function (index) { +var c = this.getComponentAtIndex (index); +if (Clazz_instanceOf (c, javax.swing.JMenu)) return c; +return null; +}, "~N"); +Clazz_defineMethod (c$, "getMenuCount", +function () { +return this.getComponentCount (); +}); +Clazz_defineMethod (c$, "setHelpMenu", +function (menu) { +throw new Error ("setHelpMenu() not yet implemented."); +}, "javax.swing.JMenu"); +Clazz_defineMethod (c$, "getHelpMenu", +function () { +throw new Error ("getHelpMenu() not yet implemented."); +}); +Clazz_defineMethod (c$, "getComponentAtIndex", +function (i) { +if (i < 0 || i >= this.getComponentCount ()) { +return null; +}return this.getComponent (i); +}, "~N"); +Clazz_defineMethod (c$, "getComponentIndex", +function (c) { +var ncomponents = this.getComponentCount (); +var component = this.getComponents (); +for (var i = 0; i < ncomponents; i++) { +var comp = component[i]; +if (comp === c) return i; +} +return -1; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "setSelected", +function (sel) { +var model = this.getSelectionModel (); +var index = this.getComponentIndex (sel); +model.setSelectedIndex (index); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "isSelected", +function () { +return this.selectionModel.isSelected (); +}); +Clazz_defineMethod (c$, "isBorderPainted", +function () { +return this.$paintBorder; +}); +Clazz_defineMethod (c$, "setBorderPainted", +function (b) { +var oldValue = this.$paintBorder; +this.$paintBorder = b; +this.firePropertyChangeBool ("borderPainted", oldValue, this.$paintBorder); +if (b != oldValue) { +this.revalidate (); +this.repaint (); +}}, "~B"); +Clazz_defineMethod (c$, "paintBorder", +function (g) { +if (this.isBorderPainted ()) { +Clazz_superCall (this, javax.swing.JMenuBar, "paintBorder", [g]); +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "setMargin", +function (m) { +var old = this.margin; +this.margin = m; +this.firePropertyChangeObject ("margin", old, m); +if (old == null || !old.equals (m)) { +this.revalidate (); +this.repaint (); +}}, "java.awt.Insets"); +Clazz_defineMethod (c$, "getMargin", +function () { +if (this.margin == null) { +return new java.awt.Insets (0, 0, 0, 0); +} else { +return this.margin; +}}); +Clazz_defineMethod (c$, "processMouseEvent", +function (event, path, manager) { +}, "java.awt.event.MouseEvent,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "processKeyEvent", +function (e, path, manager) { +}, "java.awt.event.KeyEvent,~A,javax.swing.MenuSelectionManager"); +Clazz_overrideMethod (c$, "menuSelectionChanged", +function (isIncluded) { +}, "~B"); +Clazz_defineMethod (c$, "getSubElements", +function () { +var result; +var tmp = new java.util.Vector (); +var c = this.getComponentCount (); +var i; +var m; +for (i = 0; i < c; i++) { +m = this.getComponent (i); +if (Clazz_instanceOf (m, javax.swing.MenuElement)) tmp.addElement (m); +} +result = new Array (tmp.size ()); +for (i = 0, c = tmp.size (); i < c; i++) result[i] = tmp.elementAt (i); + +return result; +}); +Clazz_defineMethod (c$, "getComponent", +function () { +return this; +}); +Clazz_defineMethod (c$, "paramString", +function () { +var paintBorderString = (this.$paintBorder ? "true" : "false"); +var marginString = (this.margin != null ? this.margin.toString () : ""); +return Clazz_superCall (this, javax.swing.JMenuBar, "paramString", []) + ",margin=" + marginString + ",paintBorder=" + paintBorderString; +}); +Clazz_defineMethod (c$, "processKeyBinding", +function (ks, e, condition, pressed) { +var retValue = Clazz_superCall (this, javax.swing.JMenuBar, "processKeyBinding", [ks, e, condition, pressed]); +if (!retValue) { +var subElements = this.getSubElements (); +for (var i = 0; i < subElements.length; i++) { +if (javax.swing.JMenuBar.processBindingForKeyStrokeRecursive (subElements[i], ks, e, condition, pressed)) { +return true; +}} +}return retValue; +}, "javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B"); +c$.processBindingForKeyStrokeRecursive = Clazz_defineMethod (c$, "processBindingForKeyStrokeRecursive", +function (elem, ks, e, condition, pressed) { +if (elem == null) { +return false; +}var c = elem.getComponent (); +if (!(c.isVisible () || (Clazz_instanceOf (c, javax.swing.JPopupMenu))) || !c.isEnabled ()) { +return false; +}if (c != null && Clazz_instanceOf (c, javax.swing.JComponent) && (c).processKeyBinding (ks, e, condition, pressed)) { +return true; +}var subElements = elem.getSubElements (); +for (var i = 0; i < subElements.length; i++) { +if (javax.swing.JMenuBar.processBindingForKeyStrokeRecursive (subElements[i], ks, e, condition, pressed)) { +return true; +}} +return false; +}, "javax.swing.MenuElement,javax.swing.KeyStroke,java.awt.event.KeyEvent,~N,~B"); +Clazz_defineMethod (c$, "addNotify", +function () { +Clazz_superCall (this, javax.swing.JMenuBar, "addNotify", []); +javax.swing.KeyboardManager.getCurrentManager ().registerMenuBar (this); +}); +Clazz_defineMethod (c$, "removeNotify", +function () { +Clazz_superCall (this, javax.swing.JMenuBar, "removeNotify", []); +javax.swing.KeyboardManager.getCurrentManager ().unregisterMenuBar (this); +}); +Clazz_defineStatics (c$, +"$uiClassID", "MenuBarUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "MenuElement"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.SingleSelectionModel", "javax.swing.event.EventListenerList"], "javax.swing.DefaultSingleSelectionModel", ["javax.swing.event.ChangeEvent", "$.ChangeListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.changeEvent = null; +this.listenerList = null; +this.index = -1; +Clazz_instantialize (this, arguments); +}, javax.swing, "DefaultSingleSelectionModel", null, javax.swing.SingleSelectionModel); +Clazz_prepareFields (c$, function () { +this.listenerList = new javax.swing.event.EventListenerList (); +}); +Clazz_overrideMethod (c$, "getSelectedIndex", +function () { +return this.index; +}); +Clazz_overrideMethod (c$, "setSelectedIndex", +function (index) { +if (this.index != index) { +this.index = index; +this.fireStateChanged (); +}}, "~N"); +Clazz_overrideMethod (c$, "clearSelection", +function () { +this.setSelectedIndex (-1); +}); +Clazz_overrideMethod (c$, "isSelected", +function () { +var ret = false; +if (this.getSelectedIndex () != -1) { +ret = true; +}return ret; +}); +Clazz_overrideMethod (c$, "addChangeListener", +function (l) { +this.listenerList.add (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_overrideMethod (c$, "removeChangeListener", +function (l) { +this.listenerList.remove (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "getChangeListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.ChangeListener); +}); +Clazz_defineMethod (c$, "fireStateChanged", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.ChangeListener) { +if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); +(listeners[i + 1]).stateChanged (this.changeEvent); +}} +}); +Clazz_defineMethod (c$, "getListeners", +function (listenerType) { +return this.listenerList.getListeners (listenerType); +}, "Class"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "SingleSelectionModel"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.event.WindowAdapter", "javax.swing.JMenuItem", "$.MenuElement", "javax.swing.event.ChangeListener"], "javax.swing.JMenu", ["java.lang.Error", "$.IllegalArgumentException", "java.util.Vector", "java.awt.Point", "$.Rectangle", "$.Toolkit", "javax.swing.JMenuBar", "$.JPopupMenu", "$.MenuSelectionManager", "$.SwingUtilities", "$.UIManager", "javax.swing.event.MenuEvent", "$.MenuListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.$popupMenu = null; +this.menuChangeListener = null; +this.menuEvent = null; +this.delay = 0; +this.customMenuLocation = null; +this.popupListener = null; +if (!Clazz_isClassDefined ("javax.swing.JMenu.MenuChangeListener")) { +javax.swing.JMenu.$JMenu$MenuChangeListener$ (); +} +if (!Clazz_isClassDefined ("javax.swing.JMenu.WinListener")) { +javax.swing.JMenu.$JMenu$WinListener$ (); +} +Clazz_instantialize (this, arguments); +}, javax.swing, "JMenu", javax.swing.JMenuItem, javax.swing.MenuElement); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JMenu, []); +this.init0 ("", null, -2147483648); +}); +Clazz_makeConstructor (c$, +function (s) { +Clazz_superConstructor (this, javax.swing.JMenu, []); +this.init0 (s, null, -2147483648); +}, "~S"); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, javax.swing.JMenu, []); +this.init0 ("", null, -2147483648); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (s, b) { +Clazz_superConstructor (this, javax.swing.JMenu, []); +this.init0 (s, null, -2147483648); +}, "~S,~B"); +Clazz_overrideMethod (c$, "initFocusability", +function () { +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +if (this.$popupMenu != null) { +this.$popupMenu.setUI (javax.swing.UIManager.getUI (this.$popupMenu)); +}}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "MenuUI"; +}); +Clazz_defineMethod (c$, "setModel", +function (newModel) { +var oldModel = this.getModel (); +Clazz_superCall (this, javax.swing.JMenu, "setModel", [newModel]); +if (oldModel != null && this.menuChangeListener != null) { +oldModel.removeChangeListener (this.menuChangeListener); +this.menuChangeListener = null; +}this.model = newModel; +if (newModel != null) { +this.menuChangeListener = this.createMenuChangeListener (); +newModel.addChangeListener (this.menuChangeListener); +}}, "javax.swing.ButtonModel"); +Clazz_overrideMethod (c$, "isSelected", +function () { +return this.getModel ().isSelected (); +}); +Clazz_overrideMethod (c$, "setSelected", +function (b) { +var model = this.getModel (); +if (b != model.isSelected ()) { +this.getModel ().setSelected (b); +}}, "~B"); +Clazz_defineMethod (c$, "isPopupMenuVisible", +function () { +this.ensurePopupMenuCreated (); +return this.$popupMenu.isVisible (); +}); +Clazz_defineMethod (c$, "setPopupMenuVisible", +function (b) { +var isVisible = this.isPopupMenuVisible (); +if (b != isVisible && (this.isEnabled () || !b)) { +this.ensurePopupMenuCreated (); +if ((b == true) && this.isShowing ()) { +var p = this.getCustomMenuLocation (); +if (p == null) { +p = this.getPopupMenuOrigin (); +}this.getPopupMenu ().show (this, p.x, p.y); +} else { +this.getPopupMenu ().setVisible (false); +}}}, "~B"); +Clazz_defineMethod (c$, "getPopupMenuOrigin", +function () { +var x = 0; +var y = 0; +var pm = this.getPopupMenu (); +var s = this.getSize (); +var pmSize = pm.getSize (); +if (pmSize.width == 0) { +pmSize = pm.getPreferredSize (); +}var position = this.getLocationOnScreen (); +var toolkit = java.awt.Toolkit.getDefaultToolkit (); +var gc = this.getGraphicsConfiguration (); +var screenBounds = new java.awt.Rectangle (toolkit.getScreenSize ()); +if (gc != null) { +screenBounds = gc.getBounds (); +var screenInsets = toolkit.getScreenInsets (gc); +screenBounds.width -= Math.abs (screenInsets.left + screenInsets.right); +screenBounds.height -= Math.abs (screenInsets.top + screenInsets.bottom); +position.x -= Math.abs (screenInsets.left); +position.y -= Math.abs (screenInsets.top); +}var parent = this.getParent (); +if (Clazz_instanceOf (parent, javax.swing.JPopupMenu)) { +var xOffset = javax.swing.UIManager.getInt ("Menu.submenuPopupOffsetX"); +var yOffset = javax.swing.UIManager.getInt ("Menu.submenuPopupOffsetY"); +if (javax.swing.SwingUtilities.isLeftToRight (this)) { +x = s.width + xOffset; +if (position.x + x + pmSize.width >= screenBounds.width + screenBounds.x && screenBounds.width - s.width < 2 * (position.x - screenBounds.x)) { +x = 0 - xOffset - pmSize.width; +}} else { +x = 0 - xOffset - pmSize.width; +if (position.x + x < screenBounds.x && screenBounds.width - s.width > 2 * (position.x - screenBounds.x)) { +x = s.width + xOffset; +}}y = yOffset; +if (position.y + y + pmSize.height >= screenBounds.height + screenBounds.y && screenBounds.height - s.height < 2 * (position.y - screenBounds.y)) { +y = s.height - yOffset - pmSize.height; +}} else { +var xOffset = javax.swing.UIManager.getInt ("Menu.menuPopupOffsetX"); +var yOffset = javax.swing.UIManager.getInt ("Menu.menuPopupOffsetY"); +if (javax.swing.SwingUtilities.isLeftToRight (this)) { +x = xOffset; +if (position.x + x + pmSize.width >= screenBounds.width + screenBounds.x && screenBounds.width - s.width < 2 * (position.x - screenBounds.x)) { +x = s.width - xOffset - pmSize.width; +}} else { +x = s.width - xOffset - pmSize.width; +if (position.x + x < screenBounds.x && screenBounds.width - s.width > 2 * (position.x - screenBounds.x)) { +x = xOffset; +}}y = s.height + yOffset; +if (position.y + y + pmSize.height >= screenBounds.height && screenBounds.height - s.height < 2 * (position.y - screenBounds.y)) { +y = 0 - yOffset - pmSize.height; +}}return new java.awt.Point (x, y); +}); +Clazz_defineMethod (c$, "getDelay", +function () { +return this.delay; +}); +Clazz_defineMethod (c$, "setDelay", +function (d) { +if (d < 0) throw new IllegalArgumentException ("Delay must be a positive integer"); +this.delay = d; +}, "~N"); +Clazz_defineMethod (c$, "ensurePopupMenuCreated", + function () { +if (this.$popupMenu == null) { +this.$popupMenu = new javax.swing.JPopupMenu (); +this.$popupMenu.setInvoker (this); +this.popupListener = this.createWinListener (this.$popupMenu); +}}); +Clazz_defineMethod (c$, "getCustomMenuLocation", + function () { +return this.customMenuLocation; +}); +Clazz_defineMethod (c$, "setMenuLocation", +function (x, y) { +this.customMenuLocation = new java.awt.Point (x, y); +if (this.$popupMenu != null) this.$popupMenu.setLocation (x, y); +}, "~N,~N"); +Clazz_defineMethod (c$, "add", +function (menuItem) { +this.ensurePopupMenuCreated (); +return this.$popupMenu.add (menuItem); +}, "javax.swing.JMenuItem"); +Clazz_defineMethod (c$, "add", +function (c) { +this.ensurePopupMenuCreated (); +this.$popupMenu.add (c); +return c; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "add", +function (c, index) { +this.ensurePopupMenuCreated (); +this.$popupMenu.add (c, index); +return c; +}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "add", +function (s) { +return this.add ( new javax.swing.JMenuItem (s)); +}, "~S"); +Clazz_defineMethod (c$, "add", +function (a) { +var mi = this.createActionComponent (a); +mi.setAction (a); +this.add (mi); +return mi; +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createActionComponent", +function (a) { +var mi = ((Clazz_isClassDefined ("javax.swing.JMenu$1") ? 0 : javax.swing.JMenu.$JMenu$1$ ()), Clazz_innerTypeInstance (javax.swing.JMenu$1, this, null)); +mi.setHorizontalTextPosition (11); +mi.setVerticalTextPosition (0); +return mi; +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createActionChangeListener", +function (b) { +return b.createActionPropertyChangeListener0 (b.getAction ()); +}, "javax.swing.JMenuItem"); +Clazz_defineMethod (c$, "addSeparator", +function () { +this.ensurePopupMenuCreated (); +this.$popupMenu.addSeparator (); +}); +Clazz_defineMethod (c$, "insert", +function (s, pos) { +if (pos < 0) { +throw new IllegalArgumentException ("index less than zero."); +}this.ensurePopupMenuCreated (); +this.$popupMenu.insert ( new javax.swing.JMenuItem (s), pos); +}, "~S,~N"); +Clazz_defineMethod (c$, "insert", +function (mi, pos) { +if (pos < 0) { +throw new IllegalArgumentException ("index less than zero."); +}this.ensurePopupMenuCreated (); +this.$popupMenu.insert (mi, pos); +return mi; +}, "javax.swing.JMenuItem,~N"); +Clazz_defineMethod (c$, "insert", +function (a, pos) { +if (pos < 0) { +throw new IllegalArgumentException ("index less than zero."); +}this.ensurePopupMenuCreated (); +var mi = new javax.swing.JMenuItem (a); +mi.setHorizontalTextPosition (11); +mi.setVerticalTextPosition (0); +this.$popupMenu.insert (mi, pos); +return mi; +}, "javax.swing.Action,~N"); +Clazz_defineMethod (c$, "insertSeparator", +function (index) { +if (index < 0) { +throw new IllegalArgumentException ("index less than zero."); +}this.ensurePopupMenuCreated (); +this.$popupMenu.insert ( new javax.swing.JPopupMenu.Separator (), index); +}, "~N"); +Clazz_defineMethod (c$, "getItem", +function (pos) { +if (pos < 0) { +throw new IllegalArgumentException ("index less than zero."); +}var c = this.getMenuComponent (pos); +if (Clazz_instanceOf (c, javax.swing.JMenuItem)) { +var mi = c; +return mi; +}return null; +}, "~N"); +Clazz_defineMethod (c$, "getItemCount", +function () { +return this.getMenuComponentCount (); +}); +Clazz_defineMethod (c$, "isTearOff", +function () { +throw new Error ("boolean isTearOff() {} not yet implemented"); +}); +Clazz_defineMethod (c$, "remove", +function (pos) { +if (pos < 0) { +throw new IllegalArgumentException ("index less than zero."); +}if (pos > this.getItemCount ()) { +throw new IllegalArgumentException ("index greater than the number of items."); +}if (this.$popupMenu != null) this.$popupMenu.remove (pos); +}, "~N"); +Clazz_defineMethod (c$, "remove", +function (c) { +if (Clazz_instanceOf (c, javax.swing.JMenuItem)) if (this.$popupMenu != null) this.$popupMenu.remove (c); +if (this.$popupMenu != null) this.$popupMenu.remove (c); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "removeAll", +function () { +if (this.$popupMenu != null) this.$popupMenu.removeAll (); +}); +Clazz_defineMethod (c$, "getMenuComponentCount", +function () { +var componentCount = 0; +if (this.$popupMenu != null) componentCount = this.$popupMenu.getComponentCount (); +return componentCount; +}); +Clazz_defineMethod (c$, "getMenuComponent", +function (n) { +if (this.$popupMenu != null) return this.$popupMenu.getComponent (n); +return null; +}, "~N"); +Clazz_defineMethod (c$, "getMenuComponents", +function () { +if (this.$popupMenu != null) return this.$popupMenu.getComponents (); +return new Array (0); +}); +Clazz_defineMethod (c$, "isTopLevelMenu", +function () { +if (Clazz_instanceOf (this.getParent (), javax.swing.JMenuBar)) return true; +return false; +}); +Clazz_defineMethod (c$, "isMenuComponent", +function (c) { +if (c === this) return true; +if (Clazz_instanceOf (c, javax.swing.JPopupMenu)) { +var comp = c; +if (comp === this.getPopupMenu ()) return true; +}var ncomponents = this.getMenuComponentCount (); +var component = this.getMenuComponents (); +for (var i = 0; i < ncomponents; i++) { +var comp = component[i]; +if (comp === c) return true; +if (Clazz_instanceOf (comp, javax.swing.JMenu)) { +var subMenu = comp; +if (subMenu.isMenuComponent (c)) return true; +}} +return false; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getPopupMenu", +function () { +this.ensurePopupMenuCreated (); +return this.$popupMenu; +}); +Clazz_defineMethod (c$, "addMenuListener", +function (l) { +this.listenerList.add (javax.swing.event.MenuListener, l); +}, "javax.swing.event.MenuListener"); +Clazz_defineMethod (c$, "removeMenuListener", +function (l) { +this.listenerList.remove (javax.swing.event.MenuListener, l); +}, "javax.swing.event.MenuListener"); +Clazz_defineMethod (c$, "getMenuListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.MenuListener); +}); +Clazz_defineMethod (c$, "fireMenuSelected", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuListener) { +if (listeners[i + 1] == null) { +throw new Error (this.getText () + " has a NULL Listener!! " + i); +} else { +if (this.menuEvent == null) this.menuEvent = new javax.swing.event.MenuEvent (this); +(listeners[i + 1]).menuSelected (this.menuEvent); +}}} +}); +Clazz_defineMethod (c$, "fireMenuDeselected", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuListener) { +if (listeners[i + 1] == null) { +throw new Error (this.getText () + " has a NULL Listener!! " + i); +} else { +if (this.menuEvent == null) this.menuEvent = new javax.swing.event.MenuEvent (this); +(listeners[i + 1]).menuDeselected (this.menuEvent); +}}} +}); +Clazz_defineMethod (c$, "fireMenuCanceled", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuListener) { +if (listeners[i + 1] == null) { +throw new Error (this.getText () + " has a NULL Listener!! " + i); +} else { +if (this.menuEvent == null) this.menuEvent = new javax.swing.event.MenuEvent (this); +(listeners[i + 1]).menuCanceled (this.menuEvent); +}}} +}); +Clazz_overrideMethod (c$, "configureAcceleratorFromAction", +function (a) { +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createMenuChangeListener", + function () { +return Clazz_innerTypeInstance (javax.swing.JMenu.MenuChangeListener, this, null); +}); +Clazz_defineMethod (c$, "createWinListener", +function (p) { +return Clazz_innerTypeInstance (javax.swing.JMenu.WinListener, this, null, p); +}, "javax.swing.JPopupMenu"); +Clazz_overrideMethod (c$, "menuSelectionChanged", +function (isIncluded) { +this.setSelected (isIncluded); +}, "~B"); +Clazz_overrideMethod (c$, "getSubElements", +function () { +if (this.$popupMenu == null) return new Array (0); + else { +var result = new Array (1); +result[0] = this.$popupMenu; +return result; +}}); +Clazz_defineMethod (c$, "getComponent", +function () { +return this; +}); +Clazz_defineMethod (c$, "applyComponentOrientation", +function (o) { +Clazz_superCall (this, javax.swing.JMenu, "applyComponentOrientation", [o]); +if (this.$popupMenu != null) { +var ncomponents = this.getMenuComponentCount (); +for (var i = 0; i < ncomponents; ++i) { +this.getMenuComponent (i).applyComponentOrientation (o); +} +this.$popupMenu.setComponentOrientation (o); +}}, "java.awt.ComponentOrientation"); +Clazz_defineMethod (c$, "setComponentOrientation", +function (o) { +Clazz_superCall (this, javax.swing.JMenu, "setComponentOrientation", [o]); +if (this.$popupMenu != null) { +this.$popupMenu.setComponentOrientation (o); +}}, "java.awt.ComponentOrientation"); +Clazz_overrideMethod (c$, "setAccelerator", +function (keyStroke) { +throw new Error ("setAccelerator() is not defined for JMenu. Use setMnemonic() instead."); +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "processKeyEvent", +function (evt) { +javax.swing.MenuSelectionManager.defaultManager ().processKeyEvent (evt); +if (evt.isConsumed ()) return; +Clazz_superCall (this, javax.swing.JMenu, "processKeyEvent", [evt]); +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "doClick", +function (pressTime) { +var me = this.buildMenuElementArray (this); +javax.swing.MenuSelectionManager.defaultManager ().setSelectedPath (me); +}, "~N"); +Clazz_defineMethod (c$, "buildMenuElementArray", + function (leaf) { +var elements = new java.util.Vector (); +var current = leaf.getPopupMenu (); +var pop; +var menu; +var bar; +while (true) { +if (Clazz_instanceOf (current, javax.swing.JPopupMenu)) { +pop = current; +elements.insertElementAt (pop, 0); +current = pop.getInvoker (); +} else if (Clazz_instanceOf (current, javax.swing.JMenu)) { +menu = current; +elements.insertElementAt (menu, 0); +current = menu.getParent (); +} else if (Clazz_instanceOf (current, javax.swing.JMenuBar)) { +bar = current; +elements.insertElementAt (bar, 0); +var me = new Array (elements.size ()); +elements.copyInto (me); +return me; +}} +}, "javax.swing.JMenu"); +c$.$JMenu$MenuChangeListener$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +this.isSelected = false; +Clazz_instantialize (this, arguments); +}, javax.swing.JMenu, "MenuChangeListener", null, javax.swing.event.ChangeListener); +Clazz_overrideMethod (c$, "stateChanged", +function (a) { +var b = a.getSource (); +var c = b.isSelected (); +if (c != this.isSelected) { +if (c == true) { +this.b$["javax.swing.JMenu"].fireMenuSelected (); +} else { +this.b$["javax.swing.JMenu"].fireMenuDeselected (); +}this.isSelected = c; +}}, "javax.swing.event.ChangeEvent"); +c$ = Clazz_p0p (); +}; +c$.$JMenu$WinListener$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +Clazz_prepareCallback (this, arguments); +this.popupMenu = null; +Clazz_instantialize (this, arguments); +}, javax.swing.JMenu, "WinListener", java.awt.event.WindowAdapter); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, javax.swing.JMenu.WinListener, []); +this.popupMenu = a; +}, "javax.swing.JPopupMenu"); +Clazz_overrideMethod (c$, "windowClosing", +function (a) { +this.b$["javax.swing.JMenu"].setSelected (false); +}, "java.awt.event.WindowEvent"); +c$ = Clazz_p0p (); +}; +c$.$JMenu$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing, "JMenu$1", javax.swing.JMenuItem); +Clazz_defineMethod (c$, "createActionPropertyChangeListener", +function (a) { +var pcl = this.b$["javax.swing.JMenu"].createActionChangeListener (this); +if (pcl == null) { +pcl = Clazz_superCall (this, javax.swing.JMenu$1, "createActionPropertyChangeListener", [a]); +}return pcl; +}, "javax.swing.Action"); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"$$uiClassID", "MenuUI"); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.WindowFocusListener", "$.WindowListener", "$.WindowStateListener"], "java.awt.event.WindowAdapter", null, function () { +c$ = Clazz_declareType (java.awt.event, "WindowAdapter", null, [java.awt.event.WindowListener, java.awt.event.WindowStateListener, java.awt.event.WindowFocusListener]); +Clazz_overrideMethod (c$, "windowOpened", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowClosing", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowClosed", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowIconified", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowDeiconified", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowActivated", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowDeactivated", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowStateChanged", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowGainedFocus", +function (e) { +}, "java.awt.event.WindowEvent"); +Clazz_overrideMethod (c$, "windowLostFocus", +function (e) { +}, "java.awt.event.WindowEvent"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.event.FocusListener", "javax.swing.AbstractButton", "$.MenuElement"], "javax.swing.JMenuItem", ["java.lang.Boolean", "javax.swing.DefaultButtonModel", "$.UIManager", "javax.swing.event.MenuDragMouseEvent", "$.MenuDragMouseListener", "$.MenuKeyEvent", "$.MenuKeyListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.isMouseDragged = false; +this.accelerator = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JMenuItem", javax.swing.AbstractButton, javax.swing.MenuElement); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JMenuItem, []); +this.init0 (null, null, -2147483648); +}); +Clazz_makeConstructor (c$, +function (icon) { +Clazz_superConstructor (this, javax.swing.JMenuItem, []); +this.init0 (null, icon, -2147483648); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text) { +Clazz_superConstructor (this, javax.swing.JMenuItem, []); +this.init0 (text, null, -2147483648); +}, "~S"); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, javax.swing.JMenuItem, []); +this.init0 (null, null, -2147483648); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (text, icon) { +Clazz_superConstructor (this, javax.swing.JMenuItem, []); +this.init0 (text, icon, -2147483648); +}, "~S,javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text, mnemonic) { +Clazz_superConstructor (this, javax.swing.JMenuItem, []); +this.init0 (text, null, mnemonic); +}, "~S,~N"); +Clazz_defineMethod (c$, "setModel", +function (newModel) { +Clazz_superCall (this, javax.swing.JMenuItem, "setModel", [newModel]); +if (Clazz_instanceOf (newModel, javax.swing.DefaultButtonModel)) { +(newModel).setMenuItem (true); +}}, "javax.swing.ButtonModel"); +Clazz_defineMethod (c$, "initFocusability", +function () { +this.setFocusable (false); +}); +Clazz_defineMethod (c$, "init0", +function (text, icon, mnemonic) { +this.setModel ( new javax.swing.DefaultButtonModel ()); +this.init (text, icon); +if (mnemonic >= 0) this.setMnemonic (mnemonic); +this.initFocusability (); +}, "~S,javax.swing.Icon,~N"); +Clazz_overrideMethod (c$, "init", +function (text, icon) { +this.updateUI (); +if (text != null) this.setText (text); +if (icon != null) this.setIcon (icon); +this.addFocusListener ( new javax.swing.JMenuItem.MenuItemFocusListener ()); +this.setUIProperty ("borderPainted", Boolean.FALSE); +this.setFocusPainted (false); +this.setHorizontalTextPosition (11); +this.setHorizontalAlignment (10); +}, "~S,javax.swing.Icon"); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "MenuItemUI"; +}); +Clazz_defineMethod (c$, "setArmed", +function (b) { +var model = this.getModel (); +if (model.isArmed () != b) { +model.setArmed (b); +}}, "~B"); +Clazz_defineMethod (c$, "isArmed", +function () { +var model = this.getModel (); +return model.isArmed (); +}); +Clazz_defineMethod (c$, "setEnabled", +function (b) { +if (!b && !javax.swing.UIManager.getBoolean ("MenuItem.disabledAreNavigable")) { +this.setArmed (false); +}Clazz_superCall (this, javax.swing.JMenuItem, "setEnabled", [b]); +}, "~B"); +Clazz_overrideMethod (c$, "alwaysOnTop", +function () { +return true; +}); +Clazz_defineMethod (c$, "setAccelerator", +function (keyStroke) { +var oldAccelerator = this.accelerator; +this.accelerator = keyStroke; +this.repaint (); +this.revalidate (); +this.firePropertyChangeObject ("accelerator", oldAccelerator, this.accelerator); +}, "javax.swing.KeyStroke"); +Clazz_defineMethod (c$, "getAccelerator", +function () { +return this.accelerator; +}); +Clazz_defineMethod (c$, "configurePropertiesFromAction", +function (a) { +Clazz_superCall (this, javax.swing.JMenuItem, "configurePropertiesFromAction", [a]); +this.configureAcceleratorFromAction (a); +}, "javax.swing.Action"); +Clazz_overrideMethod (c$, "setIconFromAction", +function (a) { +var icon = null; +if (a != null) { +icon = a.getValue ("SmallIcon"); +}this.setIcon (icon); +}, "javax.swing.Action"); +Clazz_overrideMethod (c$, "largeIconChanged", +function (a) { +}, "javax.swing.Action"); +Clazz_overrideMethod (c$, "smallIconChanged", +function (a) { +this.setIconFromAction (a); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "configureAcceleratorFromAction", +function (a) { +var ks = (a == null) ? null : a.getValue ("AcceleratorKey"); +this.setAccelerator (ks); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "actionPropertyChanged", +function (action, propertyName) { +if (propertyName === "AcceleratorKey") { +this.configureAcceleratorFromAction (action); +} else { +Clazz_superCall (this, javax.swing.JMenuItem, "actionPropertyChanged", [action, propertyName]); +}}, "javax.swing.Action,~S"); +Clazz_defineMethod (c$, "processMouseEvent", +function (e, path, manager) { +this.processMenuDragMouseEvent ( new javax.swing.event.MenuDragMouseEvent (e.getComponent (), e.getID (), e.getWhen (), e.getModifiers (), e.getX (), e.getY (), e.getXOnScreen (), e.getYOnScreen (), e.getClickCount (), e.isPopupTrigger (), path, manager)); +}, "java.awt.event.MouseEvent,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "processKeyEvent", +function (e, path, manager) { +var mke = new javax.swing.event.MenuKeyEvent (e.getComponent (), e.getID (), e.getWhen (), e.getModifiers (), e.getKeyCode (), e.getKeyChar (), path, manager); +this.processMenuKeyEvent (mke); +if (mke.isConsumed ()) { +e.consume (); +}}, "java.awt.event.KeyEvent,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "processMenuDragMouseEvent", +function (e) { +switch (e.getID ()) { +case 504: +this.isMouseDragged = false; +this.fireMenuDragMouseEntered (e); +break; +case 505: +this.isMouseDragged = false; +this.fireMenuDragMouseExited (e); +break; +case 506: +this.isMouseDragged = true; +this.fireMenuDragMouseDragged (e); +break; +case 502: +if (this.isMouseDragged) this.fireMenuDragMouseReleased (e); +break; +default: +break; +} +}, "javax.swing.event.MenuDragMouseEvent"); +Clazz_defineMethod (c$, "processMenuKeyEvent", +function (e) { +switch (e.getID ()) { +case 401: +this.fireMenuKeyPressed (e); +break; +case 402: +this.fireMenuKeyReleased (e); +break; +case 400: +this.fireMenuKeyTyped (e); +break; +default: +break; +} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_defineMethod (c$, "fireMenuDragMouseEntered", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuDragMouseListener) { +(listeners[i + 1]).menuDragMouseEntered (event); +}} +}, "javax.swing.event.MenuDragMouseEvent"); +Clazz_defineMethod (c$, "fireMenuDragMouseExited", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuDragMouseListener) { +(listeners[i + 1]).menuDragMouseExited (event); +}} +}, "javax.swing.event.MenuDragMouseEvent"); +Clazz_defineMethod (c$, "fireMenuDragMouseDragged", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuDragMouseListener) { +(listeners[i + 1]).menuDragMouseDragged (event); +}} +}, "javax.swing.event.MenuDragMouseEvent"); +Clazz_defineMethod (c$, "fireMenuDragMouseReleased", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuDragMouseListener) { +(listeners[i + 1]).menuDragMouseReleased (event); +}} +}, "javax.swing.event.MenuDragMouseEvent"); +Clazz_defineMethod (c$, "fireMenuKeyPressed", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuKeyListener) { +(listeners[i + 1]).menuKeyPressed (event); +}} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_defineMethod (c$, "fireMenuKeyReleased", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuKeyListener) { +(listeners[i + 1]).menuKeyReleased (event); +}} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_defineMethod (c$, "fireMenuKeyTyped", +function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuKeyListener) { +(listeners[i + 1]).menuKeyTyped (event); +}} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_overrideMethod (c$, "menuSelectionChanged", +function (isIncluded) { +this.setArmed (isIncluded); +}, "~B"); +Clazz_overrideMethod (c$, "getSubElements", +function () { +return new Array (0); +}); +Clazz_defineMethod (c$, "getComponent", +function () { +return this; +}); +Clazz_defineMethod (c$, "addMenuDragMouseListener", +function (l) { +this.listenerList.add (javax.swing.event.MenuDragMouseListener, l); +}, "javax.swing.event.MenuDragMouseListener"); +Clazz_defineMethod (c$, "removeMenuDragMouseListener", +function (l) { +this.listenerList.remove (javax.swing.event.MenuDragMouseListener, l); +}, "javax.swing.event.MenuDragMouseListener"); +Clazz_defineMethod (c$, "getMenuDragMouseListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.MenuDragMouseListener); +}); +Clazz_defineMethod (c$, "addMenuKeyListener", +function (l) { +this.listenerList.add (javax.swing.event.MenuKeyListener, l); +}, "javax.swing.event.MenuKeyListener"); +Clazz_defineMethod (c$, "removeMenuKeyListener", +function (l) { +this.listenerList.remove (javax.swing.event.MenuKeyListener, l); +}, "javax.swing.event.MenuKeyListener"); +Clazz_defineMethod (c$, "getMenuKeyListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.MenuKeyListener); +}); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.JMenuItem, "MenuItemFocusListener", null, java.awt.event.FocusListener); +Clazz_overrideMethod (c$, "focusGained", +function (a) { +}, "java.awt.event.FocusEvent"); +Clazz_overrideMethod (c$, "focusLost", +function (a) { +var b = a.getSource (); +if (b.isFocusPainted ()) { +b.repaint (); +}}, "java.awt.event.FocusEvent"); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"$uiClassID", "MenuItemUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JMenuItem", "$.SwingConstants"], "javax.swing.JCheckBoxMenuItem", ["javax.swing.JToggleButton"], function () { +c$ = Clazz_declareType (javax.swing, "JCheckBoxMenuItem", javax.swing.JMenuItem, javax.swing.SwingConstants); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, false); +}); +Clazz_makeConstructor (c$, +function (icon) { +this.construct (null, icon, false); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text) { +this.construct (text, null, false); +}, "~S"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (text, icon) { +this.construct (text, icon, false); +}, "~S,javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text, b) { +this.construct (text, null, b); +}, "~S,~B"); +Clazz_makeConstructor (c$, +function (text, icon, b) { +Clazz_superConstructor (this, javax.swing.JCheckBoxMenuItem, [text, icon]); +this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ()); +this.setSelected (b); +this.setFocusable (false); +}, "~S,javax.swing.Icon,~B"); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "CheckBoxMenuItemUI"; +}); +Clazz_defineMethod (c$, "getState", +function () { +return this.isSelected (); +}); +Clazz_defineMethod (c$, "setState", +function (b) { +this.setSelected (b); +}, "~B"); +Clazz_overrideMethod (c$, "getSelectedObjects", +function () { +if (this.isSelected () == false) return null; +var selectedObjects = new Array (1); +selectedObjects[0] = this.getText (); +return selectedObjects; +}); +Clazz_overrideMethod (c$, "shouldUpdateSelectedStateFromAction", +function () { +return true; +}); +Clazz_defineStatics (c$, +"$$uiClassID", "CheckBoxMenuItemUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JMenuItem"], "javax.swing.JRadioButtonMenuItem", ["javax.swing.JToggleButton"], function () { +c$ = Clazz_declareType (javax.swing, "JRadioButtonMenuItem", javax.swing.JMenuItem); +Clazz_makeConstructor (c$, +function () { +this.construct (null, null, false); +}); +Clazz_makeConstructor (c$, +function (icon) { +this.construct (null, icon, false); +}, "javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text) { +this.construct (text, null, false); +}, "~S"); +Clazz_makeConstructor (c$, +function (a) { +this.construct (); +this.setAction (a); +}, "javax.swing.Action"); +Clazz_makeConstructor (c$, +function (text, icon) { +this.construct (text, icon, false); +}, "~S,javax.swing.Icon"); +Clazz_makeConstructor (c$, +function (text, selected) { +this.construct (text); +this.setSelected (selected); +}, "~S,~B"); +Clazz_makeConstructor (c$, +function (icon, selected) { +this.construct (null, icon, selected); +}, "javax.swing.Icon,~B"); +Clazz_makeConstructor (c$, +function (text, icon, selected) { +Clazz_superConstructor (this, javax.swing.JRadioButtonMenuItem, [text, icon]); +this.setModel ( new javax.swing.JToggleButton.ToggleButtonModel ()); +this.setSelected (selected); +this.setFocusable (false); +}, "~S,javax.swing.Icon,~B"); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "RadioButtonMenuItemUI"; +}); +Clazz_overrideMethod (c$, "shouldUpdateSelectedStateFromAction", +function () { +return true; +}); +Clazz_defineStatics (c$, +"$$uiClassID", "RadioButtonMenuItemUI"); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.MenuDragMouseListener", null, function () { +Clazz_declareInterface (javax.swing.event, "MenuDragMouseListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.awt.event.KeyEvent"], "javax.swing.event.MenuKeyEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.path = null; +this.manager = null; +Clazz_instantialize (this, arguments); +}, javax.swing.event, "MenuKeyEvent", java.awt.event.KeyEvent); +Clazz_makeConstructor (c$, +function (source, id, when, modifiers, keyCode, keyChar, p, m) { +Clazz_superConstructor (this, javax.swing.event.MenuKeyEvent, [source, id, when, modifiers, keyCode, keyChar]); +this.path = p; +this.manager = m; +}, "java.awt.Component,~N,~N,~N,~N,~S,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "getPath", +function () { +return this.path; +}); +Clazz_defineMethod (c$, "getMenuSelectionManager", +function () { +return this.manager; +}); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.MenuKeyListener", null, function () { +Clazz_declareInterface (javax.swing.event, "MenuKeyListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent", "$.JSeparator", "$.MenuElement"], "javax.swing.JPopupMenu", ["java.lang.Boolean", "$.IllegalArgumentException", "java.util.Vector", "java.awt.Dimension", "$.Frame", "$.GraphicsEnvironment", "$.Insets", "$.Point", "javax.swing.DefaultSingleSelectionModel", "$.JMenu", "$.JMenuItem", "$.MenuSelectionManager", "$.PopupFactory", "$.SwingUtilities", "$.UIManager", "javax.swing.event.MenuKeyEvent", "$.MenuKeyListener", "$.PopupMenuEvent", "$.PopupMenuListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.invoker = null; +this.popup = null; +this.frame = null; +this.desiredLocationX = 0; +this.desiredLocationY = 0; +this.label = null; +this.$paintBorder = true; +this.margin = null; +this.lightWeightPopup = true; +this.selectionModel = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JPopupMenu", javax.swing.JComponent, javax.swing.MenuElement); +c$.setDefaultLightWeightPopupEnabled = Clazz_defineMethod (c$, "setDefaultLightWeightPopupEnabled", +function (aFlag) { +javax.swing.SwingUtilities.appContextPut (javax.swing.JPopupMenu.defaultLWPopupEnabledKey, Boolean.$valueOf (aFlag)); +}, "~B"); +c$.getDefaultLightWeightPopupEnabled = Clazz_defineMethod (c$, "getDefaultLightWeightPopupEnabled", +function () { +var b = javax.swing.SwingUtilities.appContextGet (javax.swing.JPopupMenu.defaultLWPopupEnabledKey); +if (b == null) { +javax.swing.SwingUtilities.appContextPut (javax.swing.JPopupMenu.defaultLWPopupEnabledKey, Boolean.TRUE); +return true; +}return b.booleanValue (); +}); +Clazz_makeConstructor (c$, +function () { +this.construct (null); +}); +Clazz_makeConstructor (c$, +function (label) { +Clazz_superConstructor (this, javax.swing.JPopupMenu, []); +this.label = label; +this.lightWeightPopup = javax.swing.JPopupMenu.getDefaultLightWeightPopupEnabled (); +this.setSelectionModel ( new javax.swing.DefaultSingleSelectionModel ()); +this.enableEvents (16); +this.updateUI (); +}, "~S"); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "PopupMenuUI"; +}); +Clazz_defineMethod (c$, "processKeyEvent", +function (evt) { +javax.swing.MenuSelectionManager.defaultManager ().processKeyEvent (evt); +if (evt.isConsumed ()) { +return; +}Clazz_superCall (this, javax.swing.JPopupMenu, "processKeyEvent", [evt]); +}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "getSelectionModel", +function () { +return this.selectionModel; +}); +Clazz_defineMethod (c$, "setSelectionModel", +function (model) { +this.selectionModel = model; +}, "javax.swing.SingleSelectionModel"); +Clazz_defineMethod (c$, "add", +function (menuItem) { +Clazz_superCall (this, javax.swing.JPopupMenu, "add", [menuItem]); +return menuItem; +}, "javax.swing.JMenuItem"); +Clazz_defineMethod (c$, "add", +function (s) { +return this.add ( new javax.swing.JMenuItem (s)); +}, "~S"); +Clazz_defineMethod (c$, "add", +function (a) { +var mi = this.createActionComponent (a); +mi.setAction (a); +this.add (mi); +return mi; +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "adjustPopupLocationToFitScreen", +function (xposition, yposition) { +var p = new java.awt.Point (xposition, yposition); +if (javax.swing.JPopupMenu.popupPostionFixDisabled == true || java.awt.GraphicsEnvironment.isHeadless ()) return p; +return p; +}, "~N,~N"); +Clazz_defineMethod (c$, "createActionComponent", +function (a) { +var mi = ((Clazz_isClassDefined ("javax.swing.JPopupMenu$1") ? 0 : javax.swing.JPopupMenu.$JPopupMenu$1$ ()), Clazz_innerTypeInstance (javax.swing.JPopupMenu$1, this, null)); +mi.setHorizontalTextPosition (11); +mi.setVerticalTextPosition (0); +return mi; +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "createActionChangeListener", +function (b) { +return b.createActionPropertyChangeListener0 (b.getAction ()); +}, "javax.swing.JMenuItem"); +Clazz_defineMethod (c$, "remove", +function (pos) { +if (pos < 0) { +throw new IllegalArgumentException ("index less than zero."); +}if (pos > this.getComponentCount () - 1) { +throw new IllegalArgumentException ("index greater than the number of items."); +}Clazz_superCall (this, javax.swing.JPopupMenu, "remove", [pos]); +}, "~N"); +Clazz_defineMethod (c$, "setLightWeightPopupEnabled", +function (aFlag) { +this.lightWeightPopup = aFlag; +}, "~B"); +Clazz_defineMethod (c$, "isLightWeightPopupEnabled", +function () { +return this.lightWeightPopup; +}); +Clazz_defineMethod (c$, "getLabel", +function () { +return this.label; +}); +Clazz_defineMethod (c$, "setLabel", +function (label) { +var oldValue = this.label; +this.label = label; +this.firePropertyChangeObject ("label", oldValue, label); +this.invalidate (); +this.repaint (); +}, "~S"); +Clazz_defineMethod (c$, "addSeparator", +function () { +this.add ( new javax.swing.JPopupMenu.Separator ()); +}); +Clazz_defineMethod (c$, "insert", +function (a, index) { +var mi = this.createActionComponent (a); +mi.setAction (a); +this.insert (mi, index); +}, "javax.swing.Action,~N"); +Clazz_defineMethod (c$, "insert", +function (component, index) { +if (index < 0) { +throw new IllegalArgumentException ("index less than zero."); +}var nitems = this.getComponentCount (); +var tempItems = new java.util.Vector (); +for (var i = index; i < nitems; i++) { +tempItems.addElement (this.getComponent (index)); +this.remove (index); +} +this.add (component); +for (var i = 0; i < tempItems.size (); i++) { +this.add (tempItems.elementAt (i)); +} +}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "addPopupMenuListener", +function (l) { +this.listenerList.add (javax.swing.event.PopupMenuListener, l); +}, "javax.swing.event.PopupMenuListener"); +Clazz_defineMethod (c$, "removePopupMenuListener", +function (l) { +this.listenerList.remove (javax.swing.event.PopupMenuListener, l); +}, "javax.swing.event.PopupMenuListener"); +Clazz_defineMethod (c$, "getPopupMenuListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.PopupMenuListener); +}); +Clazz_defineMethod (c$, "addMenuKeyListener", +function (l) { +this.listenerList.add (javax.swing.event.MenuKeyListener, l); +}, "javax.swing.event.MenuKeyListener"); +Clazz_defineMethod (c$, "removeMenuKeyListener", +function (l) { +this.listenerList.remove (javax.swing.event.MenuKeyListener, l); +}, "javax.swing.event.MenuKeyListener"); +Clazz_defineMethod (c$, "getMenuKeyListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.MenuKeyListener); +}); +Clazz_defineMethod (c$, "firePopupMenuWillBecomeVisible", +function () { +var listeners = this.listenerList.getListenerList (); +var e = null; +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.PopupMenuListener) { +if (e == null) e = new javax.swing.event.PopupMenuEvent (this); +(listeners[i + 1]).popupMenuWillBecomeVisible (e); +}} +}); +Clazz_defineMethod (c$, "firePopupMenuWillBecomeInvisible", +function () { +var listeners = this.listenerList.getListenerList (); +var e = null; +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.PopupMenuListener) { +if (e == null) e = new javax.swing.event.PopupMenuEvent (this); +(listeners[i + 1]).popupMenuWillBecomeInvisible (e); +}} +}); +Clazz_defineMethod (c$, "firePopupMenuCanceled", +function () { +var listeners = this.listenerList.getListenerList (); +var e = null; +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.PopupMenuListener) { +if (e == null) e = new javax.swing.event.PopupMenuEvent (this); +(listeners[i + 1]).popupMenuCanceled (e); +}} +}); +Clazz_overrideMethod (c$, "alwaysOnTop", +function () { +return true; +}); +Clazz_defineMethod (c$, "pack", +function () { +if (this.popup != null) { +var pref = this.getPreferredSize (); +if (pref == null || pref.width != this.getWidth () || pref.height != this.getHeight ()) { +this.popup = this.getPopup (); +} else { +this.validate (); +}}}); +Clazz_overrideMethod (c$, "setVisible", +function (b) { +if (b == this.isVisible ()) return; +if (b == false) { +var doCanceled = this.getClientProperty ("JPopupMenu.firePopupMenuCanceled"); +if (doCanceled != null && doCanceled === Boolean.TRUE) { +this.putClientProperty ("JPopupMenu.firePopupMenuCanceled", Boolean.FALSE); +this.firePopupMenuCanceled (); +}this.getSelectionModel ().clearSelection (); +} else { +if (this.isPopupMenu ()) { +var me = new Array (1); +me[0] = this; +javax.swing.MenuSelectionManager.defaultManager ().setSelectedPath (me); +}}if (b) { +this.firePopupMenuWillBecomeVisible (); +this.popup = this.getPopup (); +this.firePropertyChangeObject ("visible", Boolean.FALSE, Boolean.TRUE); +} else if (this.popup != null) { +this.firePopupMenuWillBecomeInvisible (); +this.popup.hide (); +this.popup = null; +this.firePropertyChangeObject ("visible", Boolean.TRUE, Boolean.FALSE); +if (this.isPopupMenu ()) { +javax.swing.MenuSelectionManager.defaultManager ().clearSelectedPath (); +}}}, "~B"); +Clazz_defineMethod (c$, "getPopup", + function () { +var oldPopup = this.popup; +if (oldPopup != null) { +oldPopup.hide (); +}var popupFactory = javax.swing.PopupFactory.getSharedInstance (); +if (this.isLightWeightPopupEnabled ()) { +popupFactory.setPopupType (0); +} else { +popupFactory.setPopupType (1); +}var p = this.adjustPopupLocationToFitScreen (this.desiredLocationX, this.desiredLocationY); +this.desiredLocationX = p.x; +this.desiredLocationY = p.y; +var newPopup = this.getUI ().getPopup (this, this.desiredLocationX, this.desiredLocationY); +popupFactory.setPopupType (0); +newPopup.show (); +return newPopup; +}); +Clazz_overrideMethod (c$, "isVisible", +function () { +if (this.popup != null) return true; + else return false; +}); +Clazz_defineMethod (c$, "setLocation", +function (x, y) { +var oldX = this.desiredLocationX; +var oldY = this.desiredLocationY; +this.desiredLocationX = x; +this.desiredLocationY = y; +if (this.popup != null && (x != oldX || y != oldY)) { +this.popup = this.getPopup (); +}}, "~N,~N"); +Clazz_defineMethod (c$, "isPopupMenu", + function () { +return ((this.invoker != null) && !(Clazz_instanceOf (this.invoker, javax.swing.JMenu))); +}); +Clazz_defineMethod (c$, "getInvoker", +function () { +return this.invoker; +}); +Clazz_defineMethod (c$, "setInvoker", +function (invoker) { +var oldInvoker = this.invoker; +this.invoker = invoker; +if ((oldInvoker !== this.invoker) && (this.ui != null)) { +this.ui.uninstallUI (this); +this.ui.installUI (this); +}this.invalidate (); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "show", +function (invoker, x, y) { +this.setInvoker (invoker); +var newFrame = javax.swing.JPopupMenu.getFrame (invoker); +if (newFrame !== this.frame) { +if (newFrame != null) { +this.frame = newFrame; +if (this.popup != null) { +this.setVisible (false); +}}}var invokerOrigin; +if (invoker != null) { +invokerOrigin = invoker.getLocationOnScreen (); +var lx; +var ly; +lx = (invokerOrigin.x) + (x); +ly = (invokerOrigin.y) + (y); +if (lx > 2147483647) lx = 2147483647; +if (lx < -2147483648) lx = -2147483648; +if (ly > 2147483647) ly = 2147483647; +if (ly < -2147483648) ly = -2147483648; +this.setLocation (lx, ly); +} else { +this.setLocation (x, y); +}this.setVisible (true); +}, "java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getRootPopupMenu", +function () { +var mp = this; +while ((mp != null) && (mp.isPopupMenu () != true) && (mp.getInvoker () != null) && (mp.getInvoker ().getParent () != null) && (Clazz_instanceOf (mp.getInvoker ().getParent (), javax.swing.JPopupMenu))) { +mp = mp.getInvoker ().getParent (); +} +return mp; +}); +Clazz_defineMethod (c$, "getComponentAtIndex", +function (i) { +return this.getComponent (i); +}, "~N"); +Clazz_defineMethod (c$, "getComponentIndex", +function (c) { +var ncomponents = this.getComponentCount (); +var component = this.getComponents (); +for (var i = 0; i < ncomponents; i++) { +var comp = component[i]; +if (comp === c) return i; +} +return -1; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "setPopupSize", +function (d) { +var oldSize = this.getPreferredSize (); +this.setPreferredSize (d); +if (this.popup != null) { +var newSize = this.getPreferredSize (); +if (!oldSize.equals (newSize)) { +this.popup = this.getPopup (); +}}}, "java.awt.Dimension"); +Clazz_defineMethod (c$, "setPopupSize", +function (width, height) { +this.setPopupSize ( new java.awt.Dimension (width, height)); +}, "~N,~N"); +Clazz_defineMethod (c$, "setSelected", +function (sel) { +var model = this.getSelectionModel (); +var index = this.getComponentIndex (sel); +model.setSelectedIndex (index); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "isBorderPainted", +function () { +return this.$paintBorder; +}); +Clazz_defineMethod (c$, "setBorderPainted", +function (b) { +this.$paintBorder = b; +this.repaint (); +}, "~B"); +Clazz_defineMethod (c$, "paintBorder", +function (g) { +if (this.isBorderPainted ()) { +Clazz_superCall (this, javax.swing.JPopupMenu, "paintBorder", [g]); +}}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "getMargin", +function () { +if (this.margin == null) { +return new java.awt.Insets (0, 0, 0, 0); +} else { +return this.margin; +}}); +Clazz_defineMethod (c$, "isSubPopupMenu", +function (popup) { +var ncomponents = this.getComponentCount (); +var component = this.getComponents (); +for (var i = 0; i < ncomponents; i++) { +var comp = component[i]; +if (Clazz_instanceOf (comp, javax.swing.JMenu)) { +var menu = comp; +var subPopup = menu.getPopupMenu (); +if (subPopup === popup) return true; +if (subPopup.isSubPopupMenu (popup)) return true; +}} +return false; +}, "javax.swing.JPopupMenu"); +c$.getFrame = Clazz_defineMethod (c$, "getFrame", + function (c) { +var w = c; +while (!(Clazz_instanceOf (w, java.awt.Frame)) && (w != null)) { +w = w.getParent (); +} +return w; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "paramString", +function () { +var labelString = (this.label != null ? this.label : ""); +var paintBorderString = (this.$paintBorder ? "true" : "false"); +var marginString = (this.margin != null ? this.margin.toString () : ""); +var lightWeightPopupEnabledString = (this.isLightWeightPopupEnabled () ? "true" : "false"); +return Clazz_superCall (this, javax.swing.JPopupMenu, "paramString", []) + ",desiredLocationX=" + this.desiredLocationX + ",desiredLocationY=" + this.desiredLocationY + ",label=" + labelString + ",lightWeightPopupEnabled=" + lightWeightPopupEnabledString + ",margin=" + marginString + ",paintBorder=" + paintBorderString; +}); +Clazz_defineMethod (c$, "processMouseEvent", +function (event, path, manager) { +}, "java.awt.event.MouseEvent,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "processKeyEvent", +function (e, path, manager) { +var mke = new javax.swing.event.MenuKeyEvent (e.getComponent (), e.getID (), e.getWhen (), e.getModifiers (), e.getKeyCode (), e.getKeyChar (), path, manager); +this.processMenuKeyEvent (mke); +if (mke.isConsumed ()) { +e.consume (); +}}, "java.awt.event.KeyEvent,~A,javax.swing.MenuSelectionManager"); +Clazz_defineMethod (c$, "processMenuKeyEvent", + function (e) { +switch (e.getID ()) { +case 401: +this.fireMenuKeyPressed (e); +break; +case 402: +this.fireMenuKeyReleased (e); +break; +case 400: +this.fireMenuKeyTyped (e); +break; +default: +break; +} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_defineMethod (c$, "fireMenuKeyPressed", + function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuKeyListener) { +(listeners[i + 1]).menuKeyPressed (event); +}} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_defineMethod (c$, "fireMenuKeyReleased", + function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuKeyListener) { +(listeners[i + 1]).menuKeyReleased (event); +}} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_defineMethod (c$, "fireMenuKeyTyped", + function (event) { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.MenuKeyListener) { +(listeners[i + 1]).menuKeyTyped (event); +}} +}, "javax.swing.event.MenuKeyEvent"); +Clazz_overrideMethod (c$, "menuSelectionChanged", +function (isIncluded) { +if (Clazz_instanceOf (this.invoker, javax.swing.JMenu)) { +var m = this.invoker; +if (isIncluded) m.setPopupMenuVisible (true); + else m.setPopupMenuVisible (false); +}if (this.isPopupMenu () && !isIncluded) this.setVisible (false); +}, "~B"); +Clazz_overrideMethod (c$, "getSubElements", +function () { +var result; +var tmp = new java.util.Vector (); +var c = this.getComponentCount (); +var i; +var m; +for (i = 0; i < c; i++) { +m = this.getComponent (i); +if (Clazz_instanceOf (m, javax.swing.MenuElement)) tmp.addElement (m); +} +result = new Array (tmp.size ()); +for (i = 0, c = tmp.size (); i < c; i++) result[i] = tmp.elementAt (i); + +return result; +}); +Clazz_defineMethod (c$, "getComponent", +function () { +return this; +}); +Clazz_defineMethod (c$, "isPopupTrigger", +function (e) { +return this.getUI ().isPopupTrigger (e); +}, "java.awt.event.MouseEvent"); +c$.$JPopupMenu$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing, "JPopupMenu$1", javax.swing.JMenuItem); +Clazz_defineMethod (c$, "createActionPropertyChangeListener", +function (a) { +var pcl = this.b$["javax.swing.JPopupMenu"].createActionChangeListener (this); +if (pcl == null) { +pcl = Clazz_superCall (this, javax.swing.JPopupMenu$1, "createActionPropertyChangeListener", [a]); +}return pcl; +}, "javax.swing.Action"); +c$ = Clazz_p0p (); +}; +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.JPopupMenu, "Separator", javax.swing.JSeparator); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JPopupMenu.Separator, [0]); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "PopupMenuSeparatorUI"; +}); +c$ = Clazz_p0p (); +Clazz_defineStatics (c$, +"$uiClassID", "PopupMenuUI"); +c$.defaultLWPopupEnabledKey = c$.prototype.defaultLWPopupEnabledKey = new Clazz._O (); +Clazz_defineStatics (c$, +"popupPostionFixDisabled", false); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent", "$.SwingConstants"], "javax.swing.JSeparator", ["java.lang.IllegalArgumentException", "javax.swing.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.orientation = 0; +Clazz_instantialize (this, arguments); +}, javax.swing, "JSeparator", javax.swing.JComponent, javax.swing.SwingConstants); +Clazz_makeConstructor (c$, +function () { +this.construct (0); +}); +Clazz_makeConstructor (c$, +function (orientation) { +Clazz_superConstructor (this, javax.swing.JSeparator, []); +this.checkOrientation (orientation); +this.orientation = orientation; +this.setFocusable (false); +this.updateUI (); +}, "~N"); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "SeparatorUI"; +}); +Clazz_defineMethod (c$, "getOrientation", +function () { +return this.orientation; +}); +Clazz_defineMethod (c$, "setOrientation", +function (orientation) { +if (this.orientation == orientation) { +return; +}var oldValue = this.orientation; +this.checkOrientation (orientation); +this.orientation = orientation; +this.firePropertyChangeInt ("orientation", oldValue, orientation); +this.revalidate (); +this.repaint (); +}, "~N"); +Clazz_defineMethod (c$, "checkOrientation", + function (orientation) { +switch (orientation) { +case 1: +case 0: +break; +default: +throw new IllegalArgumentException ("orientation must be one of: VERTICAL, HORIZONTAL"); +} +}, "~N"); +Clazz_defineMethod (c$, "paramString", +function () { +var orientationString = (this.orientation == 0 ? "HORIZONTAL" : "VERTICAL"); +return Clazz_superCall (this, javax.swing.JSeparator, "paramString", []) + ",orientation=" + orientationString; +}); +Clazz_defineStatics (c$, +"$uiClassID", "SeparatorUI"); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.util.Vector", "javax.swing.event.EventListenerList"], "javax.swing.MenuSelectionManager", ["java.awt.event.MouseEvent", "javax.swing.JComponent", "$.SwingUtilities", "javax.swing.event.ChangeEvent", "$.ChangeListener", "jssun.awt.AppContext"], function () { +c$ = Clazz_decorateAsClass (function () { +this.selection = null; +this.changeEvent = null; +this.listenerList = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "MenuSelectionManager"); +Clazz_prepareFields (c$, function () { +this.selection = new java.util.Vector (); +this.listenerList = new javax.swing.event.EventListenerList (); +}); +c$.defaultManager = Clazz_defineMethod (c$, "defaultManager", +function () { +{ +var context = jssun.awt.AppContext.getAppContext (); +var msm = context.get (javax.swing.MenuSelectionManager.MENU_SELECTION_MANAGER_KEY); +if (msm == null) { +msm = new javax.swing.MenuSelectionManager (); +context.put (javax.swing.MenuSelectionManager.MENU_SELECTION_MANAGER_KEY, msm); +}return msm; +}}); +Clazz_defineMethod (c$, "setSelectedPath", +function (path) { +var i; +var c; +var currentSelectionCount = this.selection.size (); +var firstDifference = 0; +if (path == null) { +path = new Array (0); +}for (i = 0, c = path.length; i < c; i++) { +if (i < currentSelectionCount && this.selection.elementAt (i) === path[i]) firstDifference++; + else break; +} +for (i = currentSelectionCount - 1; i >= firstDifference; i--) { +var me = this.selection.elementAt (i); +this.selection.removeElementAt (i); +me.menuSelectionChanged (false); +} +for (i = firstDifference, c = path.length; i < c; i++) { +if (path[i] != null) { +this.selection.addElement (path[i]); +path[i].menuSelectionChanged (true); +}} +this.fireStateChanged (); +}, "~A"); +Clazz_defineMethod (c$, "getSelectedPath", +function () { +var res = new Array (this.selection.size ()); +var i; +var c; +for (i = 0, c = this.selection.size (); i < c; i++) res[i] = this.selection.elementAt (i); + +return res; +}); +Clazz_defineMethod (c$, "clearSelectedPath", +function () { +if (this.selection.size () > 0) { +this.setSelectedPath (null); +}}); +Clazz_defineMethod (c$, "addChangeListener", +function (l) { +this.listenerList.add (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "removeChangeListener", +function (l) { +this.listenerList.remove (javax.swing.event.ChangeListener, l); +}, "javax.swing.event.ChangeListener"); +Clazz_defineMethod (c$, "getChangeListeners", +function () { +return this.listenerList.getListeners (javax.swing.event.ChangeListener); +}); +Clazz_defineMethod (c$, "fireStateChanged", +function () { +var listeners = this.listenerList.getListenerList (); +for (var i = listeners.length - 2; i >= 0; i -= 2) { +if (listeners[i] === javax.swing.event.ChangeListener) { +if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this); +(listeners[i + 1]).stateChanged (this.changeEvent); +}} +}); +Clazz_defineMethod (c$, "processMouseEvent", +function (event) { +var screenX; +var screenY; +var p; +var i; +var j; +var d; +var mc; +var r2; +var cWidth; +var cHeight; +var menuElement; +var subElements; +var path; +var tmp; +var selectionSize; +p = event.getPoint (); +var source = event.getSource (); +if (!source.isShowing ()) { +return; +}var type = event.getID (); +var modifiers = event.getModifiers (); +if ((type == 504 || type == 505) && ((modifiers & (28)) != 0)) { +return; +}javax.swing.SwingUtilities.convertPointToScreen (p, source); +screenX = p.x; +screenY = p.y; +tmp = this.selection.clone (); +selectionSize = tmp.size (); +var success = false; +for (i = selectionSize - 1; i >= 0 && success == false; i--) { +menuElement = tmp.elementAt (i); +subElements = menuElement.getSubElements (); +path = null; +for (j = 0, d = subElements.length; j < d && success == false; j++) { +if (subElements[j] == null) continue; +mc = subElements[j].getComponent (); +if (!mc.isShowing ()) continue; +if (Clazz_instanceOf (mc, javax.swing.JComponent)) { +cWidth = (mc).getWidth (); +cHeight = (mc).getHeight (); +} else { +r2 = mc.getBounds (); +cWidth = r2.width; +cHeight = r2.height; +}p.x = screenX; +p.y = screenY; +javax.swing.SwingUtilities.convertPointFromScreen (p, mc); +if ((p.x >= 0 && p.x < cWidth && p.y >= 0 && p.y < cHeight)) { +var k; +if (path == null) { +path = new Array (i + 2); +for (k = 0; k <= i; k++) path[k] = tmp.elementAt (k); + +}path[i + 1] = subElements[j]; +var currentSelection = this.getSelectedPath (); +if (currentSelection[currentSelection.length - 1] !== path[i + 1] && (currentSelection.length < 2 || currentSelection[currentSelection.length - 2] !== path[i + 1])) { +var oldMC = currentSelection[currentSelection.length - 1].getComponent (); +var exitEvent = new java.awt.event.MouseEvent (oldMC, 505, event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0); +currentSelection[currentSelection.length - 1].processMouseEvent (exitEvent, path, this); +var enterEvent = new java.awt.event.MouseEvent (mc, 504, event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0); +subElements[j].processMouseEvent (enterEvent, path, this); +}var mouseEvent = new java.awt.event.MouseEvent (mc, event.getID (), event.getWhen (), event.getModifiers (), p.x, p.y, event.getXOnScreen (), event.getYOnScreen (), event.getClickCount (), event.isPopupTrigger (), 0); +subElements[j].processMouseEvent (mouseEvent, path, this); +success = true; +event.consume (); +}} +} +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "componentForPoint", +function (source, sourcePoint) { +var screenX; +var screenY; +var p = sourcePoint; +var i; +var j; +var d; +var mc; +var r2; +var cWidth; +var cHeight; +var menuElement; +var subElements; +var tmp; +var selectionSize; +javax.swing.SwingUtilities.convertPointToScreen (p, source); +screenX = p.x; +screenY = p.y; +tmp = this.selection.clone (); +selectionSize = tmp.size (); +for (i = selectionSize - 1; i >= 0; i--) { +menuElement = tmp.elementAt (i); +subElements = menuElement.getSubElements (); +for (j = 0, d = subElements.length; j < d; j++) { +if (subElements[j] == null) continue; +mc = subElements[j].getComponent (); +if (!mc.isShowing ()) continue; +if (Clazz_instanceOf (mc, javax.swing.JComponent)) { +cWidth = (mc).getWidth (); +cHeight = (mc).getHeight (); +} else { +r2 = mc.getBounds (); +cWidth = r2.width; +cHeight = r2.height; +}p.x = screenX; +p.y = screenY; +javax.swing.SwingUtilities.convertPointFromScreen (p, mc); +if (p.x >= 0 && p.x < cWidth && p.y >= 0 && p.y < cHeight) { +return mc; +}} +} +return null; +}, "java.awt.Component,java.awt.Point"); +Clazz_defineMethod (c$, "processKeyEvent", +function (e) { +var sel2 = new Array (0); +sel2 = this.selection.toArray (sel2); +var selSize = sel2.length; +var path; +if (selSize < 1) { +return; +}for (var i = selSize - 1; i >= 0; i--) { +var elem = sel2[i]; +var subs = elem.getSubElements (); +path = null; +for (var j = 0; j < subs.length; j++) { +if (subs[j] == null || !subs[j].getComponent ().isShowing () || !subs[j].getComponent ().isEnabled ()) { +continue; +}if (path == null) { +path = new Array (i + 2); +System.arraycopy (sel2, 0, path, 0, i + 1); +}path[i + 1] = subs[j]; +subs[j].processKeyEvent (e, path, this); +if (e.isConsumed ()) { +return; +}} +} +path = new Array (1); +path[0] = sel2[0]; +path[0].processKeyEvent (e, path, this); +if (e.isConsumed ()) { +return; +}}, "java.awt.event.KeyEvent"); +Clazz_defineMethod (c$, "isComponentPartOfCurrentMenu", +function (c) { +if (this.selection.size () > 0) { +var me = this.selection.elementAt (0); +return this.isComponentPartOfCurrentMenu (me, c); +} else return false; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "isComponentPartOfCurrentMenu", + function (root, c) { +var children; +var i; +var d; +if (root == null) return false; +if (root.getComponent () === c) return true; + else { +children = root.getSubElements (); +for (i = 0, d = children.length; i < d; i++) { +if (this.isComponentPartOfCurrentMenu (children[i], c)) return true; +} +}return false; +}, "javax.swing.MenuElement,java.awt.Component"); +c$.MENU_SELECTION_MANAGER_KEY = c$.prototype.MENU_SELECTION_MANAGER_KEY = new Clazz._O (); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Panel", "javax.swing.Popup", "$.SwingHeavyWeight", "java.awt.BorderLayout"], "javax.swing.PopupFactory", ["java.lang.Boolean", "$.IllegalArgumentException", "java.util.ArrayList", "$.HashMap", "java.applet.Applet", "java.awt.Container", "$.Insets", "$.Rectangle", "$.Toolkit", "$.Window", "java.awt.event.WindowAdapter", "javax.swing.ClientPropertyKey", "$.JApplet", "$.JComponent", "$.JDialog", "$.JFrame", "$.JLayeredPane", "$.JPanel", "$.JPopupMenu", "$.JRootPane", "$.JSeparator", "$.JToolTip", "$.JWindow", "$.MenuElement", "javax.swing.Popup.DefaultFrame", "$.HeavyWeightWindow", "javax.swing.RootPaneContainer", "$.SwingUtilities"], function () { +c$ = Clazz_decorateAsClass (function () { +this.popupType = 0; +Clazz_instantialize (this, arguments); +}, javax.swing, "PopupFactory"); +c$.setSharedInstance = Clazz_defineMethod (c$, "setSharedInstance", +function (factory) { +if (factory == null) { +throw new IllegalArgumentException ("PopupFactory can not be null"); +}javax.swing.SwingUtilities.appContextPut (javax.swing.PopupFactory.SharedInstanceKey, factory); +}, "javax.swing.PopupFactory"); +c$.getSharedInstance = Clazz_defineMethod (c$, "getSharedInstance", +function () { +var factory = javax.swing.SwingUtilities.appContextGet (javax.swing.PopupFactory.SharedInstanceKey); +if (factory == null) { +factory = new javax.swing.PopupFactory (); +javax.swing.PopupFactory.setSharedInstance (factory); +}return factory; +}); +Clazz_defineMethod (c$, "setPopupType", +function (type) { +this.popupType = type; +}, "~N"); +Clazz_defineMethod (c$, "getPopupType", +function () { +return this.popupType; +}); +Clazz_defineMethod (c$, "getPopup", +function (owner, contents, x, y) { +if (contents == null) { +throw new IllegalArgumentException ("Popup.getPopup must be passed non-null contents"); +}var popupType = this.getPopupType (owner, contents, x, y); +var popup = this.getPopup (owner, contents, x, y, popupType); +if (popup == null) { +popup = this.getPopup (owner, contents, x, y, 2); +}return popup; +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getPopupType", + function (owner, contents, ownerX, ownerY) { +var popupType = this.getPopupType (); +if (owner == null || this.invokerInHeavyWeightPopup (owner)) { +popupType = 2; +} else if (popupType == 0 && !(Clazz_instanceOf (contents, javax.swing.JToolTip)) && !(Clazz_instanceOf (contents, javax.swing.JPopupMenu))) { +popupType = 1; +}var c = owner; +while (c != null) { +if (Clazz_instanceOf (c, javax.swing.JComponent)) { +if ((c).getClientProperty (javax.swing.ClientPropertyKey.PopupFactory_FORCE_HEAVYWEIGHT_POPUP) === Boolean.TRUE) { +popupType = 2; +break; +}}c = c.getParent (); +} +return popupType; +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getPopup", + function (owner, contents, ownerX, ownerY, popupType) { +switch (popupType) { +case 0: +return this.getLightWeightPopup (owner, contents, ownerX, ownerY); +case 1: +return this.getMediumWeightPopup (owner, contents, ownerX, ownerY); +case 2: +return this.getHeavyWeightPopup (owner, contents, ownerX, ownerY); +} +return null; +}, "java.awt.Component,java.awt.Component,~N,~N,~N"); +Clazz_defineMethod (c$, "getLightWeightPopup", + function (owner, contents, ownerX, ownerY) { +return javax.swing.PopupFactory.LightWeightPopup.getLightWeightPopup (owner, contents, ownerX, ownerY); +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getMediumWeightPopup", + function (owner, contents, ownerX, ownerY) { +return javax.swing.PopupFactory.MediumWeightPopup.getMediumWeightPopup (owner, contents, ownerX, ownerY); +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getHeavyWeightPopup", + function (owner, contents, ownerX, ownerY) { +return javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopup (owner, contents, ownerX, ownerY); +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "invokerInHeavyWeightPopup", + function (i) { +if (i != null) { +var parent; +for (parent = i.getParent (); parent != null; parent = parent.getParent ()) { +if (Clazz_instanceOf (parent, javax.swing.Popup.HeavyWeightWindow)) { +return true; +}} +}return false; +}, "java.awt.Component"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.PopupFactory, "HeavyWeightPopup", javax.swing.Popup); +c$.getHeavyWeightPopup = Clazz_defineMethod (c$, "getHeavyWeightPopup", +function (a, b, c, d) { +var e = (a != null) ? javax.swing.SwingUtilities.getWindowAncestor (a) : null; +var f = null; +if (e != null) { +f = javax.swing.PopupFactory.HeavyWeightPopup.getRecycledHeavyWeightPopup (e); +}var g = false; +if (b != null && b.isFocusable ()) { +if (Clazz_instanceOf (b, javax.swing.JPopupMenu)) { +var h = b; +var i = h.getComponents (); +for (var j = 0; j < i.length; j++) { +if (!(Clazz_instanceOf (i[j], javax.swing.MenuElement)) && !(Clazz_instanceOf (i[j], javax.swing.JSeparator))) { +g = true; +break; +}} +}}if (f == null || (f.getComponent ()).getFocusableWindowState () != g) { +if (f != null) { +f._dispose (); +}f = new javax.swing.PopupFactory.HeavyWeightPopup (); +}f.reset (a, b, c, d); +if (g) { +var h = f.getComponent (); +h.setFocusableWindowState (true); +h.setName ("###focusableSwingPopup###"); +}return f; +}, "java.awt.Component,java.awt.Component,~N,~N"); +c$.getRecycledHeavyWeightPopup = Clazz_defineMethod (c$, "getRecycledHeavyWeightPopup", + function (a) { +{ +var b; +var c = javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopupCache (); +if (c.containsKey (a)) { +b = c.get (a); +} else { +return null; +}var d; +if ((d = b.size ()) > 0) { +var e = b.get (0); +b.remove (0); +return e; +}return null; +}}, "java.awt.Window"); +c$.getHeavyWeightPopupCache = Clazz_defineMethod (c$, "getHeavyWeightPopupCache", + function () { +{ +var a = javax.swing.SwingUtilities.appContextGet (javax.swing.PopupFactory.HeavyWeightPopup.heavyWeightPopupCacheKey); +if (a == null) { +a = new java.util.HashMap (2); +javax.swing.SwingUtilities.appContextPut (javax.swing.PopupFactory.HeavyWeightPopup.heavyWeightPopupCacheKey, a); +}return a; +}}); +c$.recycleHeavyWeightPopup = Clazz_defineMethod (c$, "recycleHeavyWeightPopup", + function (a) { +{ +var b; +var c = javax.swing.SwingUtilities.getWindowAncestor (a.getComponent ()); +var d = javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopupCache (); +if (Clazz_instanceOf (c, javax.swing.Popup.DefaultFrame) || !(c).isVisible ()) { +a._dispose (); +return; +} else if (d.containsKey (c)) { +b = d.get (c); +} else { +b = new java.util.ArrayList (); +d.put (c, b); +var e = c; +e.addWindowListener (((Clazz_isClassDefined ("javax.swing.PopupFactory$HeavyWeightPopup$1") ? 0 : javax.swing.PopupFactory.HeavyWeightPopup.$PopupFactory$HeavyWeightPopup$1$ ()), Clazz_innerTypeInstance (javax.swing.PopupFactory$HeavyWeightPopup$1, this, Clazz_cloneFinals ("e", e)))); +}if (b.size () < 5) { +b.add (a); +} else { +a._dispose (); +}}}, "javax.swing.PopupFactory.HeavyWeightPopup"); +Clazz_defineMethod (c$, "hide", +function () { +Clazz_superCall (this, javax.swing.PopupFactory.HeavyWeightPopup, "hide", []); +javax.swing.PopupFactory.HeavyWeightPopup.recycleHeavyWeightPopup (this); +}); +Clazz_defineMethod (c$, "dispose", +function () { +}); +Clazz_defineMethod (c$, "_dispose", +function () { +Clazz_superCall (this, javax.swing.PopupFactory.HeavyWeightPopup, "dispose", []); +}); +c$.$PopupFactory$HeavyWeightPopup$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (javax.swing, "PopupFactory$HeavyWeightPopup$1", java.awt.event.WindowAdapter); +Clazz_overrideMethod (c$, "windowClosed", +function (a) { +var b; +{ +var c = javax.swing.PopupFactory.HeavyWeightPopup.getHeavyWeightPopupCache (); +b = c.remove (this.f$.e); +}if (b != null) { +for (var c = b.size () - 1; c >= 0; c--) { +(b.get (c))._dispose (); +} +}}, "java.awt.event.WindowEvent"); +c$ = Clazz_p0p (); +}; +c$.heavyWeightPopupCacheKey = c$.prototype.heavyWeightPopupCacheKey = new Clazz._O (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.owner = null; +this.x = 0; +this.y = 0; +Clazz_instantialize (this, arguments); +}, javax.swing.PopupFactory, "ContainerPopup", javax.swing.Popup); +Clazz_overrideMethod (c$, "hide", +function () { +var a = this.getComponent (); +if (a != null) { +var b = a.getParent (); +if (b != null) { +var c = a.getBounds (); +b.remove (a); +b.repaint (c.x, c.y, c.width, c.height); +}}this.owner = null; +}); +Clazz_overrideMethod (c$, "pack", +function () { +var a = this.getComponent (); +if (a != null) { +a.setSize (a.getPreferredSize ()); +}}); +Clazz_defineMethod (c$, "reset", +function (a, b, c, d) { +if ((Clazz_instanceOf (a, javax.swing.JFrame)) || (Clazz_instanceOf (a, javax.swing.JDialog)) || (Clazz_instanceOf (a, javax.swing.JWindow))) { +a = (a).getLayeredPane (); +}Clazz_superCall (this, javax.swing.PopupFactory.ContainerPopup, "reset", [a, b, c, d]); +this.x = c; +this.y = d; +this.owner = a; +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "overlappedByOwnedWindow", +function () { +var a = this.getComponent (); +if (this.owner != null && a != null) { +var b = javax.swing.SwingUtilities.getWindowAncestor (this.owner); +if (b == null) { +return false; +}var c = b.getOwnedWindows (); +if (c != null) { +var d = a.getBounds (); +for (var e = 0; e < c.length; e++) { +var f = c[e]; +if (f.isVisible () && d.intersects (f.getBounds ())) { +return true; +}} +}}return false; +}); +Clazz_defineMethod (c$, "fitsOnScreen", +function () { +var a = this.getComponent (); +if (this.owner != null && a != null) { +var b; +var c = a.getWidth (); +var d = a.getHeight (); +for (b = this.owner.getParent (); b != null; b = b.getParent ()) { +if (Clazz_instanceOf (b, javax.swing.JFrame) || Clazz_instanceOf (b, javax.swing.JDialog) || Clazz_instanceOf (b, javax.swing.JWindow)) { +var e = b.getBounds (); +var f = b.getInsets (); +e.x += f.left; +e.y += f.top; +e.width -= (f.left + f.right); +e.height -= (f.top + f.bottom); +var g = b.getGraphicsConfiguration (); +var h = this.getContainerPopupArea (g); +return e.intersection (h).contains (this.x, this.y, c, d); +} else if (Clazz_instanceOf (b, javax.swing.JApplet)) { +var e = b.getBounds (); +var f = b.getLocationOnScreen (); +e.x = f.x; +e.y = f.y; +return e.contains (this.x, this.y, c, d); +} else if (Clazz_instanceOf (b, java.awt.Window) || Clazz_instanceOf (b, java.applet.Applet)) { +break; +}} +}return false; +}); +Clazz_defineMethod (c$, "getContainerPopupArea", +function (a) { +var b; +var c = java.awt.Toolkit.getDefaultToolkit (); +var d; +if (a != null) { +b = a.getBounds (); +d = c.getScreenInsets (a); +} else { +b = new java.awt.Rectangle (c.getScreenSize ()); +d = new java.awt.Insets (0, 0, 0, 0); +}b.x += d.left; +b.y += d.top; +b.width -= (d.left + d.right); +b.height -= (d.top + d.bottom); +return b; +}, "java.awt.GraphicsConfiguration"); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.PopupFactory, "LightWeightPopup", javax.swing.PopupFactory.ContainerPopup); +c$.getLightWeightPopup = Clazz_defineMethod (c$, "getLightWeightPopup", +function (a, b, c, d) { +var e = null; +if (e == null) { +e = new javax.swing.PopupFactory.LightWeightPopup (); +}e.reset (a, b, c, d); +if (!e.fitsOnScreen () || e.overlappedByOwnedWindow ()) { +e.hide (); +return null; +}return e; +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "hide", +function () { +Clazz_superCall (this, javax.swing.PopupFactory.LightWeightPopup, "hide", []); +var a = this.getComponent (); +a.removeAll (); +}); +Clazz_overrideMethod (c$, "show", +function () { +var a = null; +if (this.owner != null) { +a = (Clazz_instanceOf (this.owner, java.awt.Container) ? this.owner : this.owner.getParent ()); +}for (var b = a; b != null; b = b.getParent ()) { +if (Clazz_instanceOf (b, javax.swing.JRootPane)) { +a = (b).getLayeredPane (); +} else if (Clazz_instanceOf (b, java.awt.Window)) { +if (a == null) { +a = b; +}break; +} else if (Clazz_instanceOf (b, javax.swing.JApplet)) { +break; +}} +var c = javax.swing.SwingUtilities.convertScreenLocationToParent (a, this.x, this.y); +var d = this.getComponent (); +d.setLocation (c.x, c.y); +if (Clazz_instanceOf (a, javax.swing.JLayeredPane)) { +(a).add (d, javax.swing.JLayeredPane.POPUP_LAYER, 0); +} else { +a.add (d); +}}); +Clazz_overrideMethod (c$, "createComponent", +function (a) { +var b = new javax.swing.JPanel ( new java.awt.BorderLayout (), true); +b.setOpaque (true); +return b; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "reset", +function (a, b, c, d) { +Clazz_superCall (this, javax.swing.PopupFactory.LightWeightPopup, "reset", [a, b, c, d]); +var e = this.getComponent (); +e.setOpaque (b.isOpaque ()); +e.setLocation (c, d); +e.add (b, "Center"); +b.invalidate (); +this.pack (); +}, "java.awt.Component,java.awt.Component,~N,~N"); +c$.lightWeightPopupCacheKey = c$.prototype.lightWeightPopupCacheKey = new Clazz._O (); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_decorateAsClass (function () { +this.rootPane = null; +Clazz_instantialize (this, arguments); +}, javax.swing.PopupFactory, "MediumWeightPopup", javax.swing.PopupFactory.ContainerPopup); +c$.getMediumWeightPopup = Clazz_defineMethod (c$, "getMediumWeightPopup", +function (a, b, c, d) { +var e = javax.swing.PopupFactory.MediumWeightPopup.getRecycledMediumWeightPopup (); +if (e == null) { +e = new javax.swing.PopupFactory.MediumWeightPopup (); +}e.reset (a, b, c, d); +if (!e.fitsOnScreen () || e.overlappedByOwnedWindow ()) { +e.hide (); +return null; +}return e; +}, "java.awt.Component,java.awt.Component,~N,~N"); +c$.getMediumWeightPopupCache = Clazz_defineMethod (c$, "getMediumWeightPopupCache", + function () { +var a = javax.swing.SwingUtilities.appContextGet (javax.swing.PopupFactory.MediumWeightPopup.mediumWeightPopupCacheKey); +if (a == null) { +a = new java.util.ArrayList (); +javax.swing.SwingUtilities.appContextPut (javax.swing.PopupFactory.MediumWeightPopup.mediumWeightPopupCacheKey, a); +}return a; +}); +c$.recycleMediumWeightPopup = Clazz_defineMethod (c$, "recycleMediumWeightPopup", + function (a) { +{ +var b = javax.swing.PopupFactory.MediumWeightPopup.getMediumWeightPopupCache (); +if (b.size () < 5) { +b.add (a); +}}}, "javax.swing.PopupFactory.MediumWeightPopup"); +c$.getRecycledMediumWeightPopup = Clazz_defineMethod (c$, "getRecycledMediumWeightPopup", + function () { +{ +var a = javax.swing.PopupFactory.MediumWeightPopup.getMediumWeightPopupCache (); +var b; +if ((b = a.size ()) > 0) { +var c = a.get (0); +a.remove (0); +return c; +}return null; +}}); +Clazz_defineMethod (c$, "hide", +function () { +Clazz_superCall (this, javax.swing.PopupFactory.MediumWeightPopup, "hide", []); +this.rootPane.getContentPane ().removeAll (); +javax.swing.PopupFactory.MediumWeightPopup.recycleMediumWeightPopup (this); +}); +Clazz_overrideMethod (c$, "show", +function () { +var a = this.getComponent (); +var b = null; +if (this.owner != null) { +b = this.owner.getParent (); +}while (!(Clazz_instanceOf (b, java.awt.Window) || Clazz_instanceOf (b, java.applet.Applet)) && (b != null)) { +b = b.getParent (); +} +if (Clazz_instanceOf (b, javax.swing.RootPaneContainer)) { +b = (b).getLayeredPane (); +var c = javax.swing.SwingUtilities.convertScreenLocationToParent (b, this.x, this.y); +a.setVisible (false); +a.setLocation (c.x, c.y); +(b).add (a, javax.swing.JLayeredPane.POPUP_LAYER, 0); +} else { +var c = javax.swing.SwingUtilities.convertScreenLocationToParent (b, this.x, this.y); +a.setLocation (c.x, c.y); +a.setVisible (false); +b.add (a); +}a.setVisible (true); +}); +Clazz_overrideMethod (c$, "createComponent", +function (a) { +var b = new javax.swing.PopupFactory.MediumWeightPopup.MediumWeightComponent (); +this.rootPane = new javax.swing.JRootPane (); +this.rootPane.setOpaque (true); +b.add (this.rootPane, "Center"); +return b; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "reset", +function (a, b, c, d) { +Clazz_superCall (this, javax.swing.PopupFactory.MediumWeightPopup, "reset", [a, b, c, d]); +var e = this.getComponent (); +e.setLocation (c, d); +this.rootPane.getContentPane ().add (b, "Center"); +b.invalidate (); +e.validate (); +this.pack (); +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.PopupFactory.MediumWeightPopup, "MediumWeightComponent", java.awt.Panel, javax.swing.SwingHeavyWeight); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.PopupFactory.MediumWeightPopup.MediumWeightComponent, [ new java.awt.BorderLayout ()]); +}); +c$ = Clazz_p0p (); +c$.mediumWeightPopupCacheKey = c$.prototype.mediumWeightPopupCacheKey = new Clazz._O (); +c$ = Clazz_p0p (); +c$.SharedInstanceKey = c$.prototype.SharedInstanceKey = new Clazz._O (); +Clazz_defineStatics (c$, +"MAX_CACHE_SIZE", 5, +"LIGHT_WEIGHT_POPUP", 0, +"MEDIUM_WEIGHT_POPUP", 1, +"HEAVY_WEIGHT_POPUP", 2); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["java.awt.Frame", "javax.swing.JWindow"], "javax.swing.Popup", ["java.lang.IllegalArgumentException", "java.awt.Toolkit", "$.Window", "javax.swing.SwingUtilities", "jssun.awt.SunToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.component = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "Popup"); +Clazz_makeConstructor (c$, +function (owner, contents, x, y) { +this.construct (); +if (contents == null) { +throw new IllegalArgumentException ("Contents must be non-null"); +}this.reset (owner, contents, x, y); +}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "show", +function () { +var component = this.getComponent (); +if (component != null) { +component.show (); +}}); +Clazz_defineMethod (c$, "hide", +function () { +var component = this.getComponent (); +if (Clazz_instanceOf (component, javax.swing.JWindow)) { +component.hide (); +(component).getContentPane ().removeAll (); +}this.dispose (); +}); +Clazz_defineMethod (c$, "dispose", +function () { +var component = this.getComponent (); +var window = javax.swing.SwingUtilities.getWindowAncestor (component); +if (Clazz_instanceOf (component, javax.swing.JWindow)) { +(component).dispose (); +component = null; +}if (Clazz_instanceOf (window, javax.swing.Popup.DefaultFrame)) { +window.dispose (); +}}); +Clazz_defineMethod (c$, "reset", +function (owner, contents, ownerX, ownerY) { +if (this.getComponent () == null) { +this.component = this.createComponent (owner); +}var c = this.getComponent (); +if (Clazz_instanceOf (c, javax.swing.JWindow)) { +var component = this.getComponent (); +component.setLocation (ownerX, ownerY); +component.getContentPane ().add (contents, "Center"); +contents.invalidate (); +if (component.isVisible ()) { +this.pack (); +}}}, "java.awt.Component,java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "pack", +function () { +var component = this.getComponent (); +if (Clazz_instanceOf (component, java.awt.Window)) { +(component).pack (); +}}); +Clazz_defineMethod (c$, "getParentWindow", + function (owner) { +var window = null; +if (Clazz_instanceOf (owner, java.awt.Window)) { +window = owner; +} else if (owner != null) { +window = javax.swing.SwingUtilities.getWindowAncestor (owner); +}if (window == null) { +window = new javax.swing.Popup.DefaultFrame (); +}return window; +}, "java.awt.Component"); +Clazz_defineMethod (c$, "createComponent", +function (owner) { +return new javax.swing.Popup.HeavyWeightWindow (this.getParentWindow (owner)); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getComponent", +function () { +return this.component; +}); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.Popup, "HeavyWeightWindow", javax.swing.JWindow); +Clazz_makeConstructor (c$, +function (a) { +Clazz_superConstructor (this, javax.swing.Popup.HeavyWeightWindow, [a]); +this.setFocusableWindowState (false); +var b = java.awt.Toolkit.getDefaultToolkit (); +if (Clazz_instanceOf (b, jssun.awt.SunToolkit)) { +(b).setOverrideRedirect (this); +}this.getRootPane ().setUseTrueDoubleBuffering (false); +try { +this.setAlwaysOnTop (true); +} catch (se) { +if (Clazz_exceptionOf (se, SecurityException)) { +} else { +throw se; +} +} +}, "java.awt.Window"); +Clazz_overrideMethod (c$, "update", +function (a) { +this.paint (a); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "show", +function () { +this.pack (); +if (this.getWidth () > 0 && this.getHeight () > 0) { +Clazz_superCall (this, javax.swing.Popup.HeavyWeightWindow, "show", []); +}}); +c$ = Clazz_p0p (); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (javax.swing.Popup, "DefaultFrame", java.awt.Frame); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("javax.swing"); +Clazz_declareInterface (javax.swing, "SwingHeavyWeight"); +Clazz_declarePackage ("javax.swing"); +Clazz_load (["javax.swing.JComponent"], "javax.swing.JToolTip", ["javax.swing.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this.tipText = null; +this.$component = null; +Clazz_instantialize (this, arguments); +}, javax.swing, "JToolTip", javax.swing.JComponent); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.JToolTip, []); +this.setOpaque (true); +this.updateUI (); +}); +Clazz_overrideMethod (c$, "getUI", +function () { +return this.ui; +}); +Clazz_overrideMethod (c$, "updateUI", +function () { +this.setUI (javax.swing.UIManager.getUI (this)); +}); +Clazz_overrideMethod (c$, "getUIClassID", +function () { +return "ToolTipUI"; +}); +Clazz_defineMethod (c$, "setTipText", +function (tipText) { +var oldValue = this.tipText; +this.tipText = tipText; +this.firePropertyChangeObject ("tiptext", oldValue, tipText); +}, "~S"); +Clazz_defineMethod (c$, "getTipText", +function () { +return this.tipText; +}); +Clazz_defineMethod (c$, "setComponent", +function (c) { +var oldValue = this.$component; +this.$component = c; +this.firePropertyChangeObject ("component", oldValue, c); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "getComponent", +function () { +return this.$component; +}); +Clazz_overrideMethod (c$, "alwaysOnTop", +function () { +return true; +}); +Clazz_defineMethod (c$, "paramString", +function () { +var tipTextString = (this.tipText != null ? this.tipText : ""); +return Clazz_superCall (this, javax.swing.JToolTip, "paramString", []) + ",tipText=" + tipTextString; +}); +Clazz_defineStatics (c$, +"$uiClassID", "ToolTipUI"); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventObject"], "javax.swing.event.PopupMenuEvent", null, function () { +c$ = Clazz_declareType (javax.swing.event, "PopupMenuEvent", java.util.EventObject); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.PopupMenuListener", null, function () { +Clazz_declareInterface (javax.swing.event, "PopupMenuListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventObject"], "javax.swing.event.MenuEvent", null, function () { +c$ = Clazz_declareType (javax.swing.event, "MenuEvent", java.util.EventObject); +}); +Clazz_declarePackage ("javax.swing.event"); +Clazz_load (["java.util.EventListener"], "javax.swing.event.MenuListener", null, function () { +Clazz_declareInterface (javax.swing.event, "MenuListener", java.util.EventListener); +}); +Clazz_declarePackage ("javax.swing.border"); +Clazz_load (["javax.swing.border.Border"], "javax.swing.border.AbstractBorder", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Component", "$.Insets", "$.Rectangle"], function () { +c$ = Clazz_declareType (javax.swing.border, "AbstractBorder", null, javax.swing.border.Border); +Clazz_overrideMethod (c$, "paintBorder", +function (c, g, x, y, width, height) { +}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getBorderInsets", +function (c) { +return new java.awt.Insets (0, 0, 0, 0); +}, "java.awt.Component"); +Clazz_defineMethod (c$, "getBorderInsets", +function (c, insets) { +insets.left = insets.top = insets.right = insets.bottom = 0; +return insets; +}, "java.awt.Component,java.awt.Insets"); +Clazz_overrideMethod (c$, "isBorderOpaque", +function () { +return false; +}); +Clazz_defineMethod (c$, "getInteriorRectangle", +function (c, x, y, width, height) { +return javax.swing.border.AbstractBorder.getInteriorRectangle (c, this, x, y, width, height); +}, "java.awt.Component,~N,~N,~N,~N"); +c$.getInteriorRectangle = Clazz_defineMethod (c$, "getInteriorRectangle", +function (c, b, x, y, width, height) { +var insets; +if (b != null) insets = b.getBorderInsets (c); + else insets = new java.awt.Insets (0, 0, 0, 0); +return new java.awt.Rectangle (x + insets.left, y + insets.top, width - insets.right - insets.left, height - insets.top - insets.bottom); +}, "java.awt.Component,javax.swing.border.Border,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getBaseline", +function (c, width, height) { +if (width < 0 || height < 0) { +throw new IllegalArgumentException ("Width and height must be >= 0"); +}return -1; +}, "java.awt.Component,~N,~N"); +Clazz_defineMethod (c$, "getBaselineResizeBehavior", +function (c) { +if (c == null) { +throw new NullPointerException ("Component must be non-null"); +}return java.awt.Component.BaselineResizeBehavior.OTHER; +}, "java.awt.Component"); +c$.isLeftToRight = Clazz_defineMethod (c$, "isLeftToRight", +function (c) { +return c.getComponentOrientation ().isLeftToRight (); +}, "java.awt.Component"); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_load (["java.awt.event.InvocationEvent"], "jssun.awt.PeerEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.flags = 0; +Clazz_instantialize (this, arguments); +}, jssun.awt, "PeerEvent", java.awt.event.InvocationEvent); +Clazz_makeConstructor (c$, +function (source, runnable, flags) { +this.construct (source, runnable, null, false, flags); +}, "~O,Runnable,~N"); +Clazz_makeConstructor (c$, +function (source, runnable, notifier, catchExceptions, flags) { +Clazz_superConstructor (this, jssun.awt.PeerEvent, [source, runnable, notifier, catchExceptions]); +this.flags = flags; +}, "~O,Runnable,~O,~B,~N"); +Clazz_defineMethod (c$, "getFlags", +function () { +return this.flags; +}); +Clazz_defineMethod (c$, "coalesceEvents", +function (newEvent) { +return null; +}, "jssun.awt.PeerEvent"); +Clazz_defineStatics (c$, +"PRIORITY_EVENT", 0x01, +"ULTIMATE_PRIORITY_EVENT", 0x02, +"LOW_PRIORITY_EVENT", 0x04); +}); +Clazz_declarePackage ("jssun.awt.image"); +Clazz_load (["jssun.awt.image.InputStreamImageSource"], "jssun.awt.image.URLImageSource", ["java.net.URL"], function () { +c$ = Clazz_decorateAsClass (function () { +this.url = null; +this.conn = null; +this.actualHost = null; +this.actualPort = 0; +Clazz_instantialize (this, arguments); +}, jssun.awt.image, "URLImageSource", jssun.awt.image.InputStreamImageSource); +Clazz_makeConstructor (c$, +function (u) { +Clazz_superConstructor (this, jssun.awt.image.URLImageSource, []); +this.url = u; +}, "java.net.URL"); +Clazz_makeConstructor (c$, +function (href) { +this.construct ( new java.net.URL (null, href)); +}, "~S"); +Clazz_makeConstructor (c$, +function (u, uc) { +this.construct (u); +this.conn = uc; +}, "java.net.URL,java.net.URLConnection"); +Clazz_makeConstructor (c$, +function (uc) { +this.construct (uc.getURL (), uc); +}, "java.net.URLConnection"); +Clazz_overrideMethod (c$, "checkSecurity", +function (context, quiet) { +if (this.actualHost != null) { +try { +var security = System.getSecurityManager (); +if (security != null) { +security.checkConnect (this.actualHost, this.actualPort, context); +}} catch (e) { +if (Clazz_exceptionOf (e, SecurityException)) { +if (!quiet) { +throw e; +}return false; +} else { +throw e; +} +} +}return true; +}, "~O,~B"); +Clazz_defineMethod (c$, "getDecoder", +function () { +return null; +}); +}); +Clazz_declarePackage ("jssun.awt.image"); +Clazz_load (["java.awt.image.ImageProducer", "jssun.awt.image.ImageFetchable"], "jssun.awt.image.InputStreamImageSource", ["java.lang.SecurityException", "$.Thread", "jssun.awt.image.ImageConsumerQueue", "$.ImageFetcher"], function () { +c$ = Clazz_decorateAsClass (function () { +this.consumers = null; +this.decoder = null; +this.decoders = null; +this.awaitingFetch = false; +Clazz_instantialize (this, arguments); +}, jssun.awt.image, "InputStreamImageSource", null, [java.awt.image.ImageProducer, jssun.awt.image.ImageFetchable]); +Clazz_defineMethod (c$, "countConsumers", +function (cq) { +var i = 0; +while (cq != null) { +i++; +cq = cq.next; +} +return i; +}, "jssun.awt.image.ImageConsumerQueue"); +Clazz_defineMethod (c$, "countConsumers", +function () { +var id = this.decoders; +var i = this.countConsumers (this.consumers); +while (id != null) { +i += this.countConsumers (id.queue); +id = id.next; +} +return i; +}); +Clazz_defineMethod (c$, "addConsumer", +function (ic) { +this.addConsumer (ic, false); +}, "java.awt.image.ImageConsumer"); +Clazz_defineMethod (c$, "printQueue", +function (cq, prefix) { +while (cq != null) { +System.out.println (prefix + cq); +cq = cq.next; +} +}, "jssun.awt.image.ImageConsumerQueue,~S"); +Clazz_defineMethod (c$, "printQueues", +function (title) { +System.out.println (title + "[ -----------"); +this.printQueue (this.consumers, " "); +for (var id = this.decoders; id != null; id = id.next) { +System.out.println (" " + id); +this.printQueue (id.queue, " "); +} +System.out.println ("----------- ]" + title); +}, "~S"); +Clazz_defineMethod (c$, "addConsumer", +function (ic, produce) { +for (var id = this.decoders; id != null; id = id.next) { +if (id.isConsumer (ic)) { +return; +}} +var cq = this.consumers; +while (cq != null && cq.consumer !== ic) { +cq = cq.next; +} +if (cq == null) { +cq = new jssun.awt.image.ImageConsumerQueue (this, ic); +cq.next = this.consumers; +this.consumers = cq; +} else { +if (!cq.secure) { +var context = null; +var security = System.getSecurityManager (); +if (security != null) { +context = security.getSecurityContext (); +}if (cq.securityContext == null) { +cq.securityContext = context; +} else if (!cq.securityContext.equals (context)) { +this.errorConsumer (cq, false); +throw new SecurityException ("Applets are trading image data!"); +}}cq.interested = true; +}if (produce && this.decoder == null) { +this.startProduction (); +}}, "java.awt.image.ImageConsumer,~B"); +Clazz_overrideMethod (c$, "isConsumer", +function (ic) { +for (var id = this.decoders; id != null; id = id.next) { +if (id.isConsumer (ic)) { +return true; +}} +return jssun.awt.image.ImageConsumerQueue.isConsumer (this.consumers, ic); +}, "java.awt.image.ImageConsumer"); +Clazz_defineMethod (c$, "errorAllConsumers", + function (cq, needReload) { +while (cq != null) { +if (cq.interested) { +this.errorConsumer (cq, needReload); +}cq = cq.next; +} +}, "jssun.awt.image.ImageConsumerQueue,~B"); +Clazz_defineMethod (c$, "errorConsumer", + function (cq, needReload) { +cq.consumer.imageComplete (1); +this.removeConsumer (cq.consumer); +}, "jssun.awt.image.ImageConsumerQueue,~B"); +Clazz_overrideMethod (c$, "removeConsumer", +function (ic) { +for (var id = this.decoders; id != null; id = id.next) { +id.removeConsumer (ic); +} +this.consumers = jssun.awt.image.ImageConsumerQueue.removeConsumer (this.consumers, ic, false); +}, "java.awt.image.ImageConsumer"); +Clazz_defineMethod (c$, "startProduction", +function (ic) { +this.addConsumer (ic, true); +}, "java.awt.image.ImageConsumer"); +Clazz_defineMethod (c$, "startProduction", + function () { +if (!this.awaitingFetch) { +jssun.awt.image.ImageFetcher.add (this); +this.awaitingFetch = true; +}}); +Clazz_overrideMethod (c$, "requestTopDownLeftRightResend", +function (ic) { +}, "java.awt.image.ImageConsumer"); +Clazz_defineMethod (c$, "decoderForType", +function (is, content_type) { +return null; +}, "java.io.InputStream,~S"); +Clazz_defineMethod (c$, "getDecoder", +function (is) { +return null; +}, "java.io.InputStream"); +Clazz_overrideMethod (c$, "doFetch", +function () { +{ +if (this.consumers == null) { +this.awaitingFetch = false; +return; +}}var imgd = this.getDecoder (); +if (imgd == null) { +this.badDecoder (); +} else { +this.setDecoder (imgd); +try { +imgd.produceImage (); +} catch (e$$) { +if (Clazz_exceptionOf (e$$, java.io.IOException)) { +var e = e$$; +{ +e.printStackTrace (); +} +} else if (Clazz_exceptionOf (e$$, jssun.awt.image.ImageFormatException)) { +var e = e$$; +{ +e.printStackTrace (); +} +} else { +throw e$$; +} +} finally { +this.removeDecoder (imgd); +if (Thread.currentThread ().isInterrupted () || !Thread.currentThread ().isAlive ()) { +this.errorAllConsumers (imgd.queue, true); +} else { +this.errorAllConsumers (imgd.queue, false); +}} +}}); +Clazz_defineMethod (c$, "badDecoder", + function () { +var cq; +{ +cq = this.consumers; +this.consumers = null; +this.awaitingFetch = false; +}this.errorAllConsumers (cq, false); +}); +Clazz_defineMethod (c$, "setDecoder", + function (mydecoder) { +var cq; +{ +mydecoder.next = this.decoders; +this.decoders = mydecoder; +this.decoder = mydecoder; +cq = this.consumers; +mydecoder.queue = cq; +this.consumers = null; +this.awaitingFetch = false; +}}, "jssun.awt.image.ImageDecoder"); +Clazz_defineMethod (c$, "removeDecoder", + function (mydecoder) { +this.doneDecoding (mydecoder); +var idprev = null; +for (var id = this.decoders; id != null; id = id.next) { +if (id === mydecoder) { +if (idprev == null) { +this.decoders = id.next; +} else { +idprev.next = id.next; +}break; +}idprev = id; +} +}, "jssun.awt.image.ImageDecoder"); +Clazz_defineMethod (c$, "doneDecoding", +function (mydecoder) { +if (this.decoder === mydecoder) { +this.decoder = null; +if (this.consumers != null) { +this.startProduction (); +}}}, "jssun.awt.image.ImageDecoder"); +Clazz_defineMethod (c$, "latchConsumers", +function (id) { +this.doneDecoding (id); +}, "jssun.awt.image.ImageDecoder"); +Clazz_defineMethod (c$, "flush", +function () { +this.decoder = null; +}); +}); +Clazz_declarePackage ("java.awt.image"); +Clazz_declareInterface (java.awt.image, "ImageProducer"); +Clazz_declarePackage ("jssun.awt.image"); +Clazz_declareInterface (jssun.awt.image, "ImageFetchable"); +Clazz_declarePackage ("jssun.awt.image"); +c$ = Clazz_decorateAsClass (function () { +this.next = null; +this.consumer = null; +this.interested = false; +this.securityContext = null; +this.secure = false; +Clazz_instantialize (this, arguments); +}, jssun.awt.image, "ImageConsumerQueue"); +c$.removeConsumer = Clazz_defineMethod (c$, "removeConsumer", +function (cqbase, ic, stillinterested) { +var cqprev = null; +for (var cq = cqbase; cq != null; cq = cq.next) { +if (cq.consumer === ic) { +if (cqprev == null) { +cqbase = cq.next; +} else { +cqprev.next = cq.next; +}cq.interested = stillinterested; +break; +}cqprev = cq; +} +return cqbase; +}, "jssun.awt.image.ImageConsumerQueue,java.awt.image.ImageConsumer,~B"); +c$.isConsumer = Clazz_defineMethod (c$, "isConsumer", +function (cqbase, ic) { +for (var cq = cqbase; cq != null; cq = cq.next) { +if (cq.consumer === ic) { +return true; +}} +return false; +}, "jssun.awt.image.ImageConsumerQueue,java.awt.image.ImageConsumer"); +Clazz_makeConstructor (c$, +function (src, ic) { +this.consumer = ic; +this.interested = true; +this.secure = true; +}, "jssun.awt.image.InputStreamImageSource,java.awt.image.ImageConsumer"); +Clazz_overrideMethod (c$, "toString", +function () { +return ("[" + this.consumer + ", " + (this.interested ? "" : "not ") + "interested" + (this.securityContext != null ? ", " + this.securityContext : "") + "]"); +}); +Clazz_declarePackage ("jssun.awt.image"); +Clazz_load (["java.lang.Thread", "$.StringBuffer"], ["jssun.awt.image.FetcherInfo", "$.ImageFetcher"], ["java.util.Vector", "jssun.awt.AppContext"], function () { +c$ = Clazz_declareType (jssun.awt.image, "ImageFetcher", Thread); +Clazz_makeConstructor (c$, + function (threadGroup, index) { +Clazz_superConstructor (this, jssun.awt.image.ImageFetcher, [threadGroup, "Image Fetcher " + index]); +this.setDaemon (true); +}, "ThreadGroup,~N"); +c$.add = Clazz_defineMethod (c$, "add", +function (src) { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +{ +if (!info.waitList.contains (src)) { +info.waitList.addElement (src); +if (info.numWaiting == 0 && info.numFetchers < info.fetchers.length) { +jssun.awt.image.ImageFetcher.createFetchers (info); +}info.waitList.notify (); +}}}, "jssun.awt.image.ImageFetchable"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (src) { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +{ +if (info.waitList.contains (src)) { +info.waitList.removeElement (src); +}}}, "jssun.awt.image.ImageFetchable"); +c$.isFetcher = Clazz_defineMethod (c$, "isFetcher", +function (t) { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +{ +for (var i = 0; i < info.fetchers.length; i++) { +if (info.fetchers[i] === t) { +return true; +}} +}return false; +}, "Thread"); +c$.amFetcher = Clazz_defineMethod (c$, "amFetcher", +function () { +return jssun.awt.image.ImageFetcher.isFetcher (Thread.currentThread ()); +}); +c$.nextImage = Clazz_defineMethod (c$, "nextImage", + function () { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +{ +var src = null; +var end = System.currentTimeMillis () + 5000; +while (src == null) { +while (info.waitList.size () == 0) { +var now = System.currentTimeMillis (); +if (now >= end) { +return null; +}try { +info.numWaiting++; +info.waitList.wait (end - now); +} catch (e) { +if (Clazz_exceptionOf (e, InterruptedException)) { +return null; +} else { +throw e; +} +} finally { +info.numWaiting--; +} +} +src = info.waitList.elementAt (0); +info.waitList.removeElement (src); +} +return src; +}}); +Clazz_overrideMethod (c$, "run", +function () { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +try { +this.fetchloop (); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +e.printStackTrace (); +} else { +throw e; +} +} finally { +{ +var me = Thread.currentThread (); +for (var i = 0; i < info.fetchers.length; i++) { +if (info.fetchers[i] === me) { +info.fetchers[i] = null; +info.numFetchers--; +}} +}} +}); +Clazz_defineMethod (c$, "fetchloop", + function () { +var me = Thread.currentThread (); +while (jssun.awt.image.ImageFetcher.isFetcher (me)) { +Thread.interrupted (); +me.setPriority (8); +var src = jssun.awt.image.ImageFetcher.nextImage (); +if (src == null) { +return; +}try { +src.doFetch (); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +System.err.println ("Uncaught error fetching image:"); +e.printStackTrace (); +} else { +throw e; +} +} +jssun.awt.image.ImageFetcher.stoppingAnimation (me); +} +}); +c$.startingAnimation = Clazz_defineMethod (c$, "startingAnimation", +function () { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +var me = Thread.currentThread (); +{ +for (var i = 0; i < info.fetchers.length; i++) { +if (info.fetchers[i] === me) { +info.fetchers[i] = null; +info.numFetchers--; +me.setName ("Image Animator " + i); +if (info.waitList.size () > info.numWaiting) { +jssun.awt.image.ImageFetcher.createFetchers (info); +}return; +}} +}me.setPriority (2); +me.setName ("Image Animator"); +}); +c$.stoppingAnimation = Clazz_defineMethod (c$, "stoppingAnimation", + function (me) { +var info = jssun.awt.image.FetcherInfo.getFetcherInfo (); +{ +var index = -1; +for (var i = 0; i < info.fetchers.length; i++) { +if (info.fetchers[i] === me) { +return; +}if (info.fetchers[i] == null) { +index = i; +}} +if (index >= 0) { +info.fetchers[index] = me; +info.numFetchers++; +me.setName ("Image Fetcher " + index); +return; +}}}, "Thread"); +c$.createFetchers = Clazz_defineMethod (c$, "createFetchers", + function (info) { +var appContext = jssun.awt.AppContext.getAppContext (); +var threadGroup = appContext.getThreadGroup (); +var fetcherThreadGroup; +try { +if (threadGroup.getParent () != null) { +fetcherThreadGroup = threadGroup; +} else { +threadGroup = Thread.currentThread ().getThreadGroup (); +var parent = threadGroup.getParent (); +while ((parent != null) && (parent.getParent () != null)) { +threadGroup = parent; +parent = threadGroup.getParent (); +} +fetcherThreadGroup = threadGroup; +}} catch (e) { +if (Clazz_exceptionOf (e, SecurityException)) { +fetcherThreadGroup = appContext.getThreadGroup (); +} else { +throw e; +} +} +var fetcherGroup = fetcherThreadGroup; +for (var i = 0; i < info.fetchers.length; i++) { +if (info.fetchers[i] == null) { +info.fetchers[i] = new jssun.awt.image.ImageFetcher (fetcherGroup, i); +info.fetchers[i].start (); +info.numFetchers++; +break; +}} +return; +}, "jssun.awt.image.FetcherInfo"); +Clazz_defineStatics (c$, +"HIGH_PRIORITY", 8, +"LOW_PRIORITY", 3, +"ANIM_PRIORITY", 2, +"TIMEOUT", 5000); +c$ = Clazz_decorateAsClass (function () { +this.fetchers = null; +this.numFetchers = 0; +this.numWaiting = 0; +this.waitList = null; +Clazz_instantialize (this, arguments); +}, jssun.awt.image, "FetcherInfo"); +Clazz_makeConstructor (c$, + function () { +this.fetchers = new Array (4); +this.numFetchers = 0; +this.numWaiting = 0; +this.waitList = new java.util.Vector (); +}); +c$.getFetcherInfo = Clazz_defineMethod (c$, "getFetcherInfo", +function () { +var appContext = jssun.awt.AppContext.getAppContext (); +{ +var info = appContext.get (jssun.awt.image.FetcherInfo.FETCHER_INFO_KEY); +if (info == null) { +info = new jssun.awt.image.FetcherInfo (); +appContext.put (jssun.awt.image.FetcherInfo.FETCHER_INFO_KEY, info); +}return info; +}}); +Clazz_defineStatics (c$, +"MAX_NUM_FETCHERS_PER_APPCONTEXT", 4); +c$.FETCHER_INFO_KEY = c$.prototype.FETCHER_INFO_KEY = new StringBuffer ("FetcherInfo"); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.FocusEvent", ["jssun.awt.AppContext", "$.SunToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.temporary = false; +this.opposite = null; +Clazz_instantialize (this, arguments); +}, java.awt.event, "FocusEvent", java.awt.event.ComponentEvent); +Clazz_makeConstructor (c$, +function (source, id, temporary, opposite) { +Clazz_superConstructor (this, java.awt.event.FocusEvent, [source, id]); +this.temporary = temporary; +this.opposite = opposite; +}, "java.awt.Component,~N,~B,java.awt.Component"); +Clazz_makeConstructor (c$, +function (source, id, temporary) { +this.construct (source, id, temporary, null); +}, "java.awt.Component,~N,~B"); +Clazz_makeConstructor (c$, +function (source, id) { +this.construct (source, id, false); +}, "java.awt.Component,~N"); +Clazz_defineMethod (c$, "isTemporary", +function () { +return this.temporary; +}); +Clazz_defineMethod (c$, "getOppositeComponent", +function () { +if (this.opposite == null) { +return null; +}return (jssun.awt.SunToolkit.targetToAppContext (this.opposite) === jssun.awt.AppContext.getAppContext ()) ? this.opposite : null; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 1004: +typeStr = "FOCUS_GAINED"; +break; +case 1005: +typeStr = "FOCUS_LOST"; +break; +default: +typeStr = "unknown type"; +} +return typeStr + (this.temporary ? ",temporary" : ",permanent") + ",opposite=" + this.getOppositeComponent (); +}); +Clazz_defineStatics (c$, +"FOCUS_FIRST", 1004, +"FOCUS_LAST", 1005, +"FOCUS_GAINED", 1004, +"FOCUS_LOST", 1005); +}); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.AWTEvent"], "java.awt.event.HierarchyEvent", ["java.awt.Component"], function () { +c$ = Clazz_decorateAsClass (function () { +this.changed = null; +this.changedParent = null; +this.changeFlags = 0; +Clazz_instantialize (this, arguments); +}, java.awt.event, "HierarchyEvent", java.awt.AWTEvent); +Clazz_makeConstructor (c$, +function (source, id, changed, changedParent) { +Clazz_superConstructor (this, java.awt.event.HierarchyEvent, [source, id]); +this.changed = changed; +this.changedParent = changedParent; +}, "java.awt.Component,~N,java.awt.Component,java.awt.Container"); +Clazz_makeConstructor (c$, +function (source, id, changed, changedParent, changeFlags) { +Clazz_superConstructor (this, java.awt.event.HierarchyEvent, [source, id]); +this.changed = changed; +this.changedParent = changedParent; +this.changeFlags = changeFlags; +}, "java.awt.Component,~N,java.awt.Component,java.awt.Container,~N"); +Clazz_defineMethod (c$, "getComponent", +function () { +return (Clazz_instanceOf (this.source, java.awt.Component)) ? this.source : null; +}); +Clazz_defineMethod (c$, "getChanged", +function () { +return this.changed; +}); +Clazz_defineMethod (c$, "getChangedParent", +function () { +return this.changedParent; +}); +Clazz_defineMethod (c$, "getChangeFlags", +function () { +return this.changeFlags; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 1401: +typeStr = "ANCESTOR_MOVED (" + this.changed + "," + this.changedParent + ")"; +break; +case 1402: +typeStr = "ANCESTOR_RESIZED (" + this.changed + "," + this.changedParent + ")"; +break; +case 1400: +{ +typeStr = "HIERARCHY_CHANGED ("; +var first = true; +if ((this.changeFlags & 1) != 0) { +first = false; +typeStr += "PARENT_CHANGED"; +}if ((this.changeFlags & 2) != 0) { +if (first) { +first = false; +} else { +typeStr += ","; +}typeStr += "DISPLAYABILITY_CHANGED"; +}if ((this.changeFlags & 4) != 0) { +if (first) { +first = false; +} else { +typeStr += ","; +}typeStr += "SHOWING_CHANGED"; +}if (!first) { +typeStr += ","; +}typeStr += this.changed + "," + this.changedParent + ")"; +break; +}default: +typeStr = "unknown type"; +} +return typeStr; +}); +Clazz_defineStatics (c$, +"HIERARCHY_FIRST", 1400, +"HIERARCHY_CHANGED", 1400, +"ANCESTOR_MOVED", 1401, +"ANCESTOR_RESIZED", 1402, +"HIERARCHY_LAST", 1402, +"PARENT_CHANGED", 0x1, +"DISPLAYABILITY_CHANGED", 0x2, +"SHOWING_CHANGED", 0x4); +}); +Clazz_declarePackage ("jssun.awt"); +Clazz_declareInterface (jssun.awt, "ConstrainableGraphics"); +Clazz_declarePackage ("jssun.awt"); +Clazz_declareInterface (jssun.awt, "Graphics2Delegate"); +Clazz_declarePackage ("java.awt.event"); +Clazz_load (["java.awt.event.ComponentEvent"], "java.awt.event.ContainerEvent", ["java.awt.Container"], function () { +c$ = Clazz_decorateAsClass (function () { +this.child = null; +Clazz_instantialize (this, arguments); +}, java.awt.event, "ContainerEvent", java.awt.event.ComponentEvent); +Clazz_makeConstructor (c$, +function (source, id, child) { +Clazz_superConstructor (this, java.awt.event.ContainerEvent, [source, id]); +this.child = child; +}, "java.awt.Component,~N,java.awt.Component"); +Clazz_defineMethod (c$, "getContainer", +function () { +return (Clazz_instanceOf (this.source, java.awt.Container)) ? this.source : null; +}); +Clazz_defineMethod (c$, "getChild", +function () { +return this.child; +}); +Clazz_overrideMethod (c$, "paramString", +function () { +var typeStr; +switch (this.id) { +case 300: +typeStr = "COMPONENT_ADDED"; +break; +case 301: +typeStr = "COMPONENT_REMOVED"; +break; +default: +typeStr = "unknown type"; +} +return typeStr + ",child=" + this.child.getName (); +}); +Clazz_defineStatics (c$, +"CONTAINER_FIRST", 300, +"CONTAINER_LAST", 301, +"COMPONENT_ADDED", 300, +"COMPONENT_REMOVED", 301); +}); +Clazz_declarePackage ("jssun.applet"); +Clazz_load (["java.util.EventObject"], "jssun.applet.AppletEvent", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.arg = null; +this.id = 0; +Clazz_instantialize (this, arguments); +}, jssun.applet, "AppletEvent", java.util.EventObject); +Clazz_makeConstructor (c$, +function (source, id, argument) { +Clazz_superConstructor (this, jssun.applet.AppletEvent, [source]); +this.arg = argument; +this.id = id; +}, "~O,~N,~O"); +Clazz_defineMethod (c$, "getID", +function () { +return this.id; +}); +Clazz_defineMethod (c$, "getArgument", +function () { +return this.arg; +}); +Clazz_overrideMethod (c$, "toString", +function () { +var str = this.getClass ().getName () + "[source=" + this.source + " + id=" + this.id; +if (this.arg != null) { +str += " + arg=" + this.arg; +}str += " ]"; +return str; +}); +}); +Clazz_declarePackage ("jssun.applet"); +Clazz_load (["jssun.applet.AppletListener"], "jssun.applet.AppletEventMulticaster", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.a = null; +this.b = null; +Clazz_instantialize (this, arguments); +}, jssun.applet, "AppletEventMulticaster", null, jssun.applet.AppletListener); +Clazz_makeConstructor (c$, +function (a, b) { +this.a = a; +this.b = b; +}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); +Clazz_defineMethod (c$, "appletStateChanged", +function (e) { +this.a.appletStateChanged (e); +this.b.appletStateChanged (e); +}, "jssun.applet.AppletEvent"); +c$.add = Clazz_defineMethod (c$, "add", +function (a, b) { +return jssun.applet.AppletEventMulticaster.addInternal (a, b); +}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (l, oldl) { +return jssun.applet.AppletEventMulticaster.removeInternal (l, oldl); +}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); +c$.addInternal = Clazz_defineMethod (c$, "addInternal", + function (a, b) { +if (a == null) return b; +if (b == null) return a; +return new jssun.applet.AppletEventMulticaster (a, b); +}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); +Clazz_defineMethod (c$, "remove", +function (oldl) { +if (oldl === this.a) return this.b; +if (oldl === this.b) return this.a; +var a2 = jssun.applet.AppletEventMulticaster.removeInternal (this.a, oldl); +var b2 = jssun.applet.AppletEventMulticaster.removeInternal (this.b, oldl); +if (a2 === this.a && b2 === this.b) { +return this; +}return jssun.applet.AppletEventMulticaster.addInternal (a2, b2); +}, "jssun.applet.AppletListener"); +c$.removeInternal = Clazz_defineMethod (c$, "removeInternal", + function (l, oldl) { +if (l === oldl || l == null) { +return null; +} else if (Clazz_instanceOf (l, jssun.applet.AppletEventMulticaster)) { +return (l).remove (oldl); +} else { +return l; +}}, "jssun.applet.AppletListener,jssun.applet.AppletListener"); +}); +Clazz_declarePackage ("jssun.applet"); +Clazz_load (["java.util.EventListener"], "jssun.applet.AppletListener", null, function () { +Clazz_declareInterface (jssun.applet, "AppletListener", java.util.EventListener); +}); +Clazz_declarePackage ("jssun.misc"); +Clazz_load (["java.util.Enumeration"], ["jssun.misc.Queue", "$.LIFOQueueEnumerator", "$.FIFOQueueEnumerator", "$.QueueElement"], ["java.util.NoSuchElementException", "swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.length = 0; +this.head = null; +this.tail = null; +Clazz_instantialize (this, arguments); +}, jssun.misc, "Queue"); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "enqueue", +function (obj) { +var newElt = new jssun.misc.QueueElement (obj); +if (this.head == null) { +this.head = newElt; +this.tail = newElt; +this.length = 1; +} else { +newElt.next = this.head; +this.head.prev = newElt; +this.head = newElt; +this.length++; +}this.notify (); +}, "~O"); +Clazz_defineMethod (c$, "dequeue", +function () { +return this.dequeue (0); +}); +Clazz_defineMethod (c$, "dequeue", +function (timeOut) { +while (this.tail == null) { +swingjs.JSToolkit.warn ("Cannot wait in Queue.java"); +this.wait (timeOut); +} +var elt = this.tail; +this.tail = elt.prev; +if (this.tail == null) { +this.head = null; +} else { +this.tail.next = null; +}this.length--; +return elt.obj; +}, "~N"); +Clazz_defineMethod (c$, "isEmpty", +function () { +return (this.tail == null); +}); +Clazz_defineMethod (c$, "elements", +function () { +return new jssun.misc.LIFOQueueEnumerator (this); +}); +Clazz_defineMethod (c$, "reverseElements", +function () { +return new jssun.misc.FIFOQueueEnumerator (this); +}); +Clazz_defineMethod (c$, "dump", +function (msg) { +System.err.println (">> " + msg); +System.err.println ("[" + this.length + " elt(s); head = " + (this.head == null ? "null" : (this.head.obj) + "") + " tail = " + (this.tail == null ? "null" : (this.tail.obj) + "")); +var cursor = this.head; +var last = null; +while (cursor != null) { +System.err.println (" " + cursor); +last = cursor; +cursor = cursor.next; +} +if (last !== this.tail) { +System.err.println (" tail != last: " + this.tail + ", " + last); +}System.err.println ("]"); +}, "~S"); +c$ = Clazz_decorateAsClass (function () { +this.queue = null; +this.cursor = null; +Clazz_instantialize (this, arguments); +}, jssun.misc, "FIFOQueueEnumerator", null, java.util.Enumeration); +Clazz_makeConstructor (c$, +function (q) { +this.queue = q; +this.cursor = q.tail; +}, "jssun.misc.Queue"); +Clazz_overrideMethod (c$, "hasMoreElements", +function () { +return (this.cursor != null); +}); +Clazz_overrideMethod (c$, "nextElement", +function () { +{ +if (this.cursor != null) { +var result = this.cursor; +this.cursor = this.cursor.prev; +return result.obj; +}}throw new java.util.NoSuchElementException ("FIFOQueueEnumerator"); +}); +c$ = Clazz_decorateAsClass (function () { +this.queue = null; +this.cursor = null; +Clazz_instantialize (this, arguments); +}, jssun.misc, "LIFOQueueEnumerator", null, java.util.Enumeration); +Clazz_makeConstructor (c$, +function (q) { +this.queue = q; +this.cursor = q.head; +}, "jssun.misc.Queue"); +Clazz_overrideMethod (c$, "hasMoreElements", +function () { +return (this.cursor != null); +}); +Clazz_overrideMethod (c$, "nextElement", +function () { +{ +if (this.cursor != null) { +var result = this.cursor; +this.cursor = this.cursor.next; +return result.obj; +}}throw new java.util.NoSuchElementException ("LIFOQueueEnumerator"); +}); +c$ = Clazz_decorateAsClass (function () { +this.next = null; +this.prev = null; +this.obj = null; +Clazz_instantialize (this, arguments); +}, jssun.misc, "QueueElement"); +Clazz_makeConstructor (c$, +function (obj) { +this.obj = obj; +}, "~O"); +Clazz_overrideMethod (c$, "toString", +function () { +return "QueueElement[obj=" + this.obj + (this.prev == null ? " null" : " prev") + (this.next == null ? " null" : " next") + "]"; +}); +}); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_declareInterface (javax.swing.plaf, "UIResource"); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_load (["javax.swing.InputMap", "javax.swing.plaf.UIResource"], "javax.swing.plaf.InputMapUIResource", null, function () { +c$ = Clazz_declareType (javax.swing.plaf, "InputMapUIResource", javax.swing.InputMap, javax.swing.plaf.UIResource); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.plaf.InputMapUIResource, []); +}); +}); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_load (["javax.swing.ActionMap", "javax.swing.plaf.UIResource"], "javax.swing.plaf.ActionMapUIResource", null, function () { +c$ = Clazz_declareType (javax.swing.plaf, "ActionMapUIResource", javax.swing.ActionMap, javax.swing.plaf.UIResource); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, javax.swing.plaf.ActionMapUIResource, []); +}); +}); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_load (["java.awt.peer.LightweightPeer"], "javax.swing.plaf.ComponentUI", ["java.lang.Error", "java.awt.Component"], function () { +c$ = Clazz_declareType (javax.swing.plaf, "ComponentUI", null, java.awt.peer.LightweightPeer); +Clazz_makeConstructor (c$, +function () { +}); +Clazz_defineMethod (c$, "installUI", +function (c) { +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "uninstallUI", +function (c) { +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "paint", +function (g, c) { +}, "java.awt.Graphics,javax.swing.JComponent"); +Clazz_defineMethod (c$, "update", +function (g, c) { +}, "java.awt.Graphics,javax.swing.JComponent"); +Clazz_defineMethod (c$, "getPreferredSize", +function (c) { +return null; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "getMinimumSize", +function (c) { +return this.getPreferredSize (c); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "getMaximumSize", +function (c) { +return null; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "contains", +function (c, x, y) { +return c.inside (x, y); +}, "javax.swing.JComponent,~N,~N"); +c$.createUI = Clazz_defineMethod (c$, "createUI", +function (c) { +throw new Error ("ComponentUI.createUI not implemented."); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "getBaseline", +function (c, width, height) { +return -1; +}, "javax.swing.JComponent,~N,~N"); +Clazz_defineMethod (c$, "getBaselineResizeBehavior", +function (c) { +return java.awt.Component.BaselineResizeBehavior.OTHER; +}, "javax.swing.JComponent"); +}); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_load (["java.awt.Font", "javax.swing.plaf.UIResource"], "javax.swing.plaf.FontUIResource", null, function () { +c$ = Clazz_declareType (javax.swing.plaf, "FontUIResource", java.awt.Font, javax.swing.plaf.UIResource); +}); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_load (["java.awt.Color", "javax.swing.plaf.UIResource"], "javax.swing.plaf.ColorUIResource", null, function () { +c$ = Clazz_declareType (javax.swing.plaf, "ColorUIResource", java.awt.Color, javax.swing.plaf.UIResource); +}); +Clazz_declarePackage ("javax.swing.plaf"); +Clazz_load (["javax.swing.ComponentInputMap", "javax.swing.plaf.UIResource"], "javax.swing.plaf.ComponentInputMapUIResource", null, function () { +c$ = Clazz_declareType (javax.swing.plaf, "ComponentInputMapUIResource", javax.swing.ComponentInputMap, javax.swing.plaf.UIResource); +}); +Clazz_declarePackage ("swingjs.api"); +Clazz_declareInterface (swingjs.api, "JSFunction"); +Clazz_declarePackage ("swingjs.api"); +Clazz_declareInterface (swingjs.api, "JSInterface"); +Clazz_declarePackage ("swingjs.api"); +c$ = Clazz_declareType (swingjs.api, "Interface"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function (name, isQuiet) { +try { +{ +Clazz._isQuiet = isQuiet; +}System.out.println ("swingjs.api.Interface creating instance of " + name); +var x = Clazz._4Name (name); +{ +Clazz._isQuiet = false; +}return (x == null ? null : x.newInstance ()); +} catch (e) { +if (Clazz_exceptionOf (e, Exception)) { +System.out.println ("Interface.java Error creating instance for " + name + ": \n" + e); +return null; +} else { +throw e; +} +} +}, "~S,~B"); +Clazz_declarePackage ("swingjs.api"); +c$ = Clazz_declareType (swingjs.api, "DOMNode"); +c$.createElement = Clazz_defineMethod (c$, "createElement", +function (key, id) { +var obj = null; +{ +obj = document.createElement(key); +obj.id = id; +}return obj; +}, "~S,~S"); +c$.getParent = Clazz_defineMethod (c$, "getParent", +function (obj) { +{ +return obj.parentNode; +}}, "swingjs.api.DOMNode"); +c$.remove = Clazz_defineMethod (c$, "remove", +function (obj) { +{ +try { +var p = obj.parentNode; +p.removeNode(obj); +} catch(e) {}; +return p; +}}, "swingjs.api.DOMNode"); +c$.add = Clazz_defineMethod (c$, "add", +function (parent, child) { +{ +parent && parent.appendChild(child); +}}, "swingjs.api.DOMNode,swingjs.api.DOMNode"); +c$.getAttr = Clazz_defineMethod (c$, "getAttr", +function (obj, attr) { +{ +if (obj)return obj[attr]; +}}, "swingjs.api.DOMNode,~S"); +Clazz_defineMethod (c$, "getStyle", +function (style) { +{ +if (obj)return obj.style[style]; +}}, "~S"); +c$.setAttr = Clazz_defineMethod (c$, "setAttr", +function (obj, attr, val) { +{ +obj[attr] = (val == "TRUE" ? true : val); +}return obj; +}, "swingjs.api.DOMNode,~S,~O"); +c$.setStyles = Clazz_defineMethod (c$, "setStyles", +function (obj, attr) { +{ +for (var i = 0; i < attr.length;) { +//System.out.println(["DOMNode.setStyles ",attr[i],attr[i+1]]) +; +obj.style[attr[i++]] = attr[i++]; } +}return obj; +}, "swingjs.api.DOMNode,~A"); +c$.setSize = Clazz_defineMethod (c$, "setSize", +function (obj, width, height) { +return swingjs.api.DOMNode.setStyles (obj, ["width", width + "px", "height", height + "px"]); +}, "swingjs.api.DOMNode,~N,~N"); +Clazz_declarePackage ("swingjs"); +c$ = Clazz_declareType (swingjs, "JSUtil"); +c$.split = Clazz_defineMethod (c$, "split", +function (text, run) { +if (text.length == 0) return new Array (0); +var n = 1; +var i = text.indexOf (run); +var lines; +var runLen = run.length; +if (i < 0 || runLen == 0) { +lines = new Array (1); +lines[0] = text; +return lines; +}var len = text.length - runLen; +for (; i >= 0 && i < len; n++) i = text.indexOf (run, i + runLen); + +lines = new Array (n); +i = 0; +var ipt = 0; +var pt = 0; +for (; (ipt = text.indexOf (run, i)) >= 0 && pt + 1 < n; ) { +lines[pt++] = text.substring (i, ipt); +i = ipt + runLen; +} +if (text.indexOf (run, len) != len) len += runLen; +lines[pt] = text.substring (i, len); +return lines; +}, "~S,~S"); +Clazz_declarePackage ("swingjs"); +Clazz_load (["jssun.awt.SunToolkit"], "swingjs.JSToolkit", ["java.io.BufferedInputStream", "$.ByteArrayInputStream", "$.InputStream", "java.lang.Boolean", "$.Thread", "java.util.Hashtable", "JU.AU", "$.Rdr", "$.SB", "java.awt.Dimension", "java.awt.image.ColorModel", "javax.swing.UIManager", "jssun.awt.AppContext", "swingjs.JSComponentPeer", "swingjs.api.Interface"], function () { +c$ = Clazz_decorateAsClass (function () { +this.imageKit = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSToolkit", jssun.awt.SunToolkit); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, swingjs.JSToolkit); +System.out.println ("JSToolkit initialized"); +}); +c$.warn = Clazz_defineMethod (c$, "warn", +function (msg) { +swingjs.JSToolkit.alert (msg); +}, "~S"); +c$.alert = Clazz_defineMethod (c$, "alert", +function (object) { +{ +console.log("[JSToolkit] " + object); +alert("[JSToolkit] " + object); +}}, "~O"); +c$.log = Clazz_defineMethod (c$, "log", +function (msg) { +{ +System.out.println(msg); +console.log(msg); +}}, "~S"); +c$.confirm = Clazz_defineMethod (c$, "confirm", +function (msg) { +{ +return confirm(msg); +}}, "~S"); +c$.prompt = Clazz_defineMethod (c$, "prompt", +function (msg, defaultRet) { +{ +return confirm(msg, defaultRet); +}}, "~S,~S"); +c$.getPostEventQueue = Clazz_defineMethod (c$, "getPostEventQueue", +function (isPost) { +return (isPost ? jssun.awt.AppContext.getAppContext ().get ("PostEventQueue") : jssun.awt.AppContext.getAppContext ().get (jssun.awt.AppContext.EVENT_QUEUE_KEY)); +}, "~B"); +Clazz_overrideMethod (c$, "getScreenSize", +function () { +var d = new java.awt.Dimension (0, 0); +var jq = swingjs.JSToolkit.getJQuery (); +{ +d.setSize(jq.$(window).width(), jq.$(window).height()); return +d; +}}); +Clazz_overrideMethod (c$, "getScreenResolution", +function () { +return 0; +}); +Clazz_overrideMethod (c$, "getColorModel", +function () { +return java.awt.image.ColorModel.getRGBdefault (); +}); +Clazz_overrideMethod (c$, "getFontList", +function () { +var hardwiredFontList = Clazz_newArray (-1, ["SansSerif", "SansSerif", "Serif", "Monospaced", "DialogInput"]); +return hardwiredFontList; +}); +Clazz_overrideMethod (c$, "sync", +function () { +}); +Clazz_overrideMethod (c$, "isModalExclusionTypeSupported", +function (modalExclusionType) { +return true; +}, "java.awt.Dialog.ModalExclusionType"); +Clazz_overrideMethod (c$, "isModalityTypeSupported", +function (modalityType) { +return false; +}, "java.awt.Dialog.ModalityType"); +Clazz_overrideMethod (c$, "isTraySupported", +function () { +return false; +}); +Clazz_overrideMethod (c$, "getScreenWidth", +function () { +return 0; +}); +Clazz_overrideMethod (c$, "getScreenHeight", +function () { +return 0; +}); +Clazz_overrideMethod (c$, "grab", +function (w) { +}, "java.awt.Window"); +Clazz_overrideMethod (c$, "ungrab", +function (w) { +}, "java.awt.Window"); +c$.getPropertyObject = Clazz_defineMethod (c$, "getPropertyObject", +function (t, key, def) { +return def; +}, "~O,~S,~O"); +c$.getInstance = Clazz_defineMethod (c$, "getInstance", +function (className) { +return swingjs.api.Interface.getInstance (className, false); +}, "~S"); +c$.getGraphicsConfiguration = Clazz_defineMethod (c$, "getGraphicsConfiguration", +function () { +return (swingjs.JSToolkit.gc == null ? swingjs.JSToolkit.gc = swingjs.JSToolkit.getInstance ("swingjs.JSGraphicsConfiguration") : swingjs.JSToolkit.gc); +}); +c$.isFocused = Clazz_defineMethod (c$, "isFocused", +function (window) { +return false; +}, "java.awt.Window"); +c$.getCSSFont = Clazz_defineMethod (c$, "getCSSFont", +function (font) { +var css = ""; +if (font.isItalic ()) css += "font-style:italic;"; +if (font.isBold ()) css += "font-weight:bold;"; +css += "font-size:" + font.getSize () + "px;"; +css += "font-family:" + font.getFamily () + ";"; +return css; +}, "java.awt.Font"); +c$.getStringWidth = Clazz_defineMethod (c$, "getStringWidth", +function (context, font, text) { +var fontInfo = swingjs.JSToolkit.getCanvasFont (font); +if (context == null) context = swingjs.JSToolkit.getDefaultCanvasContext2d (); +var w = 0; +{ +context.font = fontInfo; +w = Math.ceil(context.measureText(text).width); +}return w; +}, "swingjs.api.HTML5CanvasContext2D,java.awt.Font,~S"); +c$.getDefaultCanvasContext2d = Clazz_defineMethod (c$, "getDefaultCanvasContext2d", +function () { +{ +if (this.defaultContext == null) this.defaultContext = +document.createElement( 'canvas' ).getContext('2d'); +}return swingjs.JSToolkit.defaultContext; +}); +c$.getCanvasFont = Clazz_defineMethod (c$, "getCanvasFont", +function (font) { +var strStyle = ""; +if (font.isItalic ()) strStyle += "italic "; +if (font.isBold ()) strStyle += "bold "; +return strStyle + font.getSize () + "px " + font.getFamily (); +}, "java.awt.Font"); +c$.getFontFamily = Clazz_defineMethod (c$, "getFontFamily", +function (font) { +return font.getName (); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +var fm = swingjs.JSToolkit.getInstance ("swingjs.JSFontMetrics"); +fm.setFont (font); +return fm; +}, "java.awt.Font"); +c$.getCSSColor = Clazz_defineMethod (c$, "getCSSColor", +function (c) { +var s = "000000" + Integer.toHexString (c.getRGB () & 0xFFFFFF); +return "#" + s.substring (s.length - 6); +}, "java.awt.Color"); +c$.notImplemented = Clazz_defineMethod (c$, "notImplemented", +function (msg) { +var s = null; +if (swingjs.JSToolkit.mapNotImpl == null) swingjs.JSToolkit.mapNotImpl = new java.util.Hashtable (); +{ +s = arguments.callee.caller; s = s.__CLASS_NAME__ || +s.claxxOwner.__CLASS_NAME__; s += "." + +arguments.callee.caller.exName; +}if (swingjs.JSToolkit.mapNotImpl.containsKey (s)) return; +swingjs.JSToolkit.mapNotImpl.put (s, Boolean.TRUE); +System.out.println (s + " has not been implemented in SwingJS. " + (msg === "" ? "" : (msg == null ? "" : msg) + swingjs.JSToolkit.getStackTrace (-5))); +}, "~S"); +c$.getStackTrace = Clazz_defineMethod (c$, "getStackTrace", +function () { +{ +return Clazz_getStackTrace(); +}}); +c$.getStackTrace = Clazz_defineMethod (c$, "getStackTrace", +function (n) { +{ +return Clazz_getStackTrace(n); +}}, "~N"); +c$.getLookAndFeelDefaults = Clazz_defineMethod (c$, "getLookAndFeelDefaults", +function () { +if (swingjs.JSToolkit.uid == null) swingjs.JSToolkit.uid = javax.swing.UIManager.getLookAndFeel ().getDefaults (); +return swingjs.JSToolkit.uid; +}); +c$.getComponentUI = Clazz_defineMethod (c$, "getComponentUI", +function (target) { +var c = swingjs.api.Interface.getInstance ("swingjs.plaf.JS" + target.getUIClassID (), true); +if (c != null) c.set (target); +return c; +}, "javax.swing.JComponent"); +c$.getSwingDivId = Clazz_defineMethod (c$, "getSwingDivId", +function () { +return Thread.currentThread ().getName () + "_swingdiv"; +}); +c$.getJQuery = Clazz_defineMethod (c$, "getJQuery", +function () { +{ +if (!window.jQuery) alert( +"jQuery is required for SwingJS, but window.jQuery is not defined." +); jQuery.$ || (jQuery.$ = jQuery); return(jQuery); +}}); +c$.getJavaResource = Clazz_defineMethod (c$, "getJavaResource", +function (resourceName) { +System.out.println ("JSToolkit getting Java resource " + resourceName); +{ +return SwingJS.getJavaResource(resourceName); +}}, "~S"); +c$.dispatchSystemEvent = Clazz_defineMethod (c$, "dispatchSystemEvent", +function (runnable) { +var f = null; +{ +System.out.println("JST dispatchSystemEvent " + +runnable.run.toString()); f = +function(_JSToolkit_dispatchSystemEvent) { +System.out.println("JST running " + +runnable.run.toString());runnable.run()}; +}swingjs.JSToolkit.setTimeout (f, 0, 0); +}, "Runnable"); +c$.dispatchEvent = Clazz_defineMethod (c$, "dispatchEvent", +function (event, src, andWait) { +var f = null; +var id = ++swingjs.JSToolkit.dispatchID; +{ +f = function() +{ +if +(src == null) event.dispatch(); else src.dispatchEvent(event); +}; +}if (andWait) swingjs.JSToolkit.invokeAndWait (f, id); + else swingjs.JSToolkit.setTimeout (f, 0, id); +}, "java.awt.AWTEvent,~O,~B"); +c$.setTimeout = Clazz_defineMethod (c$, "setTimeout", +function (f, msDelay, id) { +{ +var thread = java.lang.Thread.thisThread; +var thread0 = thread; +var id0 = SwingJS.eventID || 0; +setTimeout(function(_JSToolkit_setTimeout) { +SwingJS.eventID = id; +java.lang.Thread.thisThread = thread; +try { +if (f.run) +f.run(); +else +f(); +} catch (e) { +var s = "JSToolkit.setTimeout(" + id +"): " + e; +System.out.println(s); +alert(s)} +SwingJS.eventID = id0; +java.lang.Thread.thisThread = thread0; +}, msDelay); +}}, "~O,~N,~N"); +c$.invokeAndWait = Clazz_defineMethod (c$, "invokeAndWait", + function (f, id) { +{ +var thread = java.lang.Thread.thisThread; +var thread0 = thread; +(function(_JSToolkit_setTimeout) { +var id0 = SwingJS.eventID || 0; +System.out.println("runNow " + id); SwingJS.eventID = id; +java.lang.Thread.thisThread = thread; +if (f.run) +f.run(); +else +f(); +SwingJS.eventID = id0; +java.lang.Thread.thisThread = thread0; +})(); +}}, "swingjs.api.JSFunction,~N"); +c$.isDispatchThread = Clazz_defineMethod (c$, "isDispatchThread", +function () { +{ +return (!!SwingJS.eventID); +}}); +c$.checkClassMethod = Clazz_defineMethod (c$, "checkClassMethod", +function (component, fname, signature) { +{ +return component[fname] && component[fname][signature]; +}}, "java.awt.Component,~S,~S"); +c$.readyCallback = Clazz_defineMethod (c$, "readyCallback", +function (aname, fname, a, me) { +{ +Jmol._readyCallback(aname, fname, true,a, me); +}}, "~S,~S,~O,~O"); +c$.forceRepaint = Clazz_defineMethod (c$, "forceRepaint", +function (c) { +}, "java.awt.Component"); +c$.getHTML5Applet = Clazz_defineMethod (c$, "getHTML5Applet", +function (c) { +return (c.getAppContext ().getThreadGroup ()).getHtmlApplet (); +}, "javax.swing.JComponent"); +c$.taintUI = Clazz_defineMethod (c$, "taintUI", +function (c) { +{ +c.getUI && c.getUI() && c.getUI().setTainted(); +}}, "java.awt.Component"); +Clazz_overrideMethod (c$, "createComponent", +function (target) { +System.out.println ("JSToolkit creating LightweightPeer for " + target); +var peer = swingjs.JSToolkit.getUI (target, true); +return (peer == null ? new swingjs.JSComponentPeer (target) : peer); +}, "java.awt.Component"); +c$.getPlainDocument = Clazz_defineMethod (c$, "getPlainDocument", +function (c) { +return swingjs.JSToolkit.getInstance ("swingjs.JSPlainDocument"); +}, "javax.swing.JComponent"); +c$.getClassName = Clazz_defineMethod (c$, "getClassName", +function (c) { +{ +return c.__CLASS_NAME__; +}}, "~O"); +c$.getSignedStreamBytes = Clazz_defineMethod (c$, "getSignedStreamBytes", +function (bis) { +try { +return JU.AU.ensureSignedBytes (JU.Rdr.getStreamAsBytes (bis, null)); +} catch (e) { +if (Clazz_exceptionOf (e, java.io.IOException)) { +return null; +} else { +throw e; +} +} +}, "java.io.BufferedInputStream"); +c$.getFileContents = Clazz_defineMethod (c$, "getFileContents", +function (uri) { +{ +return Jmol._getFileData(uri); +}}, "~S"); +Clazz_defineMethod (c$, "getFileAsBytes", +function (filename) { +var data = swingjs.JSToolkit.getFileContents (filename); +var b = null; +if (JU.AU.isAB (data)) b = data; + else if (Clazz_instanceOf (data, String)) b = (data).getBytes (); + else if (Clazz_instanceOf (data, JU.SB)) b = JU.Rdr.getBytesFromSB (data); + else if (Clazz_instanceOf (data, java.io.InputStream)) try { +b = JU.Rdr.getLimitedStreamBytes (data, -1); +} catch (e) { +if (Clazz_exceptionOf (e, java.io.IOException)) { +} else { +throw e; +} +} +return JU.AU.ensureSignedBytes (b); +}, "~S"); +Clazz_defineMethod (c$, "getImagekit", + function () { +return (this.imageKit == null ? this.imageKit = swingjs.api.Interface.getInstance ("swingjs.JSImagekit", false) : this.imageKit); +}); +Clazz_defineMethod (c$, "createImage", +function (producer) { +producer.startProduction (null); +return null; +}, "java.awt.image.ImageProducer"); +Clazz_defineMethod (c$, "createImage", +function (filename) { +return this.getImagekit ().createImageFromBytes (swingjs.JSToolkit.getSignedStreamBytes ( new java.io.BufferedInputStream ( new java.io.ByteArrayInputStream (this.getFileAsBytes (filename)))), 0, -1); +}, "~S"); +Clazz_defineMethod (c$, "createImage", +function (url) { +try { +return this.getImagekit ().createImageFromBytes (swingjs.JSToolkit.getSignedStreamBytes ( new java.io.BufferedInputStream (url.openStream ())), 0, -1); +} catch (e) { +if (Clazz_exceptionOf (e, java.io.IOException)) { +return null; +} else { +throw e; +} +} +}, "java.net.URL"); +Clazz_defineMethod (c$, "createImage", +function (data, imageoffset, imagelength) { +return this.getImagekit ().createImageFromBytes (data, imageoffset, imagelength); +}, "~A,~N,~N"); +Clazz_overrideMethod (c$, "checkImage", +function (image, width, height, observer) { +return 63; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "prepareImage", +function (image, width, height, observer) { +return true; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +c$.hasFocus = Clazz_defineMethod (c$, "hasFocus", +function (c) { +var ui = swingjs.JSToolkit.getUI (c, false); +return (ui != null && ui.hasFocus ()); +}, "java.awt.Component"); +c$.getUI = Clazz_defineMethod (c$, "getUI", +function (c, isQuiet) { +var ui = null; +{ +ui = c.getUI && c.getUI(); +}if (ui == null) { +var s = "[JSToolkit] Component " + c.getClass ().getName () + " has no cooresponding JSComponentUI."; +System.out.println (s); +}return ui; +}, "java.awt.Component,~B"); +c$.requestFocus = Clazz_defineMethod (c$, "requestFocus", +function (c) { +var ui = swingjs.JSToolkit.getUI (c, false); +if (ui == null || !ui.isFocusable ()) return false; +var r = ((Clazz_isClassDefined ("swingjs.JSToolkit$1") ? 0 : swingjs.JSToolkit.$JSToolkit$1$ ()), Clazz_innerTypeInstance (swingjs.JSToolkit$1, this, Clazz_cloneFinals ("ui", ui))); +swingjs.JSToolkit.setTimeout (r, 50, 0); +return true; +}, "java.awt.Component"); +c$.getCompositor = Clazz_defineMethod (c$, "getCompositor", +function () { +return (swingjs.JSToolkit.compositor == null ? swingjs.JSToolkit.compositor = swingjs.api.Interface.getInstance ("swingjs.JSGraphicsCompositor", false) : swingjs.JSToolkit.compositor); +}); +c$.setGraphicsCompositeAlpha = Clazz_defineMethod (c$, "setGraphicsCompositeAlpha", +function (g, rule) { +return swingjs.JSToolkit.getCompositor ().setGraphicsCompositeAlpha (g, rule); +}, "swingjs.JSGraphics2D,~N"); +c$.drawImageOp = Clazz_defineMethod (c$, "drawImageOp", +function (g, img, op, x, y) { +return swingjs.JSToolkit.getCompositor ().drawImageOp (g, img, op, x, y); +}, "swingjs.JSGraphics2D,java.awt.image.BufferedImage,java.awt.image.BufferedImageOp,~N,~N"); +c$.filterRaster = Clazz_defineMethod (c$, "filterRaster", +function (src, dst, op) { +return swingjs.JSToolkit.getCompositor ().filterRaster (src, dst, op); +}, "java.awt.image.Raster,java.awt.image.WritableRaster,java.awt.image.RasterOp"); +c$.filterImage = Clazz_defineMethod (c$, "filterImage", +function (src, dst, op) { +return swingjs.JSToolkit.getCompositor ().filterImage (src, dst, op); +}, "java.awt.image.BufferedImage,java.awt.image.BufferedImage,java.awt.image.BufferedImageOp"); +c$.getZIndex = Clazz_defineMethod (c$, "getZIndex", +function (ui, what) { +{ +if (what) return getHTML5Applet(ui.c)._z[what]; +var c = ui.domNode; var z; +while (c && !(z = c.style["z-index"])) { +c = c.parentNode; +} +return z || 100000; +}}, "swingjs.plaf.JSComponentUI,~S"); +Clazz_overrideMethod (c$, "createFrame", +function (target) { +return this.createWindowPeer (target, true); +}, "java.awt.Frame"); +Clazz_overrideMethod (c$, "createWindow", +function (target) { +return this.createWindowPeer (target, false); +}, "java.awt.Window"); +Clazz_defineMethod (c$, "createWindowPeer", + function (target, isFrame) { +return (swingjs.JSToolkit.getInstance ("swingjs.JSWindowPeer")).setFrame (target, true); +}, "java.awt.Window,~B"); +c$.$JSToolkit$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (swingjs, "JSToolkit$1", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +this.f$.ui.requestFocus (null, false, false, 0, null); +}); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"gc", null, +"defaultContext", null, +"mapNotImpl", null, +"uid", null, +"dispatchID", 0, +"compositor", null); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.awt.event.InvocationEvent"], "swingjs.JSEvent", null, function () { +c$ = Clazz_declareType (swingjs, "JSEvent", java.awt.event.InvocationEvent); +Clazz_makeConstructor (c$, +function (t, r) { +Clazz_superConstructor (this, swingjs.JSEvent, [t, 1201, r, null, false]); +}, "swingjs.JSThread,Runnable"); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.awt.FontMetrics"], "swingjs.JSFontMetrics", ["swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.widths = null; +this.iwidths = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSFontMetrics", java.awt.FontMetrics); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, swingjs.JSFontMetrics, [null]); +}); +Clazz_defineMethod (c$, "setFont", +function (f) { +this.font = f; +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "getLeading", +function () { +return Clazz_doubleToInt (this.font.getSize () / 20) + 1; +}); +Clazz_overrideMethod (c$, "getAscent", +function () { +return this.font.getSize (); +}); +Clazz_overrideMethod (c$, "getDescent", +function () { +return Clazz_doubleToInt (this.font.getSize () / 4) + 1; +}); +Clazz_defineMethod (c$, "charWidth", +function (pt) { +return (pt.charCodeAt (0) < 256 ? Clazz_floatToInt (this.getWidthsFloat ()[pt.charCodeAt (0)]) : this.stringWidth ("" + pt)); +}, "~S"); +Clazz_defineMethod (c$, "charWidth", +function (pt) { +return (pt < 256 ? Clazz_floatToInt (this.getWidthsFloat ()[pt]) : this.stringWidth ("" + String.fromCharCode (pt))); +}, "~N"); +Clazz_overrideMethod (c$, "stringWidth", +function (s) { +return Clazz_floatToInt (swingjs.JSToolkit.getStringWidth (null, this.font, s)); +}, "~S"); +Clazz_overrideMethod (c$, "getWidths", +function () { +if (this.iwidths != null) return this.iwidths; +this.iwidths = Clazz_newIntArray (256, 0); +this.getWidthsFloat (); +for (var ch = 0; ch < 256; ch++) { +this.iwidths[ch] = Clazz_floatToInt (this.widths[ch]); +} +return this.iwidths; +}); +Clazz_defineMethod (c$, "getWidthsFloat", +function () { +if (this.widths != null) return this.widths; +this.widths = Clazz_newFloatArray (256, 0); +for (var ch = 0; ch < 256; ch++) { +this.widths[ch] = swingjs.JSToolkit.getStringWidth (null, this.font, "" + String.fromCharCode (ch)); +} +return this.widths; +}); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.lang.Thread", "swingjs.api.JSFunction"], "swingjs.JSThread", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.isJS = false; +Clazz_instantialize (this, arguments); +}, swingjs, "JSThread", Thread, swingjs.api.JSFunction); +Clazz_makeConstructor (c$, +function (group, name) { +Clazz_superConstructor (this, swingjs.JSThread, [group, name]); +{ +this.isJS = true; +}}, "ThreadGroup,~S"); +Clazz_overrideMethod (c$, "run", +function () { +this.run1 (0); +}); +Clazz_defineMethod (c$, "start", +function () { +{ +swingjs.JSToolkit.setTimeout(this, 1, 0); +}}); +Clazz_defineMethod (c$, "sleepAndReturn", +function (delay, state) { +if (!this.isJS) { +Thread.sleep (delay); +return false; +}var me = this; +var r = ((Clazz_isClassDefined ("swingjs.JSThread$1") ? 0 : swingjs.JSThread.$JSThread$1$ ()), Clazz_innerTypeInstance (swingjs.JSThread$1, this, Clazz_cloneFinals ("me", me, "state", state))); +{ +setTimeout( +function() {java.awt.Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(new java.awt.event.InvocationEvent(me, r))}, +delay +); +}return true; +}, "~N,~N"); +c$.$JSThread$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (swingjs, "JSThread$1", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +this.f$.me.run1 (this.f$.state); +}); +c$ = Clazz_p0p (); +}; +Clazz_defineStatics (c$, +"INIT", 0, +"LOOP", 1, +"DONE", 2); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.lang.ThreadGroup"], "swingjs.JSThreadGroup", null, function () { +c$ = Clazz_decorateAsClass (function () { +this.html5Applet = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSThreadGroup", ThreadGroup); +Clazz_defineMethod (c$, "setHtmlApplet", +function (html5Applet) { +this.html5Applet = html5Applet; +}, "swingjs.api.HTML5Applet"); +Clazz_defineMethod (c$, "getHtmlApplet", +function () { +return this.html5Applet; +}); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.applet.AppletContext", "$.AppletStub", "java.awt.Panel", "swingjs.api.JSInterface", "java.awt.Dimension"], "swingjs.JSAppletPanel", ["java.lang.InstantiationException", "java.net.URL", "java.awt.BorderLayout", "$.Font", "$.Toolkit", "javax.swing.JApplet", "jssun.applet.AppletEvent", "$.AppletEventMulticaster", "swingjs.JSAppletThread", "$.JSGraphics2D", "$.JSMouse", "$.JSThreadGroup", "$.JSToolkit", "$.JSUtil", "swingjs.api.Interface"], function () { +c$ = Clazz_decorateAsClass (function () { +this.params = null; +this.html5Applet = null; +this.fullName = null; +this.appletCodeBase = null; +this.appletIdiomaBase = null; +this.appletDocumentBase = null; +this.maximumSize = 2147483647; +this.appletName = null; +this.syncId = null; +this.testAsync = false; +this.async = false; +this.strJavaVersion = null; +this.strJavaVendor = null; +this.display = null; +this.canvas = null; +this.jsgraphics = null; +this.applet = null; +this.defaultAppletSize = null; +this.currentAppletSize = null; +this.nextStatus = 0; +this.status = 0; +this.listeners = null; +this.mouse = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSAppletPanel", java.awt.Panel, [java.applet.AppletStub, java.applet.AppletContext, swingjs.api.JSInterface]); +Clazz_prepareFields (c$, function () { +this.defaultAppletSize = new java.awt.Dimension (10, 10); +this.currentAppletSize = new java.awt.Dimension (10, 10); +}); +Clazz_makeConstructor (c$, +function (params) { +Clazz_superConstructor (this, swingjs.JSAppletPanel, []); +this.setPanel (); +this.set (params); +}, "java.util.Hashtable"); +Clazz_defineMethod (c$, "set", + function (params) { +System.out.println ("JSAppletPanel initializing"); +this.params = params; +this.htmlName = swingjs.JSUtil.split ("" + this.getParameter ("name"), "_object")[0]; +this.appletName = swingjs.JSUtil.split (this.htmlName + "_", "_")[0]; +this.syncId = this.getParameter ("syncId"); +this.fullName = this.htmlName + "__" + this.syncId + "__"; +params.put ("fullName", this.fullName); +var o = params.get ("codePath"); +if (o == null) o = "../java/"; +this.appletCodeBase = o.toString (); +this.appletIdiomaBase = this.appletCodeBase.substring (0, this.appletCodeBase.lastIndexOf ("/", this.appletCodeBase.length - 2) + 1) + "idioma"; +o = params.get ("documentBase"); +this.appletDocumentBase = (o == null ? "" : o.toString ()); +if (params.containsKey ("maximumSize")) Math.max ((params.get ("maximumSize")).intValue (), 100); +this.async = (this.testAsync || params.containsKey ("async")); +var applet = null; +var javaver = "?"; +{ +if(self.Jmol) { applet = +Jmol._applets[this.htmlName.split("_object")[0]]; javaver = +Jmol._version; } +}this.html5Applet = applet; +this.strJavaVersion = javaver; +this.strJavaVendor = "Java2Script/Java 1.6 (HTML5)"; +this.display = params.get ("display"); +this.threadGroup = new swingjs.JSThreadGroup (this.appletName); +this.myThread = new swingjs.JSAppletThread (this, this.threadGroup, this.appletName); +(this.threadGroup).setHtmlApplet (this.html5Applet); +{ +Jmol._applets[this.appletName + "_thread"] = +java.lang.Thread.thisThread = this.myThread; +}this.appContext = swingjs.JSToolkit.createNewAppContext (); +java.awt.Toolkit.getDefaultToolkit (); +try { +java.net.URL.setURLStreamHandlerFactory (swingjs.api.Interface.getInstance ("JU.AjaxURLStreamHandlerFactory", false)); +} catch (e) { +} +System.out.println ("JSAppletPanel initialized"); +}, "java.util.Hashtable"); +Clazz_defineMethod (c$, "start", +function () { +if (this.status == 0) this.myThread.start (); + else this.showStatus ("already started"); +}); +Clazz_defineMethod (c$, "addAppletListener", +function (l) { +this.listeners = jssun.applet.AppletEventMulticaster.add (this.listeners, l); +}, "jssun.applet.AppletListener"); +Clazz_defineMethod (c$, "removeAppletListener", +function (l) { +this.listeners = jssun.applet.AppletEventMulticaster.remove (this.listeners, l); +}, "jssun.applet.AppletListener"); +Clazz_defineMethod (c$, "dispatchAppletEvent", +function (id, argument) { +if (this.listeners != null) { +var evt = new jssun.applet.AppletEvent (this, id, argument); +this.listeners.appletStateChanged (evt); +}}, "~N,~O"); +Clazz_defineMethod (c$, "getCode", + function () { +return this.getParameter ("code"); +}); +Clazz_defineMethod (c$, "getCanvas", + function () { +return (this.canvas == null ? (this.canvas = this.html5Applet._getHtml5Canvas ()) : this.canvas); +}); +Clazz_overrideMethod (c$, "isActive", +function () { +return true; +}); +Clazz_overrideMethod (c$, "appletResize", +function (width, height) { +var currentSize = new java.awt.Dimension (this.currentAppletSize.width, this.currentAppletSize.height); +this.currentAppletSize.width = width; +this.currentAppletSize.height = height; +this.applet.setBounds (0, 0, this.getWidth (), this.getHeight ()); +this.applet.getRootPane ().setBounds (0, 0, this.getWidth (), this.getHeight ()); +this.applet.getContentPane ().setBounds (0, 0, this.getWidth (), this.getHeight ()); +(this.applet.getContentPane ()).revalidate (); +this.dispatchAppletEvent (51234, currentSize); +}, "~N,~N"); +Clazz_overrideMethod (c$, "getDocumentBase", +function () { +try { +return new java.net.URL (this.params.get ("documentBase")); +} catch (e) { +if (Clazz_exceptionOf (e, java.net.MalformedURLException)) { +return null; +} else { +throw e; +} +} +}); +Clazz_overrideMethod (c$, "getCodeBase", +function () { +try { +return new java.net.URL (this.params.get ("codePath")); +} catch (e) { +if (Clazz_exceptionOf (e, java.net.MalformedURLException)) { +return null; +} else { +throw e; +} +} +}); +Clazz_overrideMethod (c$, "getParameter", +function (name) { +var s = this.params.get (name); +System.out.println ("get parameter: " + name + " = " + s); +return (s == null ? null : "" + s); +}, "~S"); +Clazz_overrideMethod (c$, "getAppletContext", +function () { +return this; +}); +Clazz_defineMethod (c$, "getHeight", +function () { +return this.html5Applet._getHeight (); +}); +Clazz_defineMethod (c$, "getWidth", +function () { +return this.html5Applet._getWidth (); +}); +Clazz_defineMethod (c$, "setBounds", +function (x, y, width, height) { +this.reshape (x, y, width, height); +this.currentAppletSize.width = width; +this.currentAppletSize.height = height; +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getImage", +function (url) { +return null; +}, "java.net.URL"); +Clazz_overrideMethod (c$, "getApplet", +function (name) { +var applet = null; +{ +applet = Jmol._applets[name]; applet && (applet = +applet._applet); +}return applet; +}, "~S"); +Clazz_overrideMethod (c$, "getApplets", +function () { +return null; +}); +Clazz_defineMethod (c$, "showDocument", +function (url) { +{ +window.open(url.toString()); +}}, "java.net.URL"); +Clazz_defineMethod (c$, "showDocument", +function (url, target) { +{ +window.open(url.toString(), target); +}}, "java.net.URL,~S"); +Clazz_defineMethod (c$, "showStatus", +function (status) { +swingjs.JSToolkit.log (status); +{ +Clazz._LoaderProgressMonitor.showStatus(status, true); +}}, "~S"); +Clazz_overrideMethod (c$, "cacheFileByName", +function (fileName, isAdd) { +return 0; +}, "~S,~B"); +Clazz_overrideMethod (c$, "cachePut", +function (key, data) { +}, "~S,~O"); +Clazz_overrideMethod (c$, "destroy", +function () { +}); +Clazz_overrideMethod (c$, "getFullName", +function () { +return this.fullName; +}); +Clazz_overrideMethod (c$, "openFileAsyncSpecial", +function (fileName, flags) { +}, "~S,~N"); +Clazz_defineMethod (c$, "processMouseEvent", +function (id, x, y, modifiers, time) { +this.getMouse ().processEvent (id, x, y, modifiers, time); +return false; +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "getMouse", + function () { +return (this.mouse == null ? this.mouse = new swingjs.JSMouse (this) : this.mouse); +}); +Clazz_overrideMethod (c$, "processTwoPointGesture", +function (touches) { +this.getMouse ().processTwoPointGesture (touches); +}, "~A"); +Clazz_overrideMethod (c$, "setDisplay", +function (canvas) { +this.canvas = canvas; +}, "swingjs.api.HTML5Canvas"); +Clazz_overrideMethod (c$, "setScreenDimension", +function (width, height) { +this.setGraphics (this.jsgraphics = null); +if (this.applet != null) this.applet.resize (width, height); +}, "~N,~N"); +Clazz_overrideMethod (c$, "setStatusDragDropped", +function (mode, x, y, fileName) { +return false; +}, "~N,~N,~N,~S"); +Clazz_overrideMethod (c$, "startHoverWatcher", +function (enable) { +}, "~B"); +Clazz_overrideMethod (c$, "paint", +function (g) { +this.applet.paint (this.setGraphics (g)); +}, "java.awt.Graphics"); +Clazz_defineMethod (c$, "setGraphics", + function (g) { +return (g == null ? this.getGraphics () : g); +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "getGraphics", +function () { +if (this.jsgraphics == null) { +this.jsgraphics = new swingjs.JSGraphics2D (this.getCanvas ()); +this.jsgraphics.setWindowParameters (this.getWidth (), this.getHeight ()); +}return this.jsgraphics; +}); +Clazz_defineMethod (c$, "showAppletStatus", + function (status) { +this.getAppletContext ().showStatus (this.htmlName + " " + status); +}, "~S"); +Clazz_defineMethod (c$, "showAppletException", + function (t) { +{ +this.showAppletStatus("error " + (t.getMessage ? +t.getMessage() : t)); t.printStackTrace && +t.printStackTrace(); +}this.repaint (); +}, "Throwable"); +Clazz_defineMethod (c$, "run1", +function (mode) { +var ok = false; +switch (mode) { +case 0: +this.currentAppletSize.width = this.defaultAppletSize.width = this.getWidth (); +this.currentAppletSize.height = this.defaultAppletSize.height = this.getHeight (); +this.setLayout ( new java.awt.BorderLayout ()); +this.nextStatus = 1; +ok = true; +break; +case 1: +switch (this.nextStatus) { +case 1: +if (this.status != 0) { +this.showAppletStatus ("notdisposed"); +this.status = 7; +break; +}System.out.println ("JSAppletPanel runloader"); +this.runLoader (); +this.nextStatus = 2; +ok = true; +break; +case 2: +if (this.status != 1 && this.status != 5) { +this.showAppletStatus ("notloaded"); +break; +}System.out.println ("JSAppletPanel init"); +this.setFont ( new java.awt.Font ("Dialog", 0, 12)); +this.applet.resize (this.defaultAppletSize); +this.applet.init (); +this.validate (); +this.status = 2; +this.showAppletStatus ("initialized"); +this.nextStatus = 3; +ok = true; +break; +case 3: +if (this.status != 2 && this.status != 4) { +this.showAppletStatus ("notstarted"); +this.status = 7; +break; +}this.applet.getRootPane ().addNotify (); +System.out.println ("JSAppletPanel start" + this.currentAppletSize); +this.applet.resize (this.currentAppletSize); +this.applet.start (); +this.status = 3; +this.showAppletStatus ("started"); +this.nextStatus = 35; +ok = true; +break; +case 35: +swingjs.JSToolkit.readyCallback (this.appletName, this.fullName, this.applet, this); +break; +case 4: +if (this.status == 3) { +this.status = 4; +this.applet.setVisible (false); +this.applet.stop (); +this.showAppletStatus ("stopped"); +} else { +this.showAppletStatus ("notstopped"); +this.status = 7; +}break; +case 5: +if (this.status == 4 || this.status == 2) { +this.status = 5; +this.applet.destroy (); +this.showAppletStatus ("destroyed"); +} else { +this.showAppletStatus ("notdestroyed"); +this.status = 7; +}break; +case 75: +if (this.status == 5 || this.status == 1) { +this.showAppletStatus ("notdisposed"); +this.status = 7; +} else { +this.status = 0; +this.removeChild (this.applet); +this.applet = null; +this.showAppletStatus ("disposed"); +}break; +case 6: +break; +default: +System.out.println ("unrecognized JSAppletPanel status: " + this.nextStatus); +break; +} +break; +default: +System.out.println ("unrecognized JSAppletThread mode: " + mode); +break; +} +return (ok ? 1 : 2); +}, "~N"); +Clazz_defineMethod (c$, "runLoader", + function () { +this.dispatchAppletEvent (51235, null); +this.status = 1; +var code = this.getCode (); +try { +if (code == null) { +System.err.println ("runloader.err-- \"code\" must be specified."); +throw new InstantiationException ("\"code\" must be specified."); +}this.applet = swingjs.JSToolkit.getInstance (code); +if (this.applet == null) { +System.out.println (code + " could not be launched"); +this.status = 7; +} else if (!(Clazz_instanceOf (this.applet, javax.swing.JApplet))) { +System.out.println (code + " is not a JApplet!?"); +this.status = 7; +}} catch (e$$) { +if (Clazz_exceptionOf (e$$, InstantiationException)) { +var e = e$$; +{ +this.status = 7; +this.showAppletException (e); +return; +} +} else if (Clazz_exceptionOf (e$$, Exception)) { +var e = e$$; +{ +this.status = 7; +this.showAppletException (e); +return; +} +} else if (Clazz_exceptionOf (e$$, ThreadDeath)) { +var e = e$$; +{ +this.status = 7; +this.showAppletStatus ("death"); +return; +} +} else if (Clazz_exceptionOf (e$$, Error)) { +var e = e$$; +{ +this.status = 7; +this.showAppletException (e); +return; +} +} else { +throw e$$; +} +} finally { +this.dispatchAppletEvent (51236, null); +} +if (this.applet != null) { +this.applet.setStub (this); +this.applet.setVisible (false); +this.add ("Center", this.applet); +this.applet.setDispatcher (); +this.applet.addNotify (); +this.showAppletStatus ("loaded"); +this.validate (); +}}); +Clazz_defineMethod (c$, "getUI", +function () { +return null; +}); +Clazz_overrideMethod (c$, "repaintImpl", +function (tm, x, y, width, height) { +if (this.applet.isVisible () && this.applet.getWidth () > 0 && this.applet.getHeight () > 0) { +this.applet.getContentPane ().repaint (tm, x, y, width, height); +}}, "~N,~N,~N,~N,~N"); +Clazz_defineStatics (c$, +"APPLET_UNINITIALIZED", 0, +"APPLET_LOAD", 1, +"APPLET_INIT", 2, +"APPLET_START", 3, +"APPLET_READY", 35, +"APPLET_STOP", 4, +"APPLET_DESTROY", 5, +"APPLET_QUIT", 6, +"APPLET_ERROR", 7, +"APPLET_DISPOSE", 75, +"APPLET_RESIZE", 51234, +"APPLET_LOADING", 51235, +"APPLET_LOADING_COMPLETED", 51236); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["jssun.java2d.SunGraphics2D"], "swingjs.JSGraphics2D", ["java.util.HashMap", "java.awt.BasicStroke", "$.Rectangle", "$.RenderingHints", "$.Toolkit", "java.awt.geom.AffineTransform", "swingjs.JSToolkit", "swingjs.api.HTML5CanvasContext2D"], function () { +c$ = Clazz_decorateAsClass (function () { +this.constrainX = 0; +this.constrainY = 0; +this.windowWidth = 0; +this.windowHeight = 0; +this.canvas = null; +this.ctx = null; +this.gc = null; +this.paintState = 0; +this.compositeState = -2147483648; +this.strokeState = 0; +this.$transformState = 0; +this.clipState = 0; +this.isShifted = false; +this.font = null; +this.inPath = false; +this.currentClip = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSGraphics2D", jssun.java2d.SunGraphics2D, Cloneable); +Clazz_makeConstructor (c$, +function (canvas) { +Clazz_superConstructor (this, swingjs.JSGraphics2D, []); +this.hints = new java.awt.RenderingHints ( new java.util.HashMap ()); +this.canvas = canvas; +this.ctx = this.canvas.getContext ("2d"); +this.$transform = new java.awt.geom.AffineTransform (); +{ +this.gc = SwingJS; +}}, "~O"); +Clazz_overrideMethod (c$, "getDeviceConfiguration", +function () { +return this.gc; +}); +Clazz_overrideMethod (c$, "drawLine", +function (x0, y0, x1, y1) { +var inPath = this.inPath; +if (!inPath) this.ctx.beginPath (); +this.ctx.moveTo (x0, y0); +this.ctx.lineTo (x1, y1); +if (!inPath) this.ctx.stroke (); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "drawCircle", +function (x, y, diameter) { +this.drawArc (x, y, diameter, diameter, 0, 360); +}, "~N,~N,~N"); +Clazz_overrideMethod (c$, "fillArc", +function (x, y, width, height, startAngle, arcAngle) { +this.doArc (x, y, width, height, startAngle, arcAngle, true); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "drawArc", +function (x, y, width, height, startAngle, arcAngle) { +this.doArc (x, y, width, height, startAngle, arcAngle, false); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "save", + function () { +this.ctx.save (); +}); +Clazz_defineMethod (c$, "restore", + function () { +this.ctx.restore (); +}); +Clazz_defineMethod (c$, "doArc", + function (x, y, width, height, startAngle, arcAngle, fill) { +var isCircle = (arcAngle - startAngle == 360); +this.save (); +this.ctx.translate (x, y); +this.ctx.scale (Clazz_doubleToInt (width / height), height); +this.ctx.beginPath (); +if (fill) { +}this.ctx.arc (0.5, 0.5, 0.5, this.toRad (startAngle), this.toRad (arcAngle), false); +if (isCircle) this.ctx.closePath (); +this.ctx.stroke (); +this.restore (); +}, "~N,~N,~N,~N,~N,~N,~B"); +Clazz_defineMethod (c$, "toRad", + function (a) { +return a * 3.141592653589793 / 180; +}, "~N"); +Clazz_defineMethod (c$, "drawPolygon", +function (ayPoints, axPoints, nPoints) { +this.doPoly (ayPoints, axPoints, nPoints, false); +}, "~A,~A,~N"); +Clazz_defineMethod (c$, "doPoly", + function (axPoints, ayPoints, nPoints, doFill) { +this.ctx.beginPath (); +this.ctx.moveTo (axPoints[0], ayPoints[0]); +for (var i = 1; i < nPoints; i++) this.ctx.lineTo (axPoints[i], ayPoints[i]); + +if (doFill) this.ctx.fill (); + else this.ctx.stroke (); +}, "~A,~A,~N,~B"); +Clazz_overrideMethod (c$, "drawRect", +function (x, y, width, height) { +this.ctx.beginPath (); +this.ctx.rect (x, y, width, height); +this.ctx.stroke (); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "drawString", +function (s, x, y) { +this.ctx.fillText (s, x, y); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "background", +function (bgcolor) { +this.backgroundColor = bgcolor; +if (bgcolor == null) { +if (!this.isShifted) this.ctx.translate (-0.5, -0.5); +this.isShifted = true; +return; +}this.ctx.clearRect (0, 0, this.windowWidth, this.windowHeight); +this.setGraphicsColor (bgcolor); +this.fillRect (0, 0, this.windowWidth, this.windowHeight); +}, "java.awt.Color"); +Clazz_defineMethod (c$, "fillCircle", +function (x, y, diameter) { +var r = diameter / 2; +this.ctx.beginPath (); +this.ctx.arc (x + r, y + r, r, 0, 6.283185307179586, false); +this.ctx.fill (); +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "fillPolygon", +function (ayPoints, axPoints, nPoints) { +this.doPoly (ayPoints, axPoints, nPoints, true); +}, "~A,~A,~N"); +Clazz_overrideMethod (c$, "fillRect", +function (x, y, width, height) { +this.ctx.fillRect (x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setGraphicsColor", +function (c) { +var s = swingjs.JSToolkit.getCSSColor (c); +{ +this.ctx.fillStyle = s; this.ctx.strokeStyle = s; +}}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setFont", +function (font) { +this.font = font; +if (this.ctx == null) return; +var s = swingjs.JSToolkit.getCanvasFont (font); +{ +this.ctx.font = s; +}}, "java.awt.Font"); +Clazz_defineMethod (c$, "setStrokeBold", +function (tf) { +this.setLineWidth (tf ? 2. : 1.); +}, "~B"); +Clazz_defineMethod (c$, "setLineWidth", + function (d) { +{ +this.ctx.lineWidth = d; +}}, "~N"); +Clazz_defineMethod (c$, "setWindowParameters", +function (width, height) { +this.windowWidth = width; +this.windowHeight = height; +}, "~N,~N"); +Clazz_defineMethod (c$, "canDoLineTo", +function () { +return true; +}); +Clazz_defineMethod (c$, "doStroke", +function (isBegin) { +this.inPath = isBegin; +if (isBegin) { +this.ctx.beginPath (); +} else { +this.ctx.stroke (); +}}, "~B"); +Clazz_defineMethod (c$, "lineTo", +function (x2, y2) { +this.ctx.lineTo (x2, y2); +}, "~N,~N"); +Clazz_overrideMethod (c$, "clip", +function (s) { +this.doShape (s); +this.ctx.clip (); +}, "java.awt.Shape"); +Clazz_overrideMethod (c$, "draw", +function (s) { +this.doShape (s); +this.ctx.stroke (); +}, "java.awt.Shape"); +Clazz_defineMethod (c$, "doShape", + function (s) { +this.ctx.beginPath (); +var pts = Clazz_newDoubleArray (6, 0); +var pi = s.getPathIterator (null); +while (!pi.isDone ()) { +switch (pi.currentSegment (pts)) { +case 0: +this.ctx.moveTo (pts[0], pts[1]); +break; +case 1: +this.ctx.lineTo (pts[0], pts[1]); +break; +case 2: +this.ctx.quadraticCurveTo (pts[0], pts[1], pts[2], pts[3]); +break; +case 3: +this.ctx.bezeierCurveTo (pts[0], pts[1], pts[2], pts[3], pts[4], pts[5]); +break; +case 4: +this.ctx.closePath (); +break; +} +pi.next (); +} +return pi.getWindingRule (); +}, "java.awt.Shape"); +Clazz_overrideMethod (c$, "fill", +function (s) { +if (this.doShape (s) == 0) { +this.ctx.fill("evenodd"); +} else this.ctx.fill (); +}, "java.awt.Shape"); +Clazz_defineMethod (c$, "drawImage", +function (img, x, y, observer) { +System.out.println ("JSGraphics testing draw image"); +this.drawString ("JSGraphics testing draw img", 50, 50); +if (img != null) { +var imgNode = this.getImageNode (img); +if (imgNode != null) this.ctx.drawImage (imgNode, x, y, img.getWidth (observer), img.getHeight (observer)); +if (observer != null) this.observe (img, observer, imgNode != null); +}return true; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "observe", + function (img, observer, isOK) { +observer.imageUpdate (img, (isOK ? 0 : 192), -1, -1, -1, -1); +}, "java.awt.Image,java.awt.image.ImageObserver,~B"); +Clazz_defineMethod (c$, "drawImage", +function (img, x, y, width, height, observer) { +if (img != null) { +var imgNode = this.getImageNode (img); +if (imgNode != null) this.ctx.drawImage (imgNode, x, y, width, height); +if (observer != null) this.observe (img, observer, imgNode != null); +}return true; +}, "java.awt.Image,~N,~N,~N,~N,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "drawImage", +function (img, x, y, bgcolor, observer) { +swingjs.JSToolkit.notImplemented (null); +return this.drawImage (img, x, y, null); +}, "java.awt.Image,~N,~N,java.awt.Color,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "drawImage", +function (img, x, y, width, height, bgcolor, observer) { +swingjs.JSToolkit.notImplemented (null); +return this.drawImage (img, x, y, width, height, null); +}, "java.awt.Image,~N,~N,~N,~N,java.awt.Color,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "drawImage", +function (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer) { +if (img != null) { +var imgNode = this.getImageNode (img); +if (imgNode != null) swingjs.api.HTML5CanvasContext2D.stretchImage (this.ctx, imgNode, sx1, sy1, sx2 - sx1, sy2 - sy1, dx1, dy1, dx2 - dx1, dy2 - dy1); +if (observer != null) this.observe (img, observer, imgNode != null); +}return true; +}, "java.awt.Image,~N,~N,~N,~N,~N,~N,~N,~N,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "getImageNode", + function (img) { +var imgNode = null; +{ +imgNode = img._imgNode; +}if (imgNode == null) imgNode = swingjs.JSToolkit.getCompositor ().createImageNode (img); +return imgNode; +}, "java.awt.Image"); +Clazz_defineMethod (c$, "drawImage", +function (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bgcolor, observer) { +swingjs.JSToolkit.notImplemented (null); +return this.drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, observer); +}, "java.awt.Image,~N,~N,~N,~N,~N,~N,~N,~N,java.awt.Color,java.awt.image.ImageObserver"); +Clazz_defineMethod (c$, "drawImage", +function (img, xform, obs) { +swingjs.JSToolkit.notImplemented (null); +return false; +}, "java.awt.Image,java.awt.geom.AffineTransform,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "drawRenderedImage", +function (img, xform) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.image.RenderedImage,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "drawRenderableImage", +function (img, xform) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.image.renderable.RenderableImage,java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "hit", +function (rect, s, onStroke) { +swingjs.JSToolkit.notImplemented (null); +return false; +}, "java.awt.Rectangle,java.awt.Shape,~B"); +Clazz_overrideMethod (c$, "setPaint", +function (paint) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.Paint"); +Clazz_overrideMethod (c$, "setStroke", +function (s) { +if (!(Clazz_instanceOf (s, java.awt.BasicStroke))) return; +var b = s; +var dash = b.getDashArray (); +var idash = Clazz_newIntArray (dash == null ? 0 : dash.length, 0); +for (var i = idash.length; --i >= 0; ) idash[i] = Clazz_floatToInt (dash[i]); + +this.ctx.setLineDash (idash); +this.setLineWidth (b.getLineWidth ()); +var lineCap; +var lineJoin; +var miterLimit = -1; +switch (b.getEndCap ()) { +case 0: +lineCap = "butt"; +break; +case 2: +lineCap = "square"; +break; +case 1: +default: +lineCap = "round"; +} +switch (b.getLineJoin ()) { +case 2: +lineJoin = "bevel"; +break; +case 0: +lineJoin = "miter"; +miterLimit = b.getMiterLimit (); +break; +case 1: +lineJoin = "round"; +} +{ +this.ctx.lineCap = lineCap; this.ctx.lineJoin = lineJoin; if +(miterLimit >= 0) this.ctx.miterLimit = miterLimit; +}}, "java.awt.Stroke"); +Clazz_overrideMethod (c$, "setRenderingHint", +function (hintKey, hintValue) { +this.hints.put (hintKey, hintValue); +}, "java.awt.RenderingHints.Key,~O"); +Clazz_overrideMethod (c$, "getRenderingHint", +function (hintKey) { +return this.hints.get (hintKey); +}, "java.awt.RenderingHints.Key"); +Clazz_overrideMethod (c$, "setRenderingHints", +function (hints) { +this.hints = new java.awt.RenderingHints (hints); +}, "java.util.Map"); +Clazz_overrideMethod (c$, "addRenderingHints", +function (hints) { +for (var e, $e = hints.entrySet ().iterator (); $e.hasNext () && ((e = $e.next ()) || true);) this.hints.put (e.getKey (), e.getValue ()); + +}, "java.util.Map"); +Clazz_overrideMethod (c$, "getRenderingHints", +function () { +return this.hints; +}); +Clazz_defineMethod (c$, "translate", +function (x, y) { +this.ctx.translate (x, y); +}, "~N,~N"); +Clazz_overrideMethod (c$, "scale", +function (sx, sy) { +this.ctx.scale (sx, sy); +}, "~N,~N"); +Clazz_overrideMethod (c$, "setBackground", +function (color) { +this.background (color); +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "getBackground", +function () { +return this.backgroundColor; +}); +Clazz_overrideMethod (c$, "createSwingJS", +function () { +return this.clone (); +}); +Clazz_overrideMethod (c$, "clone", +function () { +this.save (); +return this.clone0 (); +}); +Clazz_overrideMethod (c$, "dispose", +function () { +if (this.compositeState >= 0) this.setComposite (null); +this.restore (); +}); +Clazz_overrideMethod (c$, "getColor", +function () { +return this.foregroundColor; +}); +Clazz_overrideMethod (c$, "setColor", +function (c) { +this.foregroundColor = c; +this.setGraphicsColor (c); +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "getFont", +function () { +return this.font; +}); +Clazz_defineMethod (c$, "getFontMetrics", +function (f) { +return java.awt.Toolkit.getDefaultToolkit ().getFontMetrics (f); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "clipRect", +function (x, y, width, height) { +this.ctx.beginPath (); +this.ctx.rect (x, y, width, height); +this.currentClip = new java.awt.Rectangle (x, y, width, height); +this.ctx.clip (); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setClip", +function (x, y, width, height) { +this.currentClip = new java.awt.Rectangle (x, y, width, height); +{ +if (arguments.length == 1) { setClip1(x); return; } +}this.ctx.beginPath (); +this.ctx.rect (x, y, width, height); +this.currentClip = new java.awt.Rectangle (x, y, width, height); +this.ctx.clip (); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "setClip1", +function (clip) { +this.ctx.beginPath (); +this.doShape (clip); +this.ctx.clip (); +}, "java.awt.Shape"); +Clazz_overrideMethod (c$, "clearRect", +function (x, y, width, height) { +this.ctx.clearRect (x, y, width, height); +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "drawPolyline", +function (xPoints, yPoints, nPoints) { +if (nPoints < 2) return; +this.ctx.moveTo (xPoints[0], yPoints[0]); +for (var i = 1; i < nPoints; i++) { +this.ctx.lineTo (xPoints[i], yPoints[i]); +} +}, "~A,~A,~N"); +Clazz_overrideMethod (c$, "copyArea", +function (x, y, width, height, dx, dy) { +swingjs.JSToolkit.notImplemented (null); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "drawRoundRect", +function (x, y, width, height, arcWidth, arcHeight) { +swingjs.JSToolkit.notImplemented (null); +this.drawRect (x, y, width, height); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "fillRoundRect", +function (x, y, width, height, arcWidth, arcHeight) { +swingjs.JSToolkit.notImplemented (null); +this.fillRect (x, y, width, height); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "drawOval", +function (x, y, width, height) { +swingjs.JSToolkit.notImplemented (null); +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "fillOval", +function (x, y, width, height) { +swingjs.JSToolkit.notImplemented (null); +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getClip", +function () { +swingjs.JSToolkit.notImplemented (null); +return null; +}); +Clazz_overrideMethod (c$, "drawStringTrans", +function (str, x, y) { +swingjs.JSToolkit.notImplemented (null); +}, "~S,~N,~N"); +Clazz_defineMethod (c$, "drawString", +function (iterator, x, y) { +swingjs.JSToolkit.notImplemented (null); +}, "java.text.AttributedCharacterIterator,~N,~N"); +Clazz_overrideMethod (c$, "drawStringAttrTrans", +function (iterator, x, y) { +swingjs.JSToolkit.notImplemented (null); +}, "java.text.AttributedCharacterIterator,~N,~N"); +Clazz_overrideMethod (c$, "translateTrans", +function (tx, ty) { +swingjs.JSToolkit.notImplemented (null); +}, "~N,~N"); +Clazz_defineMethod (c$, "rotate", +function (theta) { +swingjs.JSToolkit.notImplemented (null); +}, "~N"); +Clazz_defineMethod (c$, "rotate", +function (theta, x, y) { +swingjs.JSToolkit.notImplemented (null); +}, "~N,~N,~N"); +Clazz_overrideMethod (c$, "shear", +function (shx, shy) { +swingjs.JSToolkit.notImplemented (null); +}, "~N,~N"); +Clazz_overrideMethod (c$, "transform", +function (xform) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "setTransform", +function (Tx) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.geom.AffineTransform"); +Clazz_overrideMethod (c$, "getTransform", +function () { +swingjs.JSToolkit.notImplemented (null); +return null; +}); +Clazz_defineMethod (c$, "cloneTransform", +function () { +swingjs.JSToolkit.notImplemented (null); +return null; +}); +Clazz_overrideMethod (c$, "getPaint", +function () { +swingjs.JSToolkit.notImplemented (null); +return null; +}); +Clazz_overrideMethod (c$, "getStroke", +function () { +swingjs.JSToolkit.notImplemented (null); +return null; +}); +Clazz_overrideMethod (c$, "getFontRenderContext", +function () { +swingjs.JSToolkit.notImplemented (null); +return null; +}); +Clazz_overrideMethod (c$, "setPaintMode", +function () { +swingjs.JSToolkit.notImplemented (null); +}); +Clazz_overrideMethod (c$, "setXORMode", +function (c1) { +swingjs.JSToolkit.notImplemented (null); +}, "java.awt.Color"); +Clazz_defineMethod (c$, "getClipBounds", +function () { +var r = null; +{ +if (arguments.length == 1) r = arguments[0]; +}var clipRect = this.getClipBoundsImpl (); +if (r == null) { +r = clipRect; +} else { +r.x = clipRect.x; +r.y = clipRect.y; +r.width = clipRect.width; +r.height = clipRect.height; +}return r; +}); +Clazz_defineMethod (c$, "getClipBoundsImpl", + function () { +if (this.currentClip == null) { +this.currentClip = new java.awt.Rectangle (0, 0, this.windowWidth, this.windowHeight); +}return this.currentClip; +}); +Clazz_overrideMethod (c$, "setComposite", +function (comp) { +var newRule = 0; +var isValid = (comp == null || (Clazz_instanceOf (comp, java.awt.AlphaComposite)) && (newRule = (comp).getRule ()) != this.compositeState); +if (!isValid) return; +if (swingjs.JSToolkit.setGraphicsCompositeAlpha (this, newRule)) this.compositeState = newRule; +}, "java.awt.Composite"); +Clazz_defineMethod (c$, "drawImage", +function (img, op, x, y) { +swingjs.JSToolkit.drawImageOp (this, img, op, x, y); +}, "java.awt.image.BufferedImage,java.awt.image.BufferedImageOp,~N,~N"); +Clazz_defineMethod (c$, "setAlpha", +function (f) { +{ +this.ctx.globalAlpha = f; +}}, "~N"); +Clazz_defineStatics (c$, +"saveLevel", 0); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["swingjs.JSThread"], "swingjs.JSAppletThread", ["javax.swing.SwingUtilities"], function () { +c$ = Clazz_decorateAsClass (function () { +this.ap = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSAppletThread", swingjs.JSThread); +Clazz_makeConstructor (c$, +function (ap, group, name) { +Clazz_superConstructor (this, swingjs.JSAppletThread, [group, name]); +this.ap = ap; +}, "swingjs.JSAppletPanel,ThreadGroup,~S"); +Clazz_overrideMethod (c$, "run1", +function (mode) { +mode = this.ap.run1 (mode); +if (mode != 2) this.dispatchAndReturn (null, mode); +}, "~N"); +Clazz_defineMethod (c$, "dispatchAndReturn", +function (r, mode) { +var m = mode; +javax.swing.SwingUtilities.invokeLater (((Clazz_isClassDefined ("swingjs.JSAppletThread$1") ? 0 : swingjs.JSAppletThread.$JSAppletThread$1$ ()), Clazz_innerTypeInstance (swingjs.JSAppletThread$1, this, Clazz_cloneFinals ("m", m)))); +}, "Runnable,~N"); +c$.$JSAppletThread$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (swingjs, "JSAppletThread$1", null, Runnable); +Clazz_overrideMethod (c$, "run", +function () { +this.b$["swingjs.JSAppletThread"].run1 (this.f$.m); +}); +c$ = Clazz_p0p (); +}; +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (null, "swingjs.JSMouse", ["JU.V3", "java.awt.Toolkit", "java.awt.event.MouseEvent"], function () { +c$ = Clazz_decorateAsClass (function () { +this.ap = null; +this.isMouseDown = false; +this.wheeling = false; +this.xWhenPressed = 0; +this.yWhenPressed = 0; +this.modifiersWhenPressed10 = 0; +Clazz_instantialize (this, arguments); +}, swingjs, "JSMouse"); +Clazz_makeConstructor (c$, +function (ap) { +this.ap = ap; +}, "swingjs.JSAppletPanel"); +Clazz_defineMethod (c$, "processEvent", +function (id, x, y, modifiers, time) { +if (id != -1) modifiers = swingjs.JSMouse.applyLeftMouse (modifiers); +switch (id) { +case -1: +this.wheeled (time, x, modifiers); +break; +case 501: +this.xWhenPressed = x; +this.yWhenPressed = y; +this.modifiersWhenPressed10 = modifiers; +this.pressed (time, x, y, modifiers, false); +break; +case 506: +this.dragged (time, x, y, modifiers); +break; +case 504: +this.entry (time, x, y, false); +break; +case 505: +this.entry (time, x, y, true); +break; +case 503: +this.moved (time, x, y, modifiers); +break; +case 502: +this.released (time, x, y, modifiers); +if (x == this.xWhenPressed && y == this.yWhenPressed && modifiers == this.modifiersWhenPressed10) { +this.clicked (time, x, y, modifiers, 1); +}break; +default: +return false; +} +return true; +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "processTwoPointGesture", +function (touches) { +if (touches[0].length < 2) return; +var t1 = touches[0]; +var t2 = touches[1]; +var t1first = t1[0]; +var t1last = t1[t2.length - 1]; +var x1first = t1first[0]; +var x1last = t1last[0]; +var dx1 = x1last - x1first; +var y1first = t1first[1]; +var y1last = t1last[1]; +var dy1 = y1last - y1first; +var v1 = JU.V3.new3 (dx1, dy1, 0); +var d1 = v1.length (); +var t2first = t2[0]; +var t2last = t2[t2.length - 1]; +var x2first = t2first[0]; +var x2last = t2last[0]; +var dx2 = x2last - x2first; +var y2first = t2first[1]; +var y2last = t2last[1]; +var dy2 = y2last - y2first; +var v2 = JU.V3.new3 (dx2, dy2, 0); +var d2 = v2.length (); +if (d1 < 1 || d2 < 1) return; +v1.normalize (); +v2.normalize (); +var cos12 = (v1.dot (v2)); +if (cos12 > 0.8) { +var deltaX = Clazz_floatToInt (x1last - t1[t1.length - 2][0]); +var deltaY = Clazz_floatToInt (y1last - t1[t1.length - 2][1]); +this.translateXYBy (deltaX, deltaY); +} else if (cos12 < -0.8) { +v1 = JU.V3.new3 (x2first - x1first, y2first - y1first, 0); +v2 = JU.V3.new3 (x2last - x1last, y2last - y1last, 0); +var dx = v2.length () - v1.length (); +this.wheeled (System.currentTimeMillis (), dx < 0 ? -1 : 1, 32); +}}, "~A"); +Clazz_defineMethod (c$, "translateXYBy", + function (deltaX, deltaY) { +}, "~N,~N"); +Clazz_defineMethod (c$, "mouseClicked", +function (e) { +this.clicked (e.getWhen (), e.getX (), e.getY (), e.getModifiers (), e.getClickCount ()); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseEntered", +function (e) { +this.entry (e.getWhen (), e.getX (), e.getY (), false); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseExited", +function (e) { +this.entry (e.getWhen (), e.getX (), e.getY (), true); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mousePressed", +function (e) { +this.pressed (e.getWhen (), e.getX (), e.getY (), e.getModifiers (), e.isPopupTrigger ()); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseReleased", +function (e) { +this.released (e.getWhen (), e.getX (), e.getY (), e.getModifiers ()); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseDragged", +function (e) { +var modifiers = e.getModifiers (); +if ((modifiers & 28) == 0) modifiers |= 16; +this.dragged (e.getWhen (), e.getX (), e.getY (), modifiers); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseMoved", +function (e) { +this.moved (e.getWhen (), e.getX (), e.getY (), e.getModifiers ()); +}, "java.awt.event.MouseEvent"); +Clazz_defineMethod (c$, "mouseWheelMoved", +function (e) { +e.consume (); +this.wheeled (e.getWhen (), e.getWheelRotation (), e.getModifiers ()); +}, "java.awt.event.MouseWheelEvent"); +Clazz_defineMethod (c$, "entry", + function (time, x, y, isExit) { +this.wheeling = false; +this.mouseEnterExit (time, x, y, isExit); +}, "~N,~N,~N,~B"); +Clazz_defineMethod (c$, "clicked", + function (time, x, y, modifiers, clickCount) { +this.mouseAction (500, time, x, y, 1, modifiers); +}, "~N,~N,~N,~N,~N"); +Clazz_defineMethod (c$, "moved", + function (time, x, y, modifiers) { +if (this.isMouseDown) this.mouseAction (506, time, x, y, 0, swingjs.JSMouse.applyLeftMouse (modifiers)); + else this.mouseAction (503, time, x, y, 0, modifiers); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "wheeled", + function (time, rotation, modifiers) { +this.wheeling = true; +this.mouseAction (507, time, 0, rotation, 0, modifiers & -29 | 32); +}, "~N,~N,~N"); +Clazz_defineMethod (c$, "pressed", + function (time, x, y, modifiers, isPopupTrigger) { +this.isMouseDown = true; +this.wheeling = false; +this.mouseAction (501, time, x, y, 0, modifiers); +}, "~N,~N,~N,~N,~B"); +Clazz_defineMethod (c$, "released", + function (time, x, y, modifiers) { +this.isMouseDown = false; +this.wheeling = false; +this.mouseAction (502, time, x, y, 0, modifiers); +}, "~N,~N,~N,~N"); +Clazz_defineMethod (c$, "dragged", + function (time, x, y, modifiers) { +if (this.wheeling) return; +if ((modifiers & 20) == 20) modifiers = modifiers & -5 | 2; +this.mouseAction (506, time, x, y, 0, modifiers); +}, "~N,~N,~N,~N"); +c$.applyLeftMouse = Clazz_defineMethod (c$, "applyLeftMouse", + function (modifiers) { +return ((modifiers & 28) == 0) ? (modifiers | 16) : modifiers; +}, "~N"); +Clazz_defineMethod (c$, "getButton", + function (modifiers) { +switch (modifiers & 28) { +case 16: +return 1; +case 8: +return 2; +case 4: +return 3; +default: +return 0; +} +}, "~N"); +Clazz_defineMethod (c$, "mouseEnterExit", + function (time, x, y, isExit) { +}, "~N,~N,~N,~B"); +Clazz_defineMethod (c$, "mouseAction", + function (id, time, x, y, count, modifiers) { +var popupTrigger = false; +var button = this.getButton (modifiers); +var source = this.ap.applet; +var e = new java.awt.event.MouseEvent (source, id, time, modifiers, x, y, x, y, count, popupTrigger, button); +java.awt.Toolkit.getEventQueue ().postEvent (e); +}, "~N,~N,~N,~N,~N,~N"); +Clazz_defineStatics (c$, +"MOUSE_LEFT", 16, +"MOUSE_MIDDLE", 8, +"MOUSE_RIGHT", 4, +"MOUSE_WHEEL", 32, +"MAC_COMMAND", 20, +"BUTTON_MASK", 28); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.awt.peer.LightweightPeer"], "swingjs.JSComponentPeer", ["swingjs.JSToolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.target = null; +this.ui = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSComponentPeer", null, java.awt.peer.LightweightPeer); +Clazz_makeConstructor (c$, +function (target) { +this.target = target; +this.ui = swingjs.JSToolkit.getUI (target, false); +}, "java.awt.Component"); +Clazz_overrideMethod (c$, "isObscured", +function () { +return false; +}); +Clazz_overrideMethod (c$, "canDetermineObscurity", +function () { +return false; +}); +Clazz_overrideMethod (c$, "setVisible", +function (b) { +}, "~B"); +Clazz_overrideMethod (c$, "setEnabled", +function (b) { +}, "~B"); +Clazz_overrideMethod (c$, "paint", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "repaint", +function (tm, x, y, width, height) { +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "print", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "setBounds", +function (x, y, width, height, op) { +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "handleEvent", +function (e) { +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "coalescePaintEvent", +function (e) { +}, "java.awt.event.PaintEvent"); +Clazz_overrideMethod (c$, "getLocationOnScreen", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getPreferredSize", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getMinimumSize", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getColorModel", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getToolkit", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getGraphics", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +return null; +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "dispose", +function () { +}); +Clazz_overrideMethod (c$, "setForeground", +function (c) { +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setBackground", +function (c) { +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setFont", +function (f) { +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "updateCursorImmediately", +function () { +}); +Clazz_overrideMethod (c$, "requestFocus", +function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { +return false; +}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); +Clazz_overrideMethod (c$, "isFocusable", +function () { +return false; +}); +Clazz_defineMethod (c$, "createImage", +function (producer) { +return null; +}, "java.awt.image.ImageProducer"); +Clazz_defineMethod (c$, "createImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "createVolatileImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "prepareImage", +function (img, w, h, o) { +return false; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "checkImage", +function (img, w, h, o) { +return 0; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "getGraphicsConfiguration", +function () { +return null; +}); +Clazz_overrideMethod (c$, "handlesWheelScrolling", +function () { +return false; +}); +Clazz_overrideMethod (c$, "getBackBuffer", +function () { +return null; +}); +Clazz_overrideMethod (c$, "destroyBuffers", +function () { +}); +Clazz_overrideMethod (c$, "reparent", +function (newContainer) { +}, "java.awt.peer.ContainerPeer"); +Clazz_overrideMethod (c$, "isReparentSupported", +function () { +return false; +}); +Clazz_overrideMethod (c$, "layout", +function () { +}); +Clazz_overrideMethod (c$, "getBounds", +function () { +return null; +}); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.awt.peer.FramePeer"], "swingjs.JSWindowPeer", ["java.lang.Thread", "java.awt.GraphicsEnvironment", "$.Insets", "$.Point", "$.Toolkit"], function () { +c$ = Clazz_decorateAsClass (function () { +this.window = null; +this.isFrame = false; +this.applet = null; +this.graphics = null; +this.font = null; +Clazz_instantialize (this, arguments); +}, swingjs, "JSWindowPeer", null, java.awt.peer.FramePeer); +Clazz_overrideMethod (c$, "setFrame", +function (target, isFrame) { +this.isFrame = isFrame; +this.window = target; +var jc = this; +jc.myThread = Thread.currentThread (); +jc.threadGroup = jc.myThread.getThreadGroup (); +this.applet = (jc.threadGroup).getHtmlApplet (); +this.graphics = (java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ()).createGraphicsSized (target, 500, 300); +return this; +}, "java.awt.Window,~B"); +Clazz_overrideMethod (c$, "getGraphics", +function () { +this.graphics.setFont (this.window.getFont ()); +return this.graphics; +}); +Clazz_overrideMethod (c$, "getToolkit", +function () { +return java.awt.Toolkit.getDefaultToolkit (); +}); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +if (!font.equals (this.font)) this.window.setFont (this.font = font); +return this.graphics.getFontMetrics (font); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "getInsets", +function () { +return new java.awt.Insets (0, 0, 0, 0); +}); +Clazz_overrideMethod (c$, "beginValidate", +function () { +}); +Clazz_overrideMethod (c$, "endValidate", +function () { +}); +Clazz_overrideMethod (c$, "beginLayout", +function () { +}); +Clazz_overrideMethod (c$, "endLayout", +function () { +}); +Clazz_overrideMethod (c$, "isObscured", +function () { +return false; +}); +Clazz_overrideMethod (c$, "canDetermineObscurity", +function () { +return false; +}); +Clazz_overrideMethod (c$, "setVisible", +function (b) { +}, "~B"); +Clazz_overrideMethod (c$, "setEnabled", +function (b) { +}, "~B"); +Clazz_overrideMethod (c$, "paint", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "repaint", +function (tm, x, y, width, height) { +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "print", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "setBounds", +function (x, y, width, height, op) { +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "handleEvent", +function (e) { +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "coalescePaintEvent", +function (e) { +}, "java.awt.event.PaintEvent"); +Clazz_overrideMethod (c$, "getLocationOnScreen", +function () { +return new java.awt.Point (); +}); +Clazz_overrideMethod (c$, "getPreferredSize", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getMinimumSize", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getColorModel", +function () { +return null; +}); +Clazz_overrideMethod (c$, "dispose", +function () { +}); +Clazz_overrideMethod (c$, "setForeground", +function (c) { +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setBackground", +function (c) { +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setFont", +function (f) { +this.font = f; +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "updateCursorImmediately", +function () { +}); +Clazz_overrideMethod (c$, "requestFocus", +function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { +return false; +}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); +Clazz_overrideMethod (c$, "isFocusable", +function () { +return false; +}); +Clazz_defineMethod (c$, "createImage", +function (producer) { +return null; +}, "java.awt.image.ImageProducer"); +Clazz_defineMethod (c$, "createImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "createVolatileImage", +function (width, height) { +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "prepareImage", +function (img, w, h, o) { +return false; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "checkImage", +function (img, w, h, o) { +return 0; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "getGraphicsConfiguration", +function () { +return null; +}); +Clazz_overrideMethod (c$, "handlesWheelScrolling", +function () { +return false; +}); +Clazz_overrideMethod (c$, "getBackBuffer", +function () { +return null; +}); +Clazz_overrideMethod (c$, "destroyBuffers", +function () { +}); +Clazz_overrideMethod (c$, "reparent", +function (newContainer) { +}, "java.awt.peer.ContainerPeer"); +Clazz_overrideMethod (c$, "isReparentSupported", +function () { +return false; +}); +Clazz_overrideMethod (c$, "layout", +function () { +}); +Clazz_overrideMethod (c$, "getBounds", +function () { +return null; +}); +Clazz_overrideMethod (c$, "toFront", +function () { +}); +Clazz_overrideMethod (c$, "toBack", +function () { +}); +Clazz_overrideMethod (c$, "updateAlwaysOnTopState", +function () { +}); +Clazz_overrideMethod (c$, "updateFocusableWindowState", +function () { +}); +Clazz_overrideMethod (c$, "requestWindowFocus", +function () { +return false; +}); +Clazz_overrideMethod (c$, "setModalBlocked", +function (blocker, blocked) { +}, "java.awt.Dialog,~B"); +Clazz_overrideMethod (c$, "updateMinimumSize", +function () { +}); +Clazz_overrideMethod (c$, "updateIconImages", +function () { +}); +Clazz_overrideMethod (c$, "setOpacity", +function (opacity) { +}, "~N"); +Clazz_overrideMethod (c$, "setOpaque", +function (isOpaque) { +}, "~B"); +Clazz_overrideMethod (c$, "updateWindow", +function (backBuffer) { +}, "java.awt.image.BufferedImage"); +Clazz_overrideMethod (c$, "repositionSecurityWarning", +function () { +}); +Clazz_overrideMethod (c$, "setTitle", +function (title) { +}, "~S"); +Clazz_overrideMethod (c$, "setMenuBar", +function (mb) { +}, "~O"); +Clazz_overrideMethod (c$, "setResizable", +function (resizeable) { +}, "~B"); +Clazz_overrideMethod (c$, "setState", +function (state) { +}, "~N"); +Clazz_overrideMethod (c$, "getState", +function () { +return 0; +}); +Clazz_overrideMethod (c$, "setMaximizedBounds", +function (bounds) { +}, "java.awt.Rectangle"); +Clazz_overrideMethod (c$, "setBoundsPrivate", +function (x, y, width, height) { +}, "~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "getBoundsPrivate", +function () { +return null; +}); +}); +Clazz_declarePackage ("swingjs"); +Clazz_load (["java.awt.GraphicsEnvironment"], "swingjs.JSGraphicsEnvironment", ["swingjs.JSGraphics2D", "$.JSToolkit", "swingjs.api.DOMNode"], function () { +c$ = Clazz_declareType (swingjs, "JSGraphicsEnvironment", java.awt.GraphicsEnvironment); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, swingjs.JSGraphicsEnvironment, []); +System.out.println ("JSGraphicsEnvironment initialized"); +}); +Clazz_overrideMethod (c$, "createGraphics", +function (img) { +return this.createGraphicsSized (img, img.getWidth (), img.getHeight ()); +}, "java.awt.image.BufferedImage"); +Clazz_defineMethod (c$, "createGraphicsSized", +function (img, width, height) { +var g = null; +{ +g = img._g; +}if (g == null) { +var canvas = swingjs.api.DOMNode.createElement ("canvas", "img" + System.currentTimeMillis ()); +{ +canvas.width = width; +canvas.height = height; +img._canvas = canvas; +}g = new swingjs.JSGraphics2D (canvas); +{ +img._g = g; +}}return g; +}, "~O,~N,~N"); +Clazz_overrideMethod (c$, "getAllFonts", +function () { +return null; +}); +Clazz_defineMethod (c$, "getAvailableFontFamilyNames", +function () { +return null; +}); +Clazz_defineMethod (c$, "getAvailableFontFamilyNames", +function (l) { +return null; +}, "java.util.Locale"); +Clazz_overrideMethod (c$, "getDefaultScreenDevice", +function () { +if (swingjs.JSGraphicsEnvironment.device == null) swingjs.JSGraphicsEnvironment.device = swingjs.JSToolkit.getInstance ("swingjs.JSScreenDevice"); +return swingjs.JSGraphicsEnvironment.device; +}); +Clazz_defineStatics (c$, +"device", null); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["javax.swing.LookAndFeel"], "swingjs.plaf.HTML5LookAndFeel", ["java.lang.Boolean", "$.Long", "java.awt.Color", "$.Dimension", "javax.swing.DefaultListCellRenderer", "$.UIDefaults", "javax.swing.UIDefaults.ActiveValue", "javax.swing.plaf.ColorUIResource", "$.DimensionUIResource", "$.FontUIResource", "$.InsetsUIResource"], function () { +c$ = Clazz_declareType (swingjs.plaf, "HTML5LookAndFeel", javax.swing.LookAndFeel); +Clazz_overrideMethod (c$, "getDefaults", +function () { +var table = new javax.swing.UIDefaults (610, 0.75); +this.initClassDefaults (table); +this.initSystemColorDefaults (table); +this.initComponentDefaults (table); +return table; +}); +Clazz_overrideMethod (c$, "initialize", +function () { +}); +Clazz_defineMethod (c$, "installAWTEventListener", +function () { +}); +Clazz_overrideMethod (c$, "uninitialize", +function () { +}); +Clazz_defineMethod (c$, "initClassDefaults", +function (table) { +var packageName = "swingjs.plaf."; +var uiDefaults = Clazz_newArray (-1, ["ButtonUI", "swingjs.plaf.JSButtonUI", "CheckBoxUI", "swingjs.plaf.JSCheckBoxUI", "ColorChooserUI", "swingjs.plaf.JSColorChooserUI", "FormattedTextFieldUI", "swingjs.plaf.JSFormattedTextFieldUI", "MenuBarUI", "swingjs.plaf.JSMenuBarUI", "MenuUI", "swingjs.plaf.JSMenuUI", "MenuItemUI", "swingjs.plaf.JSMenuItemUI", "CheckBoxMenuItemUI", "swingjs.plaf.JSCheckBoxMenuItemUI", "RadioButtonMenuItemUI", "swingjs.plaf.JSRadioButtonMenuItemUI", "RadioButtonUI", "swingjs.plaf.JSRadioButtonUI", "ToggleButtonUI", "swingjs.plaf.JSToggleButtonUI", "PopupMenuUI", "swingjs.plaf.JSPopupMenuUI", "ProgressBarUI", "swingjs.plaf.JSProgressBarUI", "ScrollBarUI", "swingjs.plaf.JSScrollBarUI", "ScrollPaneUI", "swingjs.plaf.JSScrollPaneUI", "SplitPaneUI", "swingjs.plaf.JSSplitPaneUI", "SliderUI", "swingjs.plaf.JSSliderUI", "SeparatorUI", "swingjs.plaf.JSSeparatorUI", "SpinnerUI", "swingjs.plaf.JSSpinnerUI", "ToolBarSeparatorUI", "swingjs.plaf.JSToolBarSeparatorUI", "PopupMenuSeparatorUI", "swingjs.plaf.JSPopupMenuSeparatorUI", "TabbedPaneUI", "swingjs.plaf.JSTabbedPaneUI", "TextAreaUI", "swingjs.plaf.JSTextAreaUI", "TextFieldUI", "swingjs.plaf.JSTextFieldUI", "PasswordFieldUI", "swingjs.plaf.JSPasswordFieldUI", "TextPaneUI", "swingjs.plaf.JSTextPaneUI", "EditorPaneUI", "swingjs.plaf.JSEditorPaneUI", "TreeUI", "swingjs.plaf.JSTreeUI", "LabelUI", "swingjs.plaf.JSLabelUI", "ListUI", "swingjs.plaf.JSListUI", "ToolBarUI", "swingjs.plaf.JSToolBarUI", "ToolTipUI", "swingjs.plaf.JSToolTipUI", "ComboBoxUI", "swingjs.plaf.JSComboBoxUI", "TableUI", "swingjs.plaf.JSTableUI", "TableHeaderUI", "swingjs.plaf.JSTableHeaderUI", "InternalFrameUI", "swingjs.plaf.JSInternalFrameUI", "DesktopPaneUI", "swingjs.plaf.JSDesktopPaneUI", "DesktopIconUI", "swingjs.plaf.JSDesktopIconUI", "OptionPaneUI", "swingjs.plaf.JSOptionPaneUI", "PanelUI", "swingjs.plaf.JSPanelUI", "ViewportUI", "swingjs.plaf.JSViewportUI", "RootPaneUI", "swingjs.plaf.JSRootPaneUI"]); +table.putDefaults (uiDefaults); +}, "javax.swing.UIDefaults"); +Clazz_defineMethod (c$, "initSystemColorDefaults", +function (table) { +var defaultSystemColors = Clazz_newArray (-1, ["window", "#FFFFFF", "windowText", "#333333", "menu", "#C0C0C0", "menuText", "#333333", "text", "#C0C0C0", "textText", "#333333", "control", "#EEEEEE", "controlText", "#333333", "scrollbar", "#E0E0E0", "info", "#FFFFE1", "infoText", "#000000"]); +this.loadSystemColors (table, defaultSystemColors, this.isNativeLookAndFeel ()); +}, "javax.swing.UIDefaults"); +Clazz_defineMethod (c$, "loadSystemColors", +function (table, systemColors, useNative) { +for (var i = 0; i < systemColors.length; i += 2) { +var color = java.awt.Color.black; +try { +color = java.awt.Color.decode (systemColors[i + 1]); +} catch (e) { +if (Clazz_exceptionOf (e, NumberFormatException)) { +e.printStackTrace (); +} else { +throw e; +} +} +table.put (systemColors[i], new javax.swing.plaf.ColorUIResource (color)); +} +}, "javax.swing.UIDefaults,~A,~B"); +Clazz_defineMethod (c$, "initResourceBundle", + function (table) { +}, "javax.swing.UIDefaults"); +Clazz_defineMethod (c$, "initComponentDefaults", +function (table) { +this.initResourceBundle (table); +var oneThousand = new Long (1000); +var twelve = new Integer (12); +var fontPlain = new Integer (0); +var serifPlain12 = new javax.swing.plaf.FontUIResource ("Serif", 0, 12); +var sansSerifPlain12 = new javax.swing.plaf.FontUIResource ("SansSerif", 0, 12); +var dialogPlain12 = new javax.swing.plaf.FontUIResource ("Dialog", 0, 12); +var monospacedPlain12 = new javax.swing.plaf.FontUIResource ("Monospaced", 0, 12); +var black = new javax.swing.plaf.ColorUIResource (java.awt.Color.black); +var white = new javax.swing.plaf.ColorUIResource (java.awt.Color.white); +var gray = new javax.swing.plaf.ColorUIResource (java.awt.Color.gray); +var darkGray = new javax.swing.plaf.ColorUIResource (java.awt.Color.darkGray); +var control = table.getColor ("control"); +var controlText = table.getColor ("controlText"); +var menu = table.getColor ("menu"); +var menuText = table.getColor ("menuText"); +var textText = table.getColor ("textText"); +var window = table.getColor ("window"); +var zeroInsets = new javax.swing.plaf.InsetsUIResource (0, 0, 0, 0); +var twoInsets = new javax.swing.plaf.InsetsUIResource (2, 2, 2, 2); +var threeInsets = new javax.swing.plaf.InsetsUIResource (3, 3, 3, 3); +var listCellRendererActiveValue = ((Clazz_isClassDefined ("swingjs.plaf.HTML5LookAndFeel$1") ? 0 : swingjs.plaf.HTML5LookAndFeel.$HTML5LookAndFeel$1$ ()), Clazz_innerTypeInstance (swingjs.plaf.HTML5LookAndFeel$1, this, null)); +var zero = new Integer (0); +var tabbedPaneTabInsets = new javax.swing.plaf.InsetsUIResource (0, 4, 1, 4); +var tabbedPaneTabPadInsets = new javax.swing.plaf.InsetsUIResource (2, 2, 2, 1); +var tabbedPaneTabAreaInsets = new javax.swing.plaf.InsetsUIResource (3, 2, 0, 2); +var tabbedPaneContentBorderInsets = new javax.swing.plaf.InsetsUIResource (2, 2, 3, 3); +var editorMargin = threeInsets; +var four = new Integer (4); +var defaults = Clazz_newArray (-1, ["*.font", dialogPlain12, "*.background", control, "*.foreground", controlText, "Button.margin", new javax.swing.plaf.InsetsUIResource (2, 14, 2, 14), "ToggleButton.margin", new javax.swing.plaf.InsetsUIResource (2, 14, 2, 14), "ToggleButton.textIconGap", four, "ToggleButton.textShiftOffset", zero, "RadioButton.margin", twoInsets, "RadioButton.textIconGap", four, "RadioButton.textShiftOffset", zero, "CheckBox.margin", twoInsets, "CheckBox.textIconGap", four, "CheckBox.textShiftOffset", zero, "ColorChooser.swatchesSwatchSize", new java.awt.Dimension (10, 10), "ColorChooser.swatchesRecentSwatchSize", new java.awt.Dimension (10, 10), "ColorChooser.swatchesDefaultRecentColor", control, "ComboBox.font", sansSerifPlain12, "ComboBox.background", window, "ComboBox.foreground", textText, "ComboBox.timeFactor", oneThousand, "ComboBox.isEnterSelectablePopup", Boolean.FALSE, "FileChooser.readOnly", Boolean.FALSE, "Label.border", null, "List.background", window, "List.foreground", textText, "List.cellRenderer", listCellRendererActiveValue, "List.timeFactor", oneThousand, "MenuBar.font", dialogPlain12, "MenuBar.background", menu, "MenuBar.foreground", menuText, "MenuItem.font", dialogPlain12, "MenuItem.background", menu, "MenuItem.foreground", menuText, "MenuItem.margin", twoInsets, "RadioButtonMenuItem.font", dialogPlain12, "RadioButtonMenuItem.background", menu, "RadioButtonMenuItem.foreground", menuText, "RadioButtonMenuItem.margin", twoInsets, "CheckBoxMenuItem.font", dialogPlain12, "CheckBoxMenuItem.background", menu, "CheckBoxMenuItem.foreground", menuText, "CheckBoxMenuItem.margin", twoInsets, "Menu.background", menu, "Menu.foreground", menuText, "Menu.margin", twoInsets, "PopupMenu.background", menu, "PopupMenu.foreground", menuText, "PopupMenu.consumeEventOnClose", Boolean.FALSE, "OptionPane.messageForeground", controlText, "Panel.font", dialogPlain12, "Panel.background", control, "Panel.foreground", textText, "ProgressBar.cellLength", new Integer (1), "ProgressBar.cellSpacing", zero, "ProgressBar.repaintInterval", new Integer (50), "ProgressBar.cycleTime", new Integer (3000), "ProgressBar.horizontalSize", new javax.swing.plaf.DimensionUIResource (146, 12), "ProgressBar.verticalSize", new javax.swing.plaf.DimensionUIResource (12, 146), "ScrollBar.foreground", control, "ScrollBar.width", new Integer (16), "Viewport.foreground", textText, "Slider.horizontalSize", new java.awt.Dimension (200, 21), "Slider.verticalSize", new java.awt.Dimension (21, 200), "Slider.minimumHorizontalSize", new java.awt.Dimension (36, 21), "Slider.minimumVerticalSize", new java.awt.Dimension (21, 36), "Spinner.font", monospacedPlain12, "Spinner.arrowButtonSize", new java.awt.Dimension (16, 5), "Spinner.editorAlignment", new Integer (11), "SplitPane.background", control, "SplitPane.dividerSize", new Integer (7), "SplitPaneDivider.draggingColor", darkGray, "TabbedPane.selected", null, "TabbedPane.textIconGap", four, "TabbedPane.tabsOverlapBorder", Boolean.FALSE, "TabbedPane.labelShift", new Integer (1), "TabbedPane.selectedLabelShift", new Integer (-1), "TabbedPane.tabInsets", tabbedPaneTabInsets, "TabbedPane.selectedTabPadInsets", tabbedPaneTabPadInsets, "TabbedPane.tabAreaInsets", tabbedPaneTabAreaInsets, "TabbedPane.contentBorderInsets", tabbedPaneContentBorderInsets, "TabbedPane.tabRunOverlay", new Integer (2), "Table.background", window, "Table.dropLineShortColor", black, "Table.gridColor", gray, "Table.focusCellBackground", window, "Table.focusCellForeground", controlText, "TextField.font", sansSerifPlain12, "TextField.background", window, "TextField.foreground", textText, "TextField.margin", zeroInsets, "FormattedTextField.font", sansSerifPlain12, "FormattedTextField.background", window, "FormattedTextField.foreground", textText, "FormattedTextField.caretForeground", textText, "FormattedTextField.margin", zeroInsets, "PasswordField.font", monospacedPlain12, "PasswordField.background", window, "PasswordField.foreground", textText, "PasswordField.margin", zeroInsets, "PasswordField.echoChar", new Character ('*'), "TextArea.font", monospacedPlain12, "TextArea.background", window, "TextArea.foreground", textText, "TextArea.margin", zeroInsets, "TextPane.font", serifPlain12, "TextPane.background", white, "TextPane.foreground", textText, "TextPane.margin", editorMargin, "EditorPane.font", serifPlain12, "EditorPane.background", white, "EditorPane.foreground", textText, "EditorPane.margin", editorMargin, "TitledBorder.titleColor", controlText, "Tree.paintLines", Boolean.TRUE, "Tree.lineTypeDashed", Boolean.FALSE, "Tree.background", window, "Tree.foreground", textText, "Tree.hash", gray, "Tree.textForeground", textText, "Tree.textBackground", table.get ("text"), "Tree.leftChildIndent", new Integer (7), "Tree.rightChildIndent", new Integer (13), "Tree.rowHeight", new Integer (16), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.timeFactor", oneThousand]); +table.putDefaults (defaults); +}, "javax.swing.UIDefaults"); +Clazz_overrideMethod (c$, "getName", +function () { +return "SwingJS"; +}); +Clazz_overrideMethod (c$, "getID", +function () { +return "SwingJS"; +}); +Clazz_overrideMethod (c$, "getDescription", +function () { +return "SwingJS L&F"; +}); +Clazz_overrideMethod (c$, "isNativeLookAndFeel", +function () { +return true; +}); +Clazz_overrideMethod (c$, "isSupportedLookAndFeel", +function () { +return true; +}); +c$.$HTML5LookAndFeel$1$ = function () { +Clazz_pu$h(self.c$); +c$ = Clazz_declareAnonymous (swingjs.plaf, "HTML5LookAndFeel$1", null, javax.swing.UIDefaults.ActiveValue); +Clazz_overrideMethod (c$, "createValue", +function (table) { +return new javax.swing.DefaultListCellRenderer.UIResource (); +}, "javax.swing.UIDefaults"); +c$ = Clazz_p0p (); +}; +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["javax.swing.plaf.ComponentUI", "swingjs.plaf.JSEventHandler"], "swingjs.plaf.JSComponentUI", ["java.lang.IllegalArgumentException", "$.NullPointerException", "java.awt.Color", "$.Component", "$.Dimension", "$.Point", "$.Toolkit", "java.awt.event.FocusEvent", "swingjs.JSToolkit", "swingjs.api.DOMNode"], function () { +c$ = Clazz_decorateAsClass (function () { +this.id = null; +this.c = null; +this.outerNode = null; +this.domNode = null; +this.enableNode = null; +this.textNode = null; +this.valueNode = null; +this.scrollNode = null; +this.focusNode = null; +this.components = null; +this.num = 0; +this.isTainted = true; +this.x = 0; +this.y = 0; +this.preferredSize = null; +this.isContainer = false; +this.parent = null; +this.currentText = null; +this.scrollerNode = null; +this.classID = null; +this.document = null; +this.body = null; +this.needPreferred = false; +Clazz_instantialize (this, arguments); +}, swingjs.plaf, "JSComponentUI", javax.swing.plaf.ComponentUI, swingjs.plaf.JSEventHandler); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, swingjs.plaf.JSComponentUI, []); +this.setDoc (); +}); +Clazz_defineMethod (c$, "setDoc", +function () { +{ +this.document = document; +this.body = document.body; +}}); +Clazz_overrideMethod (c$, "installUI", +function (c) { +}, "javax.swing.JComponent"); +Clazz_overrideMethod (c$, "uninstallUI", +function (c) { +this.uninstallJSUI (); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "$", +function (node) { +return swingjs.JSToolkit.getJQuery ().$ (node); +}, "swingjs.api.DOMNode"); +Clazz_defineMethod (c$, "setTainted", +function () { +this.isTainted = true; +}); +Clazz_defineMethod (c$, "set", +function (target) { +this.c = target; +this.newID (); +if (this.needPreferred) this.getPreferredSize (this.c); +this.installJSUI (); +return this; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "newID", +function () { +this.classID = this.c.getUIClassID (); +if (this.id == null) { +this.num = ++swingjs.plaf.JSComponentUI.incr; +this.id = this.c.getHTMLName (this.classID) + "_" + this.num; +}}); +Clazz_defineMethod (c$, "setCssFont", +function (obj, font) { +if (font != null) { +var istyle = font.getStyle (); +var name = font.getFamily (); +if (name === "Dialog") name = "Arial"; +swingjs.api.DOMNode.setStyles (obj, ["font-family", name, "font-size", font.getSize () + "px", "font-style", ((istyle & 2) == 0 ? "normal" : "italic"), "font-weight", ((istyle & 1) == 0 ? "normal" : "bold")]); +}if (this.c.isBackgroundSet ()) this.setBackground (this.c.getBackground ()); +this.setForeground (this.c.getForeground ()); +return obj; +}, "swingjs.api.DOMNode,java.awt.Font"); +Clazz_defineMethod (c$, "createDOMObject", +function (key, id, attr) { +var obj = swingjs.api.DOMNode.createElement (key, id); +for (var i = 0; i < attr.length; ) swingjs.api.DOMNode.setAttr (obj, attr[i++], attr[i++]); + +if (!this.c.isEnabled ()) this.setEnabled (false); +return obj; +}, "~S,~S,~A"); +Clazz_defineMethod (c$, "bindMouse", +function (node) { +swingjs.api.DOMNode.setAttr (node, "data-UI", this); +}, "swingjs.api.DOMNode"); +Clazz_overrideMethod (c$, "handleJSEvent", +function (target, eventType, jQueryEvent) { +return false; +}, "~O,~N,~O"); +Clazz_defineMethod (c$, "wrap", +function (type, id, elements) { +return this.append (this.createDOMObject (type, id + type, []), elements); +}, "~S,~S,~A"); +Clazz_defineMethod (c$, "append", +function (obj, elements) { +for (var i = 0; i < elements.length; i++) { +obj.appendChild (elements[i]); +} +return obj; +}, "swingjs.api.DOMNode,~A"); +Clazz_defineMethod (c$, "debugDump", +function (d) { +System.out.println (swingjs.api.DOMNode.getAttr (d, "outerHTML")); +}, "swingjs.api.DOMNode"); +c$.vCenter = Clazz_defineMethod (c$, "vCenter", +function (obj, offset) { +swingjs.api.DOMNode.setStyles (obj, ["top", "50%", "transform", "translateY(" + offset + "%)"]); +}, "swingjs.api.DOMNode,~N"); +Clazz_defineMethod (c$, "setHTMLSize", +function (obj, addCSS) { +return this.setHTMLSize1 (obj, addCSS, true); +}, "swingjs.api.DOMNode,~B"); +Clazz_defineMethod (c$, "setHTMLSize1", +function (node, addCSS, usePreferred) { +if (node == null) return null; +var h; +var w; +var w0 = null; +var h0 = null; +var parentNode = null; +if (this.scrollerNode != null) { +w = this.scrollerNode.c.getWidth (); +h = this.scrollerNode.c.getHeight (); +} else if (usePreferred && this.preferredSize != null) { +w = this.preferredSize.width; +h = this.preferredSize.height; +} else { +parentNode = swingjs.api.DOMNode.remove (node); +{ +w0 = node.style.width; +h0 = node.style.height; +}swingjs.api.DOMNode.setStyles (node, ["position", null, "width", null, "height", null]); +var div; +if (swingjs.api.DOMNode.getAttr (node, "tagName") === "DIV") div = node; + else div = this.wrap ("div", this.id + "_temp", [node]); +swingjs.api.DOMNode.setStyles (div, ["position", "absolute"]); +this.body.appendChild (div); +w = Clazz_doubleToInt (Math.ceil (this.$ (div).width () + 0.5)); +h = Clazz_doubleToInt (Math.ceil (this.$ (div).height () + 0.5)); +this.body.removeChild (div); +}var size = this.getCSSDimension (w, h); +if (addCSS) { +swingjs.api.DOMNode.setStyles (node, ["position", "absolute"]); +swingjs.api.DOMNode.setSize (node, size.width, size.height); +} else { +swingjs.api.DOMNode.setStyles (node, ["position", null]); +if (w0 != null) swingjs.api.DOMNode.setStyles (node, ["width", w0, "height", h0]); +}if (parentNode != null) parentNode.appendChild (node); +return size; +}, "swingjs.api.DOMNode,~B,~B"); +Clazz_defineMethod (c$, "getCSSDimension", +function (w, h) { +return new java.awt.Dimension (w, h); +}, "~N,~N"); +Clazz_defineMethod (c$, "setHTMLElement", +function () { +if (!this.isTainted) return this.outerNode; +var root = (this.isContainer ? this.c.getRootPane () : null); +if (this.c === root) { +this.isTainted = false; +return this.outerNode; +}this.domNode = this.getDOMObject (); +if (this.outerNode == null) { +this.outerNode = this.wrap ("div", this.id, [this.domNode]); +if (root != null && root.getContentPane () === this.c) swingjs.JSToolkit.getHTML5Applet (this.c)._getContentLayer ().appendChild (this.outerNode); +}swingjs.api.DOMNode.setStyles (this.outerNode, ["position", "absolute", "left", (this.x = this.c.getX ()) + "px", "top", (this.y = this.c.getY ()) + "px"]); +if (this.isContainer) { +System.out.println ("JSComponentUI container " + this.id + " " + this.c.getBounds ()); +swingjs.api.DOMNode.setSize (this.outerNode, this.c.getWidth (), this.c.getHeight ()); +var children = (this.components == null ? this.c.getComponents () : this.components); +for (var i = children.length; --i >= 0; ) { +var ui = swingjs.JSToolkit.getUI (children[i], false); +if (ui == null) { +continue; +}if (ui.outerNode == null) ui.setHTMLElement (); +if (ui.outerNode == null) { +System.out.println ("JSCUI could not add " + ui.c.getName () + " to " + this.c.getName ()); +} else { +this.outerNode.appendChild (ui.outerNode); +}ui.parent = this; +} +}this.isTainted = false; +return this.outerNode; +}); +Clazz_defineMethod (c$, "getPreferredSize", +function (c) { +var d = this.setHTMLSize (this.getDOMObject (), false); +return d; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "paint", +function (g, c) { +if (c.isOpaque ()) { +g.setColor (c.getBackground ()); +g.fillRect (0, 0, c.getWidth (), c.getHeight ()); +}}, "java.awt.Graphics,javax.swing.JComponent"); +Clazz_overrideMethod (c$, "update", +function (g, c) { +var testing = false; +if (testing) { +g.setColor (java.awt.Color.red); +g.drawRect (0, 0, c.getWidth (), c.getHeight ()); +System.out.println ("drawing " + c.getWidth () + " " + c.getHeight ()); +}this.setHTMLElement (); +this.paint (g, c); +}, "java.awt.Graphics,javax.swing.JComponent"); +Clazz_defineMethod (c$, "getMinimumSize", +function (c) { +return this.getPreferredSize (c); +}, "javax.swing.JComponent"); +Clazz_overrideMethod (c$, "getMaximumSize", +function (c) { +return null; +}, "javax.swing.JComponent"); +Clazz_overrideMethod (c$, "contains", +function (c, x, y) { +return c.inside (x, y); +}, "javax.swing.JComponent,~N,~N"); +c$.createUI = Clazz_overrideMethod (c$, "createUI", +function (c) { +return null; +}, "javax.swing.JComponent"); +Clazz_overrideMethod (c$, "getBaseline", +function (c, width, height) { +if (c == null) { +throw new NullPointerException ("Component must be non-null"); +}if (width < 0 || height < 0) { +throw new IllegalArgumentException ("Width and height must be >= 0"); +}return -1; +}, "javax.swing.JComponent,~N,~N"); +Clazz_overrideMethod (c$, "getBaselineResizeBehavior", +function (c) { +if (c == null) { +throw new NullPointerException ("Component must be non-null"); +}return java.awt.Component.BaselineResizeBehavior.OTHER; +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "getJSTextValue", +function () { +return swingjs.api.DOMNode.getAttr (this.domNode, this.valueNode == null ? "innerHTML" : "value"); +}); +Clazz_defineMethod (c$, "notifyPropertyChanged", +function (prop) { +var obj = null; +var val = null; +if (prop === "text") { +val = (this.c).getText (); +if (val.equals (this.currentText)) return; +this.currentText = val; +if (this.textNode != null) { +prop = "innerHTML"; +obj = this.textNode; +} else if (this.valueNode != null) { +prop = "value"; +obj = this.valueNode; +}} else if (prop === "preferredSize") { +this.preferredSize = this.c.getPreferredSize (); +this.getPreferredSize (); +return; +}if (obj == null) { +System.out.println ("JSComponentUI: unrecognized prop: " + prop); +} else { +System.out.println ("JSComponentUI: setting " + this.id + " " + prop); +this.setProp (obj, prop, val); +}}, "~S"); +Clazz_defineMethod (c$, "setProp", +function (obj, prop, val) { +return swingjs.api.DOMNode.setAttr (obj, prop, val); +}, "swingjs.api.DOMNode,~S,~S"); +Clazz_overrideMethod (c$, "isObscured", +function () { +swingjs.JSToolkit.notImplemented (""); +return false; +}); +Clazz_overrideMethod (c$, "canDetermineObscurity", +function () { +swingjs.JSToolkit.notImplemented (""); +return false; +}); +Clazz_overrideMethod (c$, "setVisible", +function (b) { +swingjs.api.DOMNode.setStyles (this.outerNode, ["display", b ? "block" : "none"]); +}, "~B"); +Clazz_overrideMethod (c$, "setEnabled", +function (b) { +if (this.enableNode != null) swingjs.api.DOMNode.setAttr (this.enableNode, "disabled", (b ? null : "TRUE")); +}, "~B"); +Clazz_defineMethod (c$, "paint", +function (g) { +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "repaint", +function (tm, x, y, width, height) { +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "print", +function (g) { +swingjs.JSToolkit.notImplemented (""); +}, "java.awt.Graphics"); +Clazz_overrideMethod (c$, "setBounds", +function (x, y, width, height, op) { +switch (op) { +case 2: +case 3: +case 4: +if (this.scrollerNode != null) { +width = Math.min (width, this.scrollerNode.c.getWidth ()); +height = Math.min (height, this.scrollerNode.c.getHeight ()); +}System.out.println (this.id + " setBounds " + x + " " + y + " " + width + " " + height + " op=" + op); +if (this.domNode != null) swingjs.api.DOMNode.setSize (this.domNode, width, height); +break; +} +}, "~N,~N,~N,~N,~N"); +Clazz_overrideMethod (c$, "handleEvent", +function (e) { +swingjs.JSToolkit.notImplemented (""); +}, "java.awt.AWTEvent"); +Clazz_overrideMethod (c$, "coalescePaintEvent", +function (e) { +swingjs.JSToolkit.notImplemented (""); +}, "java.awt.event.PaintEvent"); +Clazz_overrideMethod (c$, "getLocationOnScreen", +function () { +var offset = this.$ (this.outerNode).offset (); +return new java.awt.Point (offset.left, offset.top); +}); +Clazz_defineMethod (c$, "getPreferredSize", +function () { +return this.getPreferredSize (this.c); +}); +Clazz_defineMethod (c$, "getMinimumSize", +function () { +swingjs.JSToolkit.notImplemented (""); +return this.getPreferredSize (this.c); +}); +Clazz_overrideMethod (c$, "getColorModel", +function () { +return java.awt.Toolkit.getDefaultToolkit ().getColorModel (); +}); +Clazz_overrideMethod (c$, "getToolkit", +function () { +return java.awt.Toolkit.getDefaultToolkit (); +}); +Clazz_overrideMethod (c$, "getGraphics", +function () { +return null; +}); +Clazz_overrideMethod (c$, "getFontMetrics", +function (font) { +return this.c.getFontMetrics (font); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "dispose", +function () { +swingjs.JSToolkit.notImplemented (""); +}); +Clazz_overrideMethod (c$, "setForeground", +function (color) { +if (this.domNode != null) swingjs.api.DOMNode.setStyles (this.domNode, ["color", swingjs.JSToolkit.getCSSColor (color == null ? java.awt.Color.black : color)]); +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setBackground", +function (color) { +if (this.domNode != null) swingjs.api.DOMNode.setStyles (this.domNode, ["background-color", swingjs.JSToolkit.getCSSColor (color == null ? java.awt.Color.white : color)]); +}, "java.awt.Color"); +Clazz_overrideMethod (c$, "setFont", +function (f) { +if (this.domNode != null) this.setCssFont (this.domNode, f); +}, "java.awt.Font"); +Clazz_overrideMethod (c$, "updateCursorImmediately", +function () { +swingjs.JSToolkit.notImplemented (""); +}); +Clazz_overrideMethod (c$, "requestFocus", +function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) { +if (this.focusNode == null) return false; +this.$ (this.focusNode).focus (); +if (this.textNode != null) this.$ (this.textNode).select (); +return true; +}, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause"); +Clazz_overrideMethod (c$, "isFocusable", +function () { +return (this.focusNode != null); +}); +Clazz_defineMethod (c$, "createImage", +function (producer) { +swingjs.JSToolkit.notImplemented (""); +return null; +}, "java.awt.image.ImageProducer"); +Clazz_defineMethod (c$, "createImage", +function (width, height) { +swingjs.JSToolkit.notImplemented (""); +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "createVolatileImage", +function (width, height) { +swingjs.JSToolkit.notImplemented (""); +return null; +}, "~N,~N"); +Clazz_overrideMethod (c$, "prepareImage", +function (img, w, h, o) { +swingjs.JSToolkit.notImplemented (""); +return false; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "checkImage", +function (img, w, h, o) { +swingjs.JSToolkit.notImplemented (""); +return 0; +}, "java.awt.Image,~N,~N,java.awt.image.ImageObserver"); +Clazz_overrideMethod (c$, "getGraphicsConfiguration", +function () { +swingjs.JSToolkit.notImplemented (""); +return null; +}); +Clazz_overrideMethod (c$, "handlesWheelScrolling", +function () { +swingjs.JSToolkit.notImplemented (""); +return false; +}); +Clazz_overrideMethod (c$, "getBackBuffer", +function () { +swingjs.JSToolkit.notImplemented (""); +return null; +}); +Clazz_overrideMethod (c$, "destroyBuffers", +function () { +swingjs.JSToolkit.notImplemented (""); +}); +Clazz_overrideMethod (c$, "reparent", +function (newContainer) { +swingjs.JSToolkit.notImplemented (""); +}, "java.awt.peer.ContainerPeer"); +Clazz_overrideMethod (c$, "isReparentSupported", +function () { +swingjs.JSToolkit.notImplemented (""); +return false; +}); +Clazz_overrideMethod (c$, "layout", +function () { +swingjs.JSToolkit.notImplemented (""); +}); +Clazz_overrideMethod (c$, "getBounds", +function () { +swingjs.JSToolkit.notImplemented (""); +return null; +}); +Clazz_defineMethod (c$, "hasFocus", +function () { +return this.focusNode != null && this.focusNode === swingjs.api.DOMNode.getAttr (this.document, "activeElement"); +}); +Clazz_defineMethod (c$, "notifyFocus", +function (focusGained) { +java.awt.Toolkit.getEventQueue ().postEvent ( new java.awt.event.FocusEvent (this.c, focusGained ? 1004 : 1005)); +}, "~B"); +Clazz_defineStatics (c$, +"incr", 0); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSPanelUI", ["java.awt.Dimension", "javax.swing.LookAndFeel"], function () { +c$ = Clazz_declareType (swingjs.plaf, "JSPanelUI", swingjs.plaf.JSComponentUI); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, swingjs.plaf.JSPanelUI, []); +this.isContainer = true; +this.setDoc (); +}); +Clazz_overrideMethod (c$, "getDOMObject", +function () { +if (this.domNode == null) this.domNode = this.createDOMObject ("label", this.id, []); +return this.domNode; +}); +Clazz_overrideMethod (c$, "setHTMLSize", +function (obj, addCSS) { +return new java.awt.Dimension (this.c.getWidth (), this.c.getHeight ()); +}, "swingjs.api.DOMNode,~B"); +Clazz_defineMethod (c$, "getPreferredSize", +function (c) { +return null; +}, "javax.swing.JComponent"); +Clazz_overrideMethod (c$, "installJSUI", +function () { +javax.swing.LookAndFeel.installColorsAndFont (this.c, "Panel.background", "Panel.foreground", "Panel.font"); +}); +Clazz_overrideMethod (c$, "uninstallJSUI", +function () { +}); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSRadioButtonUI", ["java.util.HashMap", "javax.swing.DefaultButtonModel", "swingjs.api.DOMNode"], function () { +c$ = Clazz_decorateAsClass (function () { +this.label = null; +Clazz_instantialize (this, arguments); +}, swingjs.plaf, "JSRadioButtonUI", swingjs.plaf.JSButtonUI); +Clazz_overrideMethod (c$, "getDOMObject", +function () { +return this.getButtonObject ("radio"); +}); +Clazz_overrideMethod (c$, "getPropertyPrefix", +function () { +return "RadioButton."; +}); +Clazz_overrideMethod (c$, "setHTMLSize", +function (obj, addCSS) { +swingjs.api.DOMNode.setStyles (this.domBtn, ["position", null]); +swingjs.api.DOMNode.setStyles (this.label, ["position", null]); +var d = this.setHTMLSize1 (obj, addCSS, false); +swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); +swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute"]); +return d; +}, "swingjs.api.DOMNode,~B"); +Clazz_defineMethod (c$, "getButtonObject", +function (myType) { +var b = this.c; +var isNew = false; +var doAll = false; +if (this.domNode == null) { +doAll = true; +if (swingjs.plaf.JSRadioButtonUI.groupNames == null) swingjs.plaf.JSRadioButtonUI.groupNames = new java.util.HashMap (); +var bg = null; +var name = this.id; +isNew = true; +if (Clazz_instanceOf (b.getModel (), javax.swing.DefaultButtonModel)) { +bg = (b.getModel ()).getGroup (); +name = swingjs.plaf.JSRadioButtonUI.groupNames.get (bg); +if (name == null) swingjs.plaf.JSRadioButtonUI.groupNames.put (bg, name = this.id); + else isNew = false; +}this.domBtn = this.enableNode = this.createDOMObject ("input", this.id, ["type", myType, "name", name]); +this.label = this.textNode = this.createDOMObject ("label", this.id + "l", ["htmlFor", this.id]); +}if (b.isSelected () || isNew) swingjs.api.DOMNode.setAttr (this.domBtn, "checked", "true"); +this.setCssFont (swingjs.api.DOMNode.setAttr (this.label, "innerHTML", (this.c).getText ()), this.c.getFont ()); +var drad = this.setHTMLSize1 (this.domBtn, false, false); +this.setHTMLSize1 (this.label, false, false); +var obj = this.wrap ("div", "", [this.domBtn, this.label]); +var dobj = this.setHTMLSize1 (obj, true, true); +swingjs.plaf.JSComponentUI.vCenter (this.domBtn, -75); +swingjs.plaf.JSComponentUI.vCenter (this.label, -50); +swingjs.api.DOMNode.setStyles (this.label, ["position", "absolute", "left", drad.width + "px"]); +swingjs.api.DOMNode.setStyles (this.domBtn, ["position", "absolute"]); +if (doAll) { +obj = this.wrap ("div", this.id + "_0", [this.domBtn, this.label]); +swingjs.api.DOMNode.setStyles (obj, ["position", "absolute"]); +} else { +obj = this.domNode; +obj.appendChild (this.domBtn); +obj.appendChild (this.label); +}return swingjs.api.DOMNode.setSize (obj, dobj.width, dobj.height); +}, "~S"); +Clazz_defineStatics (c$, +"groupNames", null); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSRootPaneUI", null, function () { +c$ = Clazz_declareType (swingjs.plaf, "JSRootPaneUI", swingjs.plaf.JSComponentUI); +Clazz_makeConstructor (c$, +function () { +Clazz_superConstructor (this, swingjs.plaf.JSRootPaneUI, []); +this.isContainer = true; +this.setDoc (); +}); +Clazz_overrideMethod (c$, "getDOMObject", +function () { +return null; +}); +Clazz_overrideMethod (c$, "installJSUI", +function () { +}); +Clazz_overrideMethod (c$, "uninstallJSUI", +function () { +}); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["java.awt.event.FocusListener", "$.MouseListener", "$.MouseMotionListener", "java.beans.PropertyChangeListener", "javax.swing.event.ChangeListener", "jssun.swing.UIAction"], "swingjs.plaf.JSButtonListener", ["javax.swing.AbstractButton", "$.KeyStroke", "$.SwingUtilities", "javax.swing.plaf.ComponentInputMapUIResource", "swingjs.plaf.LazyActionMap"], function () { +c$ = Clazz_decorateAsClass (function () { +this.lastPressedTimestamp = -1; +this.shouldDiscardRelease = false; +this.btn = null; +Clazz_instantialize (this, arguments); +}, swingjs.plaf, "JSButtonListener", null, [java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.FocusListener, javax.swing.event.ChangeListener, java.beans.PropertyChangeListener]); +c$.loadActionMap = Clazz_defineMethod (c$, "loadActionMap", +function (map) { +map.put ( new swingjs.plaf.JSButtonListener.Actions ("pressed")); +map.put ( new swingjs.plaf.JSButtonListener.Actions ("released")); +}, "swingjs.plaf.LazyActionMap"); +Clazz_makeConstructor (c$, +function (b) { +this.btn = b; +}, "javax.swing.AbstractButton"); +Clazz_overrideMethod (c$, "propertyChange", +function (e) { +var prop = e.getPropertyName (); +if (prop === "mnemonic") { +this.updateMnemonicBinding (e.getSource ()); +} else if (prop === "contentAreaFilled") { +this.checkOpacity (e.getSource ()); +} else if (prop === "text" || "font" === prop || "foreground" === prop) { +var b = e.getSource (); +(b.getUI ()).notifyPropertyChanged (prop); +}}, "java.beans.PropertyChangeEvent"); +Clazz_defineMethod (c$, "checkOpacity", +function (b) { +b.setOpaque (b.isContentAreaFilled ()); +}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "installKeyboardActions", +function (c) { +var b = c; +this.updateMnemonicBinding (b); +swingjs.plaf.LazyActionMap.installLazyActionMap (c, swingjs.plaf.JSButtonListener, "Button.actionMap"); +var km = this.getInputMap (0, c); +javax.swing.SwingUtilities.replaceUIInputMap (c, 0, km); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "uninstallKeyboardActions", +function (c) { +javax.swing.SwingUtilities.replaceUIInputMap (c, 2, null); +javax.swing.SwingUtilities.replaceUIInputMap (c, 0, null); +javax.swing.SwingUtilities.replaceUIActionMap (c, null); +}, "javax.swing.JComponent"); +Clazz_defineMethod (c$, "getInputMap", +function (condition, c) { +return null; +}, "~N,javax.swing.JComponent"); +Clazz_defineMethod (c$, "updateMnemonicBinding", +function (b) { +var m = b.getMnemonic (); +if (m != 0) { +var map = javax.swing.SwingUtilities.getUIInputMap (b, 2); +if (map == null) { +map = new javax.swing.plaf.ComponentInputMapUIResource (b); +javax.swing.SwingUtilities.replaceUIInputMap (b, 2, map); +}map.clear (); +map.put (javax.swing.KeyStroke.getKeyStroke (m, 8, false), "pressed"); +map.put (javax.swing.KeyStroke.getKeyStroke (m, 8, true), "released"); +map.put (javax.swing.KeyStroke.getKeyStroke (m, 0, true), "released"); +} else { +var map = javax.swing.SwingUtilities.getUIInputMap (b, 2); +if (map != null) { +map.clear (); +}}}, "javax.swing.AbstractButton"); +Clazz_overrideMethod (c$, "stateChanged", +function (e) { +var b = e.getSource (); +b.repaint (); +}, "javax.swing.event.ChangeEvent"); +Clazz_overrideMethod (c$, "focusGained", +function (e) { +}, "java.awt.event.FocusEvent"); +Clazz_overrideMethod (c$, "focusLost", +function (e) { +var b = e.getSource (); +var model = b.getModel (); +model.setArmed (false); +model.setPressed (false); +}, "java.awt.event.FocusEvent"); +Clazz_overrideMethod (c$, "mouseMoved", +function (e) { +}, "java.awt.event.MouseEvent"); +Clazz_overrideMethod (c$, "mouseDragged", +function (e) { +}, "java.awt.event.MouseEvent"); +Clazz_overrideMethod (c$, "mouseClicked", +function (e) { +}, "java.awt.event.MouseEvent"); +Clazz_overrideMethod (c$, "mousePressed", +function (e) { +if (javax.swing.SwingUtilities.isLeftMouseButton (e)) { +var b = e.getSource (); +if (!b.contains (e.getX (), e.getY ())) return; +(b.getUI ()).verifyButtonClick (false); +var multiClickThreshhold = b.getMultiClickThreshhold (); +var lastTime = this.lastPressedTimestamp; +var currentTime = this.lastPressedTimestamp = e.getWhen (); +if (lastTime != -1 && currentTime - lastTime < multiClickThreshhold) { +this.shouldDiscardRelease = true; +return; +}var model = b.getModel (); +if (!model.isEnabled ()) { +return; +}if (!model.isArmed ()) { +model.setArmed (true); +}model.setPressed (true); +if (!b.hasFocus () && b.isRequestFocusEnabled ()) { +b.requestFocus (); +}}}, "java.awt.event.MouseEvent"); +Clazz_overrideMethod (c$, "mouseReleased", +function (e) { +if (javax.swing.SwingUtilities.isLeftMouseButton (e)) { +if (this.shouldDiscardRelease) { +this.shouldDiscardRelease = false; +return; +}var b = e.getSource (); +if (!(b.getUI ()).verifyButtonClick (true)) return; +var model = b.getModel (); +model.setPressed (false); +model.setArmed (false); +}}, "java.awt.event.MouseEvent"); +Clazz_overrideMethod (c$, "mouseEntered", +function (e) { +var b = e.getSource (); +var model = b.getModel (); +if (b.isRolloverEnabled () && !javax.swing.SwingUtilities.isLeftMouseButton (e)) { +model.setRollover (true); +}if (model.isPressed ()) model.setArmed (true); +}, "java.awt.event.MouseEvent"); +Clazz_overrideMethod (c$, "mouseExited", +function (e) { +var b = e.getSource (); +var model = b.getModel (); +if (b.isRolloverEnabled ()) { +model.setRollover (false); +}model.setArmed (false); +}, "java.awt.event.MouseEvent"); +Clazz_pu$h(self.c$); +c$ = Clazz_declareType (swingjs.plaf.JSButtonListener, "Actions", jssun.swing.UIAction); +Clazz_overrideMethod (c$, "actionPerformed", +function (a) { +var b = a.getSource (); +var c = this.getName (); +if (c === "pressed") { +var d = b.getModel (); +d.setArmed (true); +d.setPressed (true); +if (!b.hasFocus ()) { +b.requestFocus (); +}} else if (c === "released") { +var d = b.getModel (); +d.setPressed (false); +d.setArmed (false); +}}, "java.awt.event.ActionEvent"); +Clazz_defineMethod (c$, "isEnabled", +function (a) { +if (a != null && (Clazz_instanceOf (a, javax.swing.AbstractButton)) && !(a).getModel ().isEnabled ()) { +return false; +} else { +return true; +}}, "~O"); +Clazz_defineStatics (c$, +"PRESS", "pressed", +"RELEASE", "released"); +c$ = Clazz_p0p (); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["swingjs.plaf.JSComponentUI"], "swingjs.plaf.JSButtonUI", ["javax.swing.LookAndFeel", "$.UIManager", "javax.swing.plaf.UIResource", "swingjs.api.DOMNode", "swingjs.plaf.JSButtonListener"], function () { +c$ = Clazz_decorateAsClass (function () { +this.domBtn = null; +this.shiftOffset = 0; +this.defaultTextShiftOffset = 0; +Clazz_instantialize (this, arguments); +}, swingjs.plaf, "JSButtonUI", swingjs.plaf.JSComponentUI); +Clazz_overrideMethod (c$, "getDOMObject", +function () { +if (this.domNode == null) this.domBtn = this.enableNode = this.valueNode = this.domNode = this.createDOMObject ("input", this.id, ["type", "button"]); +this.setCssFont (swingjs.api.DOMNode.setAttr (this.domNode, "value", (this.c).getText ()), this.c.getFont ()); +return this.domNode; +}); +Clazz_defineMethod (c$, "verifyButtonClick", +function (isRelease) { +return true; +}, "~B"); +Clazz_overrideMethod (c$, "installJSUI", +function () { +this.installDefaults (this.c); +this.installListeners (this.c); +this.installKeyboardActions (this.c); +}); +Clazz_overrideMethod (c$, "uninstallJSUI", +function () { +this.uninstallKeyboardActions (this.c); +this.uninstallListeners (this.c); +}); +Clazz_defineMethod (c$, "installListeners", +function (b) { +var listener = new swingjs.plaf.JSButtonListener (b); +if (listener != null) { +b.addMouseListener (listener); +b.addMouseMotionListener (listener); +b.addFocusListener (listener); +b.addPropertyChangeListener (listener); +b.addChangeListener (listener); +}}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "uninstallListeners", +function (b) { +var listener = this.getButtonListener (b); +if (listener != null) { +b.removeMouseListener (listener); +b.removeMouseMotionListener (listener); +b.removeFocusListener (listener); +b.removeChangeListener (listener); +b.removePropertyChangeListener (listener); +}}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "installKeyboardActions", +function (b) { +var listener = this.getButtonListener (b); +if (listener != null) { +listener.installKeyboardActions (b); +}}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "uninstallKeyboardActions", +function (b) { +var listener = this.getButtonListener (b); +if (listener != null) { +listener.uninstallKeyboardActions (b); +}}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "getButtonListener", +function (b) { +var listeners = b.getMouseMotionListeners (); +if (listeners != null) { +for (var counter = 0; counter < listeners.length; counter++) { +if (Clazz_instanceOf (listeners[counter], swingjs.plaf.JSButtonListener)) { +return listeners[counter]; +}} +}return null; +}, "javax.swing.AbstractButton"); +Clazz_defineMethod (c$, "getPropertyPrefix", +function () { +return "Button."; +}); +Clazz_defineMethod (c$, "installDefaults", +function (b) { +var pp = this.getPropertyPrefix (); +this.defaultTextShiftOffset = javax.swing.UIManager.getInt (pp + "textShiftOffset"); +if (b.getMargin () == null || (Clazz_instanceOf (b.getMargin (), javax.swing.plaf.UIResource))) { +b.setMargin (javax.swing.UIManager.getInsets (pp + "margin")); +}javax.swing.LookAndFeel.installColorsAndFont (b, pp + "background", pp + "foreground", pp + "font"); +javax.swing.LookAndFeel.installProperty (b, "iconTextGap", new Integer (4)); +}, "javax.swing.AbstractButton"); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["swingjs.plaf.JSButtonUI"], "swingjs.plaf.JSToggleButtonUI", ["swingjs.api.DOMNode"], function () { +c$ = Clazz_decorateAsClass (function () { +this.isDomChecked = false; +Clazz_instantialize (this, arguments); +}, swingjs.plaf, "JSToggleButtonUI", swingjs.plaf.JSButtonUI); +Clazz_overrideMethod (c$, "verifyButtonClick", +function (isRelease) { +var checked = ((swingjs.api.DOMNode.getAttr (this.domBtn, "checked")).booleanValue () === true); +if (isRelease && this.isDomChecked == checked) return false; +this.isDomChecked = checked; +return true; +}, "~B"); +Clazz_overrideMethod (c$, "getPropertyPrefix", +function () { +return "ToggleButton."; +}); +}); +Clazz_declarePackage ("swingjs.plaf"); +Clazz_load (["javax.swing.plaf.ActionMapUIResource"], "swingjs.plaf.LazyActionMap", ["javax.swing.SwingUtilities", "$.UIManager"], function () { +c$ = Clazz_decorateAsClass (function () { +this._loader = null; +Clazz_instantialize (this, arguments); +}, swingjs.plaf, "LazyActionMap", javax.swing.plaf.ActionMapUIResource); +c$.installLazyActionMap = Clazz_defineMethod (c$, "installLazyActionMap", +function (c, loaderClass, defaultsKey) { +var map = javax.swing.UIManager.get (defaultsKey); +if (map == null) { +map = new swingjs.plaf.LazyActionMap (loaderClass); +}javax.swing.SwingUtilities.replaceUIActionMap (c, map); +}, "javax.swing.JComponent,Class,~S"); +c$.getActionMap = Clazz_defineMethod (c$, "getActionMap", +function (loaderClass, defaultsKey) { +var map = javax.swing.UIManager.get (defaultsKey); +if (map == null) { +map = new swingjs.plaf.LazyActionMap (loaderClass); +}return map; +}, "Class,~S"); +Clazz_makeConstructor (c$, + function (loader) { +Clazz_superConstructor (this, swingjs.plaf.LazyActionMap, []); +this._loader = loader; +}, "Class"); +Clazz_defineMethod (c$, "put", +function (action) { +this.put (action.getValue ("Name"), action); +}, "javax.swing.Action"); +Clazz_defineMethod (c$, "put", +function (key, action) { +this.loadIfNecessary (); +Clazz_superCall (this, swingjs.plaf.LazyActionMap, "put", [key, action]); +}, "~O,javax.swing.Action"); +Clazz_defineMethod (c$, "get", +function (key) { +this.loadIfNecessary (); +return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "get", [key]); +}, "~O"); +Clazz_defineMethod (c$, "remove", +function (key) { +this.loadIfNecessary (); +Clazz_superCall (this, swingjs.plaf.LazyActionMap, "remove", [key]); +}, "~O"); +Clazz_defineMethod (c$, "clear", +function () { +this.loadIfNecessary (); +Clazz_superCall (this, swingjs.plaf.LazyActionMap, "clear", []); +}); +Clazz_defineMethod (c$, "keys", +function () { +this.loadIfNecessary (); +return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "keys", []); +}); +Clazz_defineMethod (c$, "size", +function () { +this.loadIfNecessary (); +return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "size", []); +}); +Clazz_defineMethod (c$, "allKeys", +function () { +this.loadIfNecessary (); +return Clazz_superCall (this, swingjs.plaf.LazyActionMap, "allKeys", []); +}); +Clazz_defineMethod (c$, "setParent", +function (map) { +this.loadIfNecessary (); +Clazz_superCall (this, swingjs.plaf.LazyActionMap, "setParent", [map]); +}, "javax.swing.ActionMap"); +Clazz_defineMethod (c$, "loadIfNecessary", + function () { +if (this._loader != null) { +{ +this._loader.loadActionMap(this); +this._loader = null; +}}}); +});