/* */ package NET.worlds.console; /* */ /* */ import java.awt.Button; /* */ import java.awt.Component; /* */ import java.awt.Font; /* */ import java.awt.GridBagConstraints; /* */ import java.awt.GridBagLayout; /* */ import java.awt.Label; /* */ import java.awt.TextArea; /* */ import java.awt.TextField; /* */ import java.util.StringTokenizer; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ class MailDialog /* */ extends OkCancelDialog /* */ { /* */ private static final long serialVersionUID = -5118823076163262543L; /* */ private TextField recipientField; /* */ private TextField subjectField; /* */ private TextArea bodyTextArea; /* 43 */ private static Font font = new Font(Console.message("ConsoleFont"), /* 44 */ 0, 12); /* */ /* */ /* */ /* */ public MailDialog(Console console) /* */ { /* 50 */ super(Console.getFrame(), new MailDialogReceiver(console), Console.message("Mail"), Console.message("Dont-Send"), Console.message("Send"), null, false); /* 51 */ setConfirmKey(0); /* 52 */ this.recipientField = new TextField(); /* 53 */ this.recipientField.setFont(font); /* */ /* */ /* */ /* 57 */ this.subjectField = new TextField(); /* 58 */ this.subjectField.setFont(font); /* 59 */ this.bodyTextArea = new TextArea("", 5, 50, /* 60 */ 1); /* 61 */ this.bodyTextArea.setEditable(true); /* 62 */ this.bodyTextArea.setFont(font); /* 63 */ setAlignment(1); /* */ } /* */ /* */ public MailDialog(Console console, String recipient) /* */ { /* 68 */ this(console); /* 69 */ this.recipientField.setText(Console.parseExtended(recipient)); /* 70 */ this.recipientField.setFont(font); /* */ } /* */ /* */ protected void build() /* */ { /* 75 */ GridBagConstraints c = new GridBagConstraints(); /* 76 */ int line = 0; /* */ /* */ /* 79 */ c.fill = 0; /* 80 */ c.anchor = 13; /* 81 */ add(this.gbag, new Label(Console.message("To")), c, 0, line, 1, 1, 0, 0); /* 82 */ c.fill = 2; /* 83 */ c.anchor = 17; /* */ /* 85 */ add(this.gbag, this.recipientField, c, 1, line, 3, 1, 100, 0); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* 97 */ line++; /* 98 */ c.fill = 0; /* 99 */ c.anchor = 13; /* 100 */ Label subjectLabel = new Label(Console.message("Subject")); /* 101 */ subjectLabel.setFont(font); /* 102 */ add(this.gbag, subjectLabel, c, 0, line, 1, 1, 0, 0); /* 103 */ c.fill = 2; /* 104 */ c.anchor = 17; /* 105 */ add(this.gbag, this.subjectField, c, 1, line, 3, 1, 100, 0); /* */ /* */ /* 108 */ line++; /* 109 */ c.anchor = 10; /* 110 */ c.fill = 1; /* */ /* 112 */ add(this.gbag, this.bodyTextArea, c, 0, line, 4, 1, 100, 100); /* */ /* */ /* 115 */ line++; /* 116 */ c.fill = 0; /* 117 */ if (this.okButton != null) { /* 118 */ this.okButton.setFont(font); /* 119 */ add(this.gbag, this.okButton, c, 1, line, 1, 1, 100, 0); /* */ } /* 121 */ if (this.cancelButton != null) { /* 122 */ this.cancelButton.setFont(font); /* 123 */ add(this.gbag, this.cancelButton, c, 2, line, 1, 1, 100, 0); /* */ } /* */ } /* */ /* */ /* */ private void add(GridBagLayout gbag, Component comp, GridBagConstraints cont, int x, int y, int w, int h, int wx, int wy) /* */ { /* 130 */ cont.gridx = x; /* 131 */ cont.gridy = y; /* 132 */ cont.gridwidth = w; /* 133 */ cont.gridheight = h; /* 134 */ cont.weightx = wx; /* 135 */ cont.weighty = wy; /* 136 */ add(gbag, comp, cont); /* */ } /* */ /* */ public String[] getTo() /* */ { /* 141 */ Console console = Console.getActive(); /* 142 */ String toLine = this.recipientField.getText(); /* 143 */ StringTokenizer tokenizer = new StringTokenizer(toLine, ","); /* 144 */ String[] to = new String[tokenizer.countTokens()]; /* 145 */ for (int i = 0; tokenizer.hasMoreTokens(); i++) { /* 146 */ to[i] = tokenizer.nextToken().trim(); /* 147 */ if ((to[i].indexOf("@") == -1) && (console != null)) /* 148 */ to[i] = (to[i] + "@" + console.getMailDomain()); /* */ } /* 150 */ return to; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public String getSubject() /* */ { /* 166 */ return this.subjectField.getText(); /* */ } /* */ /* */ public String getBody() /* */ { /* 171 */ return this.bodyTextArea.getText(); /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\MailDialog.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */