1 Clazz.declarePackage ("java.awt");
2 Clazz.load (["java.awt.Window"], "java.awt.Frame", ["java.lang.IllegalArgumentException", "java.awt.Cursor", "$.IllegalComponentStateException"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.maximizedBounds = null;
5 this.title = "Untitled";
7 this.undecorated = false;
8 this.mbManagement = false;
10 this.ownedWindows = null;
12 Clazz.instantialize (this, arguments);
13 }, java.awt, "Frame", java.awt.Window);
14 Clazz.makeConstructor (c$,
18 Clazz.makeConstructor (c$,
20 this.construct ("", gc);
21 }, "java.awt.GraphicsConfiguration");
22 Clazz.makeConstructor (c$,
24 Clazz.superConstructor (this, java.awt.Frame, []);
25 this.initFrame (title, null);
27 Clazz.makeConstructor (c$,
28 function (title, gc) {
29 Clazz.superConstructor (this, java.awt.Frame, [gc]);
30 this.initFrame (title, gc);
31 }, "~S,java.awt.GraphicsConfiguration");
32 Clazz.defineMethod (c$, "initFrame",
33 function (title, gc) {
35 }, "~S,java.awt.GraphicsConfiguration");
36 Clazz.overrideMethod (c$, "constructComponentName",
39 return "frame" + java.awt.Frame.$nameCounter++;
41 Clazz.defineMethod (c$, "addNotify",
43 if (this.peer == null) {
44 this.peer = this.getToolkit ().createFrame (this);
46 p.setMaximizedBounds (this.maximizedBounds);
47 Clazz.superCall (this, java.awt.Frame, "addNotify", []);
49 Clazz.defineMethod (c$, "getTitle",
53 Clazz.defineMethod (c$, "setTitle",
55 var oldTitle = this.title;
60 }this.firePropertyChangeObject ("title", oldTitle, title);
62 Clazz.defineMethod (c$, "getIconImage",
64 var icons = this.icons;
66 if (icons.size () > 0) {
70 Clazz.defineMethod (c$, "isResizable",
72 return this.resizable;
74 Clazz.defineMethod (c$, "setResizable",
75 function (resizable) {
76 var oldResizable = this.resizable;
78 this.resizable = resizable;
79 }this.firePropertyChangeBool ("resizable", oldResizable, resizable);
81 Clazz.defineMethod (c$, "setState",
83 var current = this.getExtendedState ();
84 if (state == 1 && (current & 1) == 0) {
85 this.setExtendedState (current | 1);
86 } else if (state == 0 && (current & 1) != 0) {
87 this.setExtendedState (current & -2);
89 Clazz.defineMethod (c$, "setExtendedState",
91 if (!this.isFrameStateSupported (state)) {
95 Clazz.defineMethod (c$, "isFrameStateSupported",
97 if (!this.getToolkit ().isFrameStateSupported (state)) {
98 if (((state & 1) != 0) && !this.getToolkit ().isFrameStateSupported (1)) {
102 }return this.getToolkit ().isFrameStateSupported (state);
105 Clazz.defineMethod (c$, "getState",
107 return (this.getExtendedState () & 1) != 0 ? 1 : 0;
109 Clazz.defineMethod (c$, "getExtendedState",
113 Clazz.defineMethod (c$, "setMaximizedBounds",
115 this.maximizedBounds = bounds;
116 }, "java.awt.Rectangle");
117 Clazz.defineMethod (c$, "getMaximizedBounds",
119 return this.maximizedBounds;
121 Clazz.defineMethod (c$, "setUndecorated",
122 function (undecorated) {
124 if (this.isDisplayable ()) {
125 throw new java.awt.IllegalComponentStateException ("The frame is displayable.");
126 }this.undecorated = undecorated;
128 Clazz.defineMethod (c$, "isUndecorated",
130 return this.undecorated;
132 Clazz.overrideMethod (c$, "removeNotify",
135 Clazz.defineMethod (c$, "paramString",
137 var str = Clazz.superCall (this, java.awt.Frame, "paramString", []);
138 if (this.title != null) {
139 str += ",title=" + this.title;
140 }if (this.resizable) {
142 }this.getExtendedState ();
143 if (this.$state == 0) {
146 if ((this.$state & 1) != 0) {
148 }if ((this.$state & 6) == 6) {
150 } else if ((this.$state & 2) != 0) {
151 str += ",maximized_horiz";
152 } else if ((this.$state & 4) != 0) {
153 str += ",maximized_vert";
156 Clazz.defineMethod (c$, "setCursor",
157 function (cursorType) {
158 if (cursorType < 0 || cursorType > 13) {
159 throw new IllegalArgumentException ("illegal cursor type");
160 }this.setCursor (java.awt.Cursor.getPredefinedCursor (cursorType));
162 Clazz.defineMethod (c$, "getCursorType",
164 return (this.getCursor ().getType ());
166 c$.getFrames = Clazz.defineMethod (c$, "getFrames",
168 var allWindows = java.awt.Window.getWindows ();
170 for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) {
171 if (Clazz.instanceOf (w, java.awt.Frame)) {
174 var frames = new Array (frameCount);
176 for (var w, $w = 0, $$w = allWindows; $w < $$w.length && ((w = $$w[$w]) || true); $w++) {
177 if (Clazz.instanceOf (w, java.awt.Frame)) {
182 Clazz.defineStatics (c$,
184 "CROSSHAIR_CURSOR", 1,
187 "SW_RESIZE_CURSOR", 4,
188 "SE_RESIZE_CURSOR", 5,
189 "NW_RESIZE_CURSOR", 6,
190 "NE_RESIZE_CURSOR", 7,
191 "N_RESIZE_CURSOR", 8,
192 "S_RESIZE_CURSOR", 9,
193 "W_RESIZE_CURSOR", 10,
194 "E_RESIZE_CURSOR", 11,
199 "MAXIMIZED_HORIZ", 2,