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/SwitchableBehavior.java | |
| download | worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.tar.xz worlds.jar-e1e781bb2135ef78592226f1a3eaba4925702f1f.zip | |
Diffstat (limited to 'NET/worlds/scape/SwitchableBehavior.java')
| -rw-r--r-- | NET/worlds/scape/SwitchableBehavior.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/NET/worlds/scape/SwitchableBehavior.java b/NET/worlds/scape/SwitchableBehavior.java new file mode 100644 index 0000000..774e17d --- /dev/null +++ b/NET/worlds/scape/SwitchableBehavior.java @@ -0,0 +1,90 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class SwitchableBehavior +/* */ extends SuperRoot +/* */ { +/* 22 */ protected boolean enabled = true; +/* 23 */ public boolean getEnabled() { return this.enabled; } +/* */ +/* */ public SwitchableBehavior setEnabled(boolean s) +/* */ { +/* 27 */ this.enabled = s; +/* 28 */ return this; +/* */ } +/* */ +/* */ public SwitchableBehavior toggleEnabled() +/* */ { +/* 33 */ setEnabled(!getEnabled()); +/* 34 */ return this; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 43 */ Object ret = null; +/* 44 */ switch (index - offset) { +/* */ case 0: +/* 46 */ if (mode == 0) { +/* 47 */ ret = BooleanPropertyEditor.make( +/* 48 */ new Property(this, index, "Enabled"), +/* 49 */ "No", "Yes"); +/* 50 */ } else if (mode == 1) { +/* 51 */ ret = new Boolean(this.enabled); +/* 52 */ } else if (mode == 2) +/* 53 */ this.enabled = ((Boolean)value).booleanValue(); +/* 54 */ break; +/* */ default: +/* 56 */ ret = super.properties(index, offset + 1, mode, value); +/* */ } +/* 58 */ return ret; +/* */ } +/* */ +/* 61 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) +/* */ throws IOException +/* */ { +/* 66 */ s.saveVersion(1, classCookie); +/* 67 */ super.saveState(s); +/* 68 */ s.saveBoolean(this.enabled); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) +/* */ throws IOException, TooNewException +/* */ { +/* 74 */ switch (r.restoreVersion(classCookie)) { +/* */ case 1: +/* 76 */ super.restoreState(r); +/* */ case 0: +/* 78 */ this.enabled = r.restoreBoolean(); +/* 79 */ break; +/* */ default: +/* 81 */ throw new TooNewException(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\SwitchableBehavior.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |