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