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/SavedAvDeleteDialog.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/console/SavedAvDeleteDialog.java')
| -rw-r--r-- | NET/worlds/console/SavedAvDeleteDialog.java | 294 |
1 files changed, 294 insertions, 0 deletions
diff --git a/NET/worlds/console/SavedAvDeleteDialog.java b/NET/worlds/console/SavedAvDeleteDialog.java new file mode 100644 index 0000000..572aca7 --- /dev/null +++ b/NET/worlds/console/SavedAvDeleteDialog.java @@ -0,0 +1,294 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import java.awt.Button; +/* */ import java.awt.Event; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.awt.Label; +/* */ import java.awt.List; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class SavedAvDeleteDialog +/* */ extends PolledDialog +/* */ { +/* */ private static final long serialVersionUID = 1L; +/* 176 */ private List listbox = new List(10); +/* 177 */ private Button delButton = new Button(Console.message("Delete")); +/* 178 */ private Button cancelButton = new Button(Console.message("Done")); +/* */ private SavedAvPart avatars; +/* */ +/* */ SavedAvDeleteDialog(SavedAvPart avatars) { +/* 182 */ super(Console.getFrame(), null, Console.message("Delete-Avatar"), true); +/* 183 */ this.avatars = avatars; +/* 184 */ ready(); +/* */ } +/* */ +/* */ protected void build() { +/* 188 */ int count = SavedAvPart.getAvatarCount(); +/* 189 */ for (int i = 0; i < count; i++) +/* 190 */ this.listbox.add(SavedAvPart.getAvatarName(i)); +/* 191 */ Label caption = new Label(Console.message("Choose-Avatar")); +/* */ +/* 193 */ GridBagLayout gbag = new GridBagLayout(); +/* 194 */ setLayout(gbag); +/* 195 */ GridBagConstraints c = new GridBagConstraints(); +/* */ +/* 197 */ c.fill = 2; +/* 198 */ c.gridwidth = 0; +/* 199 */ c.gridheight = 1; +/* 200 */ c.weightx = 1.0D; +/* 201 */ c.weighty = 0.0D; +/* 202 */ add(gbag, caption, c); +/* */ +/* 204 */ c.fill = 1; +/* 205 */ c.gridwidth = 0; +/* 206 */ c.gridheight = 6; +/* 207 */ c.weightx = 1.0D; +/* 208 */ c.weighty = 1.0D; +/* 209 */ add(gbag, this.listbox, c); +/* */ +/* 211 */ c.fill = 0; +/* 212 */ c.gridwidth = -1; +/* 213 */ c.gridheight = 0; +/* 214 */ c.anchor = 14; +/* 215 */ c.weightx = 0.45D; +/* 216 */ c.weighty = 0.0D; +/* 217 */ add(gbag, this.delButton, c); +/* 218 */ c.gridwidth = 0; +/* 219 */ c.anchor = 16; +/* 220 */ c.weightx = 0.55D; +/* 221 */ add(gbag, this.cancelButton, c); +/* */ } +/* */ +/* */ private void select(boolean state) { +/* 225 */ this.delButton.setEnabled(state); +/* */ } +/* */ +/* */ +/* */ +/* */ public void setVisible(boolean visible) +/* */ { +/* 232 */ super.setVisible(visible); +/* 233 */ if (visible) { +/* 234 */ if (this.listbox.getItemCount() != 0) { +/* 235 */ this.listbox.select(0); +/* 236 */ select(true); +/* */ } else { +/* 238 */ select(false); } +/* 239 */ this.listbox.requestFocus(); +/* */ } +/* */ } +/* */ +/* */ @Deprecated +/* */ public boolean handleEvent(Event event) +/* */ { +/* 246 */ if (event.id == 701) { +/* 247 */ select(true); +/* 248 */ } else if (event.id == 702) +/* 249 */ select(false); +/* 250 */ return super.handleEvent(event); +/* */ } +/* */ +/* */ @Deprecated +/* */ public boolean action(Event event, Object what) +/* */ { +/* 256 */ Object target = event.target; +/* 257 */ if (target == this.cancelButton) +/* 258 */ return done(false); +/* 259 */ if (target == this.delButton) { +/* 260 */ int index = this.listbox.getSelectedIndex(); +/* 261 */ if (index != -1) { +/* 262 */ this.listbox.remove(index); +/* 263 */ this.avatars.removeAvatar(index); +/* */ +/* */ +/* 266 */ int count = this.listbox.getItemCount(); +/* 267 */ if (index < count - 1) { +/* 268 */ this.listbox.select(index); +/* 269 */ } else if (count > 0) { +/* 270 */ this.listbox.select(count - 1); +/* */ } else { +/* 272 */ select(false); +/* 273 */ this.listbox.requestFocus(); +/* */ } +/* */ } +/* 276 */ return true; +/* */ } +/* 278 */ return false; +/* */ } +/* */ +/* */ @Deprecated +/* */ public boolean keyDown(Event event, int key) +/* */ { +/* 284 */ if ((key == 27) || (key == 10)) +/* 285 */ return done(false); +/* 286 */ return super.keyDown(event, key); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\SavedAvDeleteDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |