/* */ package NET.worlds.console; /* */ /* */ import java.awt.Button; /* */ import java.awt.Color; /* */ 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 LocationDialog /* */ extends PolledDialog /* */ { /* */ private static final long serialVersionUID = -6550771504344935484L; /* 29 */ private Button okButton = new Button(Console.message("OK")); /* 30 */ private Button cancelButton = new Button(Console.message("Cancel")); /* 31 */ private Label label = new Label(Console.message("New-URL")); /* 32 */ private static Font font = new Font(Console.message("ButtonFont"), /* 33 */ 0, 12); /* 34 */ private static Font gfont = new Font(Console.message("GammaTextFont"), /* 35 */ 0, 12); /* */ /* */ /* */ /* */ private TextField locationField; /* */ /* */ /* */ /* */ /* */ public LocationDialog(Window parent, DialogReceiver receiver, String title, String location) /* */ { /* 46 */ super(parent, receiver, title, true); /* */ /* 48 */ this.locationField = new TextField(location, 40); /* 49 */ this.locationField.setFont(gfont); /* */ /* 51 */ ready(); /* */ } /* */ /* */ public String getLocationURL() /* */ { /* 56 */ return this.locationField.getText(); /* */ } /* */ /* */ /* */ /* */ /* */ /* */ protected void build() /* */ { /* 65 */ setBackground(Color.white); /* */ /* 67 */ GridBagLayout gbag = new GridBagLayout(); /* 68 */ setLayout(gbag); /* 69 */ GridBagConstraints c = new GridBagConstraints(); /* 70 */ c.weightx = 0.0D; /* 71 */ c.weighty = 0.0D; /* 72 */ c.gridheight = 1; /* 73 */ c.fill = 0; /* 74 */ c.anchor = 13; /* 75 */ c.gridwidth = 1; /* 76 */ this.label.setFont(font); /* 77 */ add(gbag, this.label, c); /* */ /* 79 */ c.weightx = 1.0D; /* 80 */ c.weighty = 0.0D; /* 81 */ c.gridwidth = 0; /* 82 */ c.fill = 2; /* 83 */ c.anchor = 17; /* 84 */ this.locationField.setFont(gfont); /* 85 */ add(gbag, this.locationField, c); /* */ /* 87 */ Panel buttons = new Panel(); /* 88 */ this.okButton.setFont(font); /* 89 */ this.cancelButton.setFont(font); /* 90 */ buttons.add(this.okButton); /* 91 */ buttons.add(this.cancelButton); /* 92 */ c.gridwidth = 0; /* 93 */ c.anchor = 10; /* 94 */ c.fill = 0; /* 95 */ add(gbag, buttons, c); /* */ } /* */ /* */ /* */ /* */ public void setVisible(boolean visible) /* */ { /* 102 */ super.setVisible(visible); /* 103 */ if (visible) { /* 104 */ this.locationField.requestFocus(); /* */ } /* */ } /* */ /* */ @Deprecated /* */ public boolean handleEvent(Event event) /* */ { /* 111 */ if (event.id == 201) /* 112 */ return done(false); /* 113 */ return super.handleEvent(event); /* */ } /* */ /* */ @Deprecated /* */ public boolean action(Event event, Object what) /* */ { /* 119 */ Object target = event.target; /* 120 */ if (target == this.cancelButton) /* 121 */ return done(false); /* 122 */ if (target == this.okButton) /* 123 */ return done(true); /* 124 */ return false; /* */ } /* */ /* */ @Deprecated /* */ public boolean keyDown(Event event, int key) /* */ { /* 130 */ if (key == 27) /* 131 */ return done(false); /* 132 */ if (key == 10) /* 133 */ return done(true); /* 134 */ return super.keyDown(event, key); /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\LocationDialog.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */