diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/console/AddNameDialog.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/console/AddNameDialog.java')
| -rw-r--r-- | NET/worlds/console/AddNameDialog.java | 312 |
1 files changed, 312 insertions, 0 deletions
diff --git a/NET/worlds/console/AddNameDialog.java b/NET/worlds/console/AddNameDialog.java new file mode 100644 index 0000000..9318e56 --- /dev/null +++ b/NET/worlds/console/AddNameDialog.java @@ -0,0 +1,312 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import java.awt.Button; +/* */ import java.awt.Event; +/* */ import java.awt.Font; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.awt.Label; +/* */ import java.awt.Panel; +/* */ import java.awt.TextField; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class AddNameDialog +/* */ extends PolledDialog +/* */ { +/* */ private static final long serialVersionUID = -6679739808485406091L; +/* */ private TextField nameField; +/* 216 */ private Button okButton = new Button(Console.message("OK")); +/* 217 */ private Button cancelButton = new Button(Console.message("Cancel")); +/* */ private String newName; +/* 219 */ private static Font font = new Font(Console.message("ButtonFont"), +/* 220 */ 0, 12); +/* */ +/* */ AddNameDialog(EditNamesDialog parent, String title) +/* */ { +/* 224 */ super(parent, parent, title, true); +/* 225 */ ready(); +/* */ } +/* */ +/* */ +/* */ protected void build() +/* */ { +/* 231 */ this.nameField = new TextField("", 40); +/* 232 */ this.nameField.setFont(font); +/* 233 */ GridBagLayout gbag = new GridBagLayout(); +/* 234 */ setLayout(gbag); +/* 235 */ GridBagConstraints c = new GridBagConstraints(); +/* 236 */ c.fill = 0; +/* 237 */ c.weightx = 1.0D; +/* 238 */ c.weighty = 1.0D; +/* 239 */ c.gridwidth = 2; +/* 240 */ c.gridheight = 1; +/* 241 */ add(gbag, new Label(Console.message("Name")), c); +/* 242 */ c.gridwidth = 0; +/* 243 */ c.fill = 2; +/* 244 */ add(gbag, this.nameField, c); +/* 245 */ Panel buttons = new Panel(); +/* 246 */ this.okButton.setFont(font); +/* 247 */ this.cancelButton.setFont(font); +/* 248 */ buttons.add(this.okButton); +/* 249 */ buttons.add(this.cancelButton); +/* 250 */ c.gridwidth = 0; +/* 251 */ c.fill = 0; +/* 252 */ add(gbag, buttons, c); +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean action(Event event, Object what) +/* */ { +/* 259 */ Object target = event.target; +/* 260 */ if ((target == this.okButton) && (mayConfirm())) +/* 261 */ return done(true); +/* 262 */ if (target == this.cancelButton) +/* 263 */ return done(false); +/* 264 */ return false; +/* */ } +/* */ +/* */ +/* */ public String getName() +/* */ { +/* 270 */ return this.newName; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private boolean mayConfirm() +/* */ { +/* 278 */ return FriendsListPart.isValidUserName(this.newName = this.nameField.getText() +/* 279 */ .trim()); +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean keyDown(Event event, int key) +/* */ { +/* 286 */ if (key == 27) +/* 287 */ return done(false); +/* 288 */ if ((key == 10) && +/* 289 */ (mayConfirm())) { +/* 290 */ return done(true); +/* */ } +/* 292 */ return super.keyDown(event, key); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void setVisible(boolean visible) +/* */ { +/* 300 */ super.setVisible(visible); +/* 301 */ if (visible) { +/* 302 */ this.nameField.requestFocus(); +/* 303 */ this.nameField.selectAll(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\AddNameDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |