/* */ 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; /* */ import java.awt.Window; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class ChannelDialog /* */ extends PolledDialog /* */ { /* */ private static final long serialVersionUID = -3677512952231237135L; /* 37 */ private Label channelLabel = new Label(Console.message("New-channel")); /* 38 */ private Button okButton = new Button(Console.message("OK")); /* 39 */ private Button cancelButton = new Button(Console.message("Cancel")); /* 40 */ private static Font font = new Font(Console.message("MenuFont"), /* 41 */ 0, 12); /* */ /* */ /* */ /* */ private TextField channelField; /* */ /* */ /* */ /* */ /* */ public ChannelDialog(Window parent, DialogReceiver receiver, String title, String defChannel) /* */ { /* 52 */ super(parent, receiver, title, true); /* */ /* 54 */ this.channelField = new TextField(defChannel); /* */ /* 56 */ ready(); /* */ } /* */ /* */ public String getChannel() /* */ { /* 61 */ return this.channelField.getText(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ protected void build() /* */ { /* 70 */ GridBagLayout gbag = new GridBagLayout(); /* 71 */ setLayout(gbag); /* 72 */ GridBagConstraints c = new GridBagConstraints(); /* 73 */ c.weightx = 1.0D; /* 74 */ c.weighty = 1.0D; /* 75 */ c.gridheight = 1; /* 76 */ c.fill = 0; /* */ /* 78 */ c.gridwidth = 2; /* 79 */ this.channelLabel.setFont(font); /* 80 */ add(gbag, this.channelLabel, c); /* 81 */ c.gridwidth = 0; /* 82 */ c.fill = 2; /* 83 */ this.channelField.setFont(font); /* 84 */ add(gbag, this.channelField, c); /* */ /* 86 */ Panel buttons = new Panel(); /* 87 */ buttons.add(this.okButton); /* 88 */ buttons.add(this.cancelButton); /* 89 */ this.okButton.setFont(font); /* 90 */ this.cancelButton.setFont(font); /* 91 */ c.gridwidth = 0; /* 92 */ c.fill = 0; /* 93 */ add(gbag, buttons, c); /* */ } /* */ /* */ /* */ /* */ public void setVisible(boolean visible) /* */ { /* 100 */ if (visible) { /* 101 */ initialSize(320, 140); /* 102 */ super.setVisible(visible); /* 103 */ this.channelField.requestFocus(); /* */ } else { /* 105 */ super.setVisible(visible); /* */ } /* */ } /* */ /* */ @Deprecated /* */ public boolean handleEvent(Event event) /* */ { /* 112 */ if (event.id == 201) /* 113 */ return done(false); /* 114 */ return super.handleEvent(event); /* */ } /* */ /* */ @Deprecated /* */ public boolean action(Event event, Object what) /* */ { /* 120 */ Object target = event.target; /* 121 */ if (target == this.cancelButton) { /* 122 */ done(false); /* 123 */ } else if (target == this.okButton) /* 124 */ done(true); /* 125 */ return false; /* */ } /* */ /* */ @Deprecated /* */ public boolean keyDown(Event event, int key) /* */ { /* 131 */ if (key == 27) /* 132 */ return done(false); /* 133 */ return super.keyDown(event, key); /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\ChannelDialog.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */