1 Clazz.declarePackage ("jalview.appletgui");
\r
2 Clazz.load (["java.awt.Dialog", "java.awt.event.ActionListener", "awt2swing.Button"], "jalview.appletgui.JVDialog", ["awt2swing.Panel", "java.awt.FlowLayout"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
5 this.buttonPanel = null;
\r
10 Clazz.instantialize (this, arguments);
\r
11 }, jalview.appletgui, "JVDialog", java.awt.Dialog, java.awt.event.ActionListener);
\r
12 Clazz.prepareFields (c$, function () {
\r
13 this.ok = new awt2swing.Button ("Accept");
\r
14 this.cancel = new awt2swing.Button ("Cancel");
\r
16 Clazz.makeConstructor (c$,
\r
17 function (owner, title, modal, width, height) {
\r
18 Clazz.superConstructor (this, jalview.appletgui.JVDialog, [owner, title, modal]);
\r
20 height += owner.getInsets ().top + this.getInsets ().bottom;
\r
21 this.setBounds (owner.getBounds ().x + Clazz.doubleToInt ((owner.getSize ().width - width) / 2), owner.getBounds ().y + Clazz.doubleToInt ((owner.getSize ().height - height) / 2), width, height);
\r
22 }, "awt2swing.Frame,~S,~B,~N,~N");
\r
23 Clazz.defineMethod (c$, "setMainPanel",
\r
25 this.add (panel, "North");
\r
26 this.buttonPanel = new awt2swing.Panel ( new java.awt.FlowLayout ());
\r
27 this.buttonPanel.add (this.ok);
\r
28 this.buttonPanel.add (this.cancel);
\r
29 this.ok.addActionListener (this);
\r
30 this.cancel.addActionListener (this);
\r
31 this.add (this.buttonPanel, "South");
\r
33 }, "awt2swing.Panel");
\r
34 Clazz.overrideMethod (c$, "actionPerformed",
\r
36 if (evt.getSource () === this.ok) {
\r
38 }this.setVisible (false);
\r
39 }, "java.awt.event.ActionEvent");
\r