/* */ 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 */