Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / java / awt / Frame.js
index df265a0..276aa34 100644 (file)
-Clazz.declarePackage ("java.awt");\r
-Clazz.load (["java.awt.Window"], "java.awt.Frame", ["java.lang.IllegalArgumentException", "java.awt.Cursor", "$.IllegalComponentStateException"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.maximizedBounds = null;\r
-this.title = "Untitled";\r
-this.resizable = true;\r
-this.undecorated = false;\r
-this.mbManagement = false;\r
-this.$state = 0;\r
-this.ownedWindows = null;\r
-this.menuBar = null;\r
-Clazz.instantialize (this, arguments);\r
-}, java.awt, "Frame", java.awt.Window);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-this.construct ("");\r
-});\r
-Clazz.makeConstructor (c$, \r
-function (gc) {\r
-this.construct ("", gc);\r
-}, "java.awt.GraphicsConfiguration");\r
-Clazz.makeConstructor (c$, \r
-function (title) {\r
-Clazz.superConstructor (this, java.awt.Frame, []);\r
-this.initFrame (title, null);\r
-}, "~S");\r
-Clazz.makeConstructor (c$, \r
-function (title, gc) {\r
-Clazz.superConstructor (this, java.awt.Frame, [gc]);\r
-this.initFrame (title, gc);\r
-}, "~S,java.awt.GraphicsConfiguration");\r
-Clazz.defineMethod (c$, "initFrame", \r
- function (title, gc) {\r
-this.title = title;\r
-}, "~S,java.awt.GraphicsConfiguration");\r
-Clazz.overrideMethod (c$, "constructComponentName", \r
-function () {\r
-{\r
-return "frame" + java.awt.Frame.$nameCounter++;\r
-}});\r
-Clazz.defineMethod (c$, "addNotify", \r
-function () {\r
-if (this.peer == null) {\r
-this.peer = this.getToolkit ().createFrame (this);\r
-}var p = this.peer;\r
-p.setMaximizedBounds (this.maximizedBounds);\r
-Clazz.superCall (this, java.awt.Frame, "addNotify", []);\r
-});\r
-Clazz.defineMethod (c$, "getTitle", \r
-function () {\r
-return this.title;\r
-});\r
-Clazz.defineMethod (c$, "setTitle", \r
-function (title) {\r
-var oldTitle = this.title;\r
-if (title == null) {\r
-title = "";\r
-}{\r
-this.title = title;\r
-}this.firePropertyChangeObject ("title", oldTitle, title);\r
-}, "~S");\r
-Clazz.defineMethod (c$, "getIconImage", \r
-function () {\r
-var icons = this.icons;\r
-if (icons != null) {\r
-if (icons.size () > 0) {\r
-return icons.get (0);\r
-}}return null;\r
-});\r
-Clazz.defineMethod (c$, "isResizable", \r
-function () {\r
-return this.resizable;\r
-});\r
-Clazz.defineMethod (c$, "setResizable", \r
-function (resizable) {\r
-var oldResizable = this.resizable;\r
-{\r
-this.resizable = resizable;\r
-}this.firePropertyChangeBool ("resizable", oldResizable, resizable);\r
-}, "~B");\r
-Clazz.defineMethod (c$, "setState", \r
-function (state) {\r
-var current = this.getExtendedState ();\r
-if (state == 1 && (current & 1) == 0) {\r
-this.setExtendedState (current | 1);\r
-} else if (state == 0 && (current & 1) != 0) {\r
-this.setExtendedState (current & -2);\r
-}}, "~N");\r
-Clazz.defineMethod (c$, "setExtendedState", \r
-function (state) {\r
-if (!this.isFrameStateSupported (state)) {\r
-return;\r
-}this.$state = state;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "isFrameStateSupported", \r
- function (state) {\r
-if (!this.getToolkit ().isFrameStateSupported (state)) {\r
-if (((state & 1) != 0) && !this.getToolkit ().isFrameStateSupported (1)) {\r
-return false;\r
-} else {\r
-state &= -2;\r
-}return this.getToolkit ().isFrameStateSupported (state);\r
-}return true;\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getState", \r
-function () {\r
-return (this.getExtendedState () & 1) != 0 ? 1 : 0;\r
-});\r
-Clazz.defineMethod (c$, "getExtendedState", \r
-function () {\r
-return this.$state;\r
-});\r
-Clazz.defineMethod (c$, "setMaximizedBounds", \r
-function (bounds) {\r
-this.maximizedBounds = bounds;\r
-}, "java.awt.Rectangle");\r
-Clazz.defineMethod (c$, "getMaximizedBounds", \r
-function () {\r
-return this.maximizedBounds;\r
-});\r
-Clazz.defineMethod (c$, "setUndecorated", \r
-function (undecorated) {\r
-{\r
-if (this.isDisplayable ()) {\r
-throw  new java.awt.IllegalComponentStateException ("The frame is displayable.");\r
-}this.undecorated = undecorated;\r
-}}, "~B");\r
-Clazz.defineMethod (c$, "isUndecorated", \r
-function () {\r
-return this.undecorated;\r
-});\r
-Clazz.overrideMethod (c$, "removeNotify", \r
-function () {\r
-});\r
-Clazz.defineMethod (c$, "paramString", \r
-function () {\r
-var str = Clazz.superCall (this, java.awt.Frame, "paramString", []);\r
-if (this.title != null) {\r
-str += ",title=" + this.title;\r
-}if (this.resizable) {\r
-str += ",resizable";\r
-}this.getExtendedState ();\r
-if (this.$state == 0) {\r
-str += ",normal";\r
-} else {\r
-if ((this.$state & 1) != 0) {\r
-str += ",iconified";\r
-}if ((this.$state & 6) == 6) {\r
-str += ",maximized";\r
-} else if ((this.$state & 2) != 0) {\r
-str += ",maximized_horiz";\r
-} else if ((this.$state & 4) != 0) {\r
-str += ",maximized_vert";\r
-}}return str;\r
-});\r
-Clazz.defineMethod (c$, "setCursor", \r
-function (cursorType) {\r
-if (cursorType < 0 || cursorType > 13) {\r
-throw  new IllegalArgumentException ("illegal cursor type");\r
-}this.setCursor (java.awt.Cursor.getPredefinedCursor (cursorType));\r
-}, "~N");\r
-Clazz.defineMethod (c$, "getCursorType", \r
-function () {\r
-return (this.getCursor ().getType ());\r
-});\r
-c$.getFrames = Clazz.defineMethod (c$, "getFrames", \r
-function () {\r
-var allWindows = java.awt.Window.getWindows ();\r
-var frameCount = 0;\r
-for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) {\r
-if (Clazz.instanceOf (w, java.awt.Frame)) {\r
-frameCount++;\r
-}}\r
-var frames =  new Array (frameCount);\r
-var c = 0;\r
-for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) {\r
-if (Clazz.instanceOf (w, java.awt.Frame)) {\r
-frames[c++] = w;\r
-}}\r
-return frames;\r
-});\r
-Clazz.defineStatics (c$,\r
-"DEFAULT_CURSOR", 0,\r
-"CROSSHAIR_CURSOR", 1,\r
-"TEXT_CURSOR", 2,\r
-"WAIT_CURSOR", 3,\r
-"SW_RESIZE_CURSOR", 4,\r
-"SE_RESIZE_CURSOR", 5,\r
-"NW_RESIZE_CURSOR", 6,\r
-"NE_RESIZE_CURSOR", 7,\r
-"N_RESIZE_CURSOR", 8,\r
-"S_RESIZE_CURSOR", 9,\r
-"W_RESIZE_CURSOR", 10,\r
-"E_RESIZE_CURSOR", 11,\r
-"HAND_CURSOR", 12,\r
-"MOVE_CURSOR", 13,\r
-"NORMAL", 0,\r
-"ICONIFIED", 1,\r
-"MAXIMIZED_HORIZ", 2,\r
-"MAXIMIZED_VERT", 4,\r
-"MAXIMIZED_BOTH", 6,\r
-"$base", "frame",\r
-"$nameCounter", 0);\r
-});\r
+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);
+});