1 Clazz.declarePackage ("javajs.swing");
\r
2 Clazz.load (["javajs.awt.Container"], "javajs.swing.JDialog", ["javajs.awt.Color", "javajs.swing.JContentPane", "javajs.util.SB"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.defaultWidth = 600;
\r
5 this.defaultHeight = 300;
\r
6 this.contentPane = null;
\r
11 Clazz.instantialize (this, arguments);
\r
12 }, javajs.swing, "JDialog", javajs.awt.Container);
\r
13 Clazz.defineMethod (c$, "setZIndex",
\r
15 this.zIndex = zIndex;
\r
17 Clazz.makeConstructor (c$,
\r
19 Clazz.superConstructor (this, javajs.swing.JDialog, ["JD"]);
\r
20 this.add (this.contentPane = new javajs.swing.JContentPane ());
\r
21 this.setBackground (javajs.awt.Color.get3 (210, 210, 240));
\r
22 this.contentPane.setBackground (javajs.awt.Color.get3 (230, 230, 230));
\r
24 Clazz.defineMethod (c$, "setLocation",
\r
28 Clazz.defineMethod (c$, "getContentPane",
\r
30 return this.contentPane;
\r
32 Clazz.defineMethod (c$, "setTitle",
\r
36 Clazz.defineMethod (c$, "pack",
\r
40 Clazz.defineMethod (c$, "validate",
\r
44 Clazz.defineMethod (c$, "setVisible",
\r
46 if (tf && this.html == null) this.setDialog ();
\r
47 Clazz.superCall (this, javajs.swing.JDialog, "setVisible", [tf]);
\r
49 Clazz.defineMethod (c$, "dispose",
\r
53 SwingController.dispose(this);
\r
55 Clazz.overrideMethod (c$, "repaint",
\r
59 Clazz.defineMethod (c$, "setDialog",
\r
60 ($fz = function () {
\r
61 this.html = this.toHTML ();
\r
63 SwingController.setDialog(this);
\r
64 }}, $fz.isPrivate = true, $fz));
\r
65 Clazz.overrideMethod (c$, "toHTML",
\r
67 this.renderWidth = this.getSubcomponentWidth ();
\r
68 if (this.renderWidth == 0) this.renderWidth = this.defaultWidth;
\r
69 this.renderHeight = this.contentPane.getSubcomponentHeight ();
\r
70 if (this.renderHeight == 0) this.renderHeight = this.defaultHeight;
\r
71 var h = this.renderHeight - 25;
\r
72 var sb = new javajs.util.SB ();
\r
73 sb.append ("\n<div id='" + this.id + "' class='JDialog' style='" + this.getCSSstyle (0, 0) + "z-index:" + this.zIndex + ";position:relative;top:0px;left:0px;reize:both;'>\n");
\r
74 sb.append ("\n<div id='" + this.id + "_title' class='JDialogTitle' style='width:100%;height:25px;padding:5px 5px 5px 5px;height:" + 25 + "px'>" + "<span style='text-align:center;'>" + this.title + "</span><span style='position:absolute;text-align:right;right:1px;'>" + "<input type=button id='" + this.id + "_closer' onclick='SwingController.windowClosing(this)' value='x' /></span></div>\n");
\r
75 sb.append ("\n<div id='" + this.id + "_body' class='JDialogBody' style='width:100%;height:" + h + "px;" + "position: relative;left:0px;top:0px'>\n");
\r
76 sb.append (this.contentPane.toHTML ());
\r
77 sb.append ("\n</div></div>\n");
\r
78 return sb.toString ();
\r
80 Clazz.defineStatics (c$,
\r
81 "headerHeight", 25);
\r