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