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/ListChooserDialog.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/scape/ListChooserDialog.java')
| -rw-r--r-- | NET/worlds/scape/ListChooserDialog.java | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/NET/worlds/scape/ListChooserDialog.java b/NET/worlds/scape/ListChooserDialog.java new file mode 100644 index 0000000..9fc74c5 --- /dev/null +++ b/NET/worlds/scape/ListChooserDialog.java @@ -0,0 +1,83 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.OkCancelDialog; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.List; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public abstract class ListChooserDialog +/* */ extends OkCancelDialog +/* */ { +/* */ private static final long serialVersionUID = 1L; +/* 18 */ private List _listField = new List(5, false); +/* */ protected EditTile _parent; +/* */ +/* */ protected ListChooserDialog(EditTile parent, String title) { +/* 22 */ super(Console.getFrame(), parent, title); +/* 23 */ this._parent = parent; +/* */ } +/* */ +/* */ protected void build() { +/* 27 */ GridBagConstraints c = new GridBagConstraints(); +/* 28 */ c.weightx = 1.0D; +/* 29 */ c.weighty = 1.0D; +/* 30 */ c.gridwidth = 0; +/* 31 */ c.fill = 1; +/* 32 */ add(this.gbag, this._listField, c); +/* 33 */ super.build(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ protected abstract String getEntry(int paramInt); +/* */ +/* */ +/* */ +/* */ +/* */ protected abstract int getSelected(); +/* */ +/* */ +/* */ +/* */ +/* */ protected abstract boolean setValue(String paramString, int paramInt); +/* */ +/* */ +/* */ +/* */ +/* */ protected boolean setValue() +/* */ { +/* 56 */ return setValue(this._listField.getSelectedItem(), this._listField.getSelectedIndex()); +/* */ } +/* */ +/* */ +/* */ +/* */ public void setVisible(boolean visible) +/* */ { +/* 63 */ super.setVisible(visible); +/* 64 */ if (visible) { +/* 65 */ int index = 0; +/* 66 */ String entry = getEntry(index); +/* 67 */ while (entry != null) { +/* 68 */ this._listField.add(entry, index); +/* 69 */ entry = getEntry(++index); +/* */ } +/* 71 */ index = getSelected(); +/* 72 */ if (index != -1) +/* 73 */ this._listField.select(index); +/* 74 */ this._listField.requestFocus(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\ListChooserDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |