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/LocationDialog.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/console/LocationDialog.java')
| -rw-r--r-- | NET/worlds/console/LocationDialog.java | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/NET/worlds/console/LocationDialog.java b/NET/worlds/console/LocationDialog.java new file mode 100644 index 0000000..6057afb --- /dev/null +++ b/NET/worlds/console/LocationDialog.java @@ -0,0 +1,142 @@ +/* */ 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 + */
\ No newline at end of file |