1 Clazz.declarePackage ("jalview.appletgui");
2 Clazz.load (["jalview.appletgui.JVDialog"], "jalview.appletgui.EditNameDialog", ["awt2swing.Label", "$.Panel", "$.TextField", "java.awt.BorderLayout", "$.Font"], function () {
3 c$ = Clazz.decorateAsClass (function () {
5 this.description = null;
6 Clazz.instantialize (this, arguments);
7 }, jalview.appletgui, "EditNameDialog", jalview.appletgui.JVDialog);
8 Clazz.overrideMethod (c$, "getName",
10 return this.id.getText ();
12 Clazz.defineMethod (c$, "getDescription",
14 if (this.description.getText ().length < 1) {
17 return this.description.getText ();
19 Clazz.makeConstructor (c$,
20 function (name, desc, label1, label2, owner, title, width, height, display) {
21 Clazz.superConstructor (this, jalview.appletgui.EditNameDialog, [owner, title, true, width, height]);
22 var mono = new java.awt.Font ("Monospaced", 0, 12);
23 var panel = new awt2swing.Panel ( new java.awt.BorderLayout ());
24 var panel2 = new awt2swing.Panel ( new java.awt.BorderLayout ());
25 this.id = new awt2swing.TextField (name, 40);
26 this.id.setFont (mono);
27 var label = new awt2swing.Label (label1);
29 panel2.add (label, "West");
30 panel2.add (this.id, "Center");
31 panel.add (panel2, "North");
33 panel2 = new awt2swing.Panel ( new java.awt.BorderLayout ());
34 this.description = new awt2swing.TextField (desc, 40);
35 this.description.setFont (mono);
36 label = new awt2swing.Label (label2);
38 panel2.add (label, "West");
39 panel2.add (this.description, "Center");
40 panel.add (panel2, "Center");
41 }this.setMainPanel (panel);
42 this.setVisible (display);
43 }, "~S,~S,~S,~S,awt2swing.Frame,~S,~N,~N,~B");