/* */ package NET.worlds.scape; /* */ /* */ import NET.worlds.console.Console; /* */ import NET.worlds.console.OkCancelDialog; /* */ import java.awt.Checkbox; /* */ import java.awt.CheckboxGroup; /* */ import java.awt.Dimension; /* */ import java.awt.GridBagConstraints; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract class CheckboxEditorDialog /* */ extends OkCancelDialog /* */ { /* */ private static final long serialVersionUID = 1L; /* 21 */ private CheckboxGroup group = new CheckboxGroup(); /* */ /* */ private Checkbox[] choices; /* */ private String[] labels; /* */ protected EditTile parent; /* */ /* */ protected CheckboxEditorDialog(EditTile parent, String title, String[] labels) /* */ { /* 29 */ super(Console.getFrame(), parent, title); /* 30 */ this.labels = labels; /* 31 */ this.parent = parent; /* */ } /* */ /* */ protected void build() /* */ { /* 36 */ this.choices = new Checkbox[this.labels.length]; /* */ /* 38 */ GridBagConstraints c = new GridBagConstraints(); /* 39 */ c.weightx = 1.0D; /* 40 */ c.weighty = 1.0D; /* 41 */ c.gridwidth = 0; /* 42 */ for (int i = 0; i < this.labels.length; i++) /* 43 */ add(this.gbag, this.choices[i] = new Checkbox(this.labels[i], this.group, false), c); /* 44 */ super.build(); /* */ } /* */ /* */ protected abstract int getValue(); /* */ /* */ protected abstract void setValue(int paramInt); /* */ /* */ protected boolean setValue() { /* 52 */ Checkbox selected = this.group.getSelectedCheckbox(); /* 53 */ for (int i = 0; i < this.choices.length; i++) /* 54 */ if (this.choices[i] == selected) { /* 55 */ setValue(i); /* 56 */ return true; /* */ } /* 58 */ return false; /* */ } /* */ /* */ /* */ /* */ public void setVisible(boolean visible) /* */ { /* 65 */ if (visible) { /* 66 */ Dimension mySize = getSize(); /* 67 */ initialSize(mySize.width < 160 ? 160 : mySize.width, /* 68 */ mySize.height < 120 ? 120 : mySize.height); /* 69 */ super.setVisible(visible); /* 70 */ int choice = getValue(); /* 71 */ this.choices[choice].requestFocus(); /* 72 */ this.choices[choice].setState(true); /* */ } else { /* 74 */ super.setVisible(visible); /* */ } /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\CheckboxEditorDialog.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */