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