JAL-1807 Bob's JalviewJS prototype first commit
[jalviewjs.git] / site / j2s / java / awt / DisplayMode.js
1 Clazz.declarePackage ("java.awt");\r
2 Clazz.load (null, "java.awt.DisplayMode", ["java.awt.Dimension"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.size = null;\r
5 this.bitDepth = 0;\r
6 this.refreshRate = 0;\r
7 Clazz.instantialize (this, arguments);\r
8 }, java.awt, "DisplayMode");\r
9 Clazz.makeConstructor (c$, \r
10 function (width, height, bitDepth, refreshRate) {\r
11 this.size =  new java.awt.Dimension (width, height);\r
12 this.bitDepth = bitDepth;\r
13 this.refreshRate = refreshRate;\r
14 }, "~N,~N,~N,~N");\r
15 Clazz.defineMethod (c$, "getHeight", \r
16 function () {\r
17 return this.size.height;\r
18 });\r
19 Clazz.defineMethod (c$, "getWidth", \r
20 function () {\r
21 return this.size.width;\r
22 });\r
23 Clazz.defineMethod (c$, "getBitDepth", \r
24 function () {\r
25 return this.bitDepth;\r
26 });\r
27 Clazz.defineMethod (c$, "getRefreshRate", \r
28 function () {\r
29 return this.refreshRate;\r
30 });\r
31 Clazz.defineMethod (c$, "equals", \r
32 function (dm) {\r
33 if (dm == null) {\r
34 return false;\r
35 }return (this.getHeight () == dm.getHeight () && this.getWidth () == dm.getWidth () && this.getBitDepth () == dm.getBitDepth () && this.getRefreshRate () == dm.getRefreshRate ());\r
36 }, "java.awt.DisplayMode");\r
37 Clazz.defineMethod (c$, "equals", \r
38 function (dm) {\r
39 if (Clazz.instanceOf (dm, java.awt.DisplayMode)) {\r
40 return this.equals (dm);\r
41 } else {\r
42 return false;\r
43 }}, "~O");\r
44 Clazz.overrideMethod (c$, "hashCode", \r
45 function () {\r
46 return this.getWidth () + this.getHeight () + this.getBitDepth () * 7 + this.getRefreshRate () * 13;\r
47 });\r
48 Clazz.defineStatics (c$,\r
49 "BIT_DEPTH_MULTI", -1,\r
50 "REFRESH_RATE_UNKNOWN", 0);\r
51 });\r