/* */ package NET.worlds.scape; /* */ /* */ import java.io.IOException; /* */ import java.io.PrintStream; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class StdoutAction /* */ extends Action /* */ { /* 25 */ String txt = null; /* 26 */ boolean dumpArg = false; /* */ /* */ /* */ /* */ /* */ public StdoutAction() {} /* */ /* */ /* */ /* */ public StdoutAction(String text) /* */ { /* 37 */ this.txt = text; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public Persister trigger(Event arg, Persister seqID) /* */ { /* 47 */ if (this.txt != null) { /* 48 */ System.out.println(this.txt); /* */ } else /* 50 */ System.out.println("StdoutAction " + getName() + ", no text!"); /* 51 */ if (this.dumpArg) /* 52 */ if (arg == null) { /* 53 */ System.out.println(""); /* */ } else /* 55 */ System.out.println("<" + arg + ">"); /* 56 */ System.out.flush(); /* */ /* 58 */ return null; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ public Object properties(int index, int offset, int mode, Object value) /* */ throws NoSuchPropertyException /* */ { /* 69 */ Object ret = null; /* 70 */ switch (index - offset) { /* */ case 0: /* 72 */ if (mode == 0) { /* 73 */ ret = StringPropertyEditor.make(new Property(this, index, /* 74 */ "Text Out")); /* 75 */ } else if (mode == 1) { /* 76 */ ret = this.txt; /* 77 */ } else if (mode == 2) /* 78 */ this.txt = ((String)value); /* 79 */ break; /* */ case 1: /* 81 */ if (mode == 0) { /* 82 */ ret = BooleanPropertyEditor.make( /* 83 */ new Property(this, index, "Dump Event"), /* 84 */ "Don't print event", "Print event"); /* 85 */ } else if (mode == 1) { /* 86 */ ret = new Boolean(this.dumpArg); /* 87 */ } else if (mode == 2) /* 88 */ this.dumpArg = ((Boolean)value).booleanValue(); /* 89 */ break; /* */ default: /* 91 */ ret = super.properties(index, offset + 2, mode, value); /* */ } /* 93 */ return ret; /* */ } /* */ /* */ /* */ /* */ /* */ /* 100 */ private static Object classCookie = new Object(); /* */ /* */ public void saveState(Saver s) throws IOException /* */ { /* 104 */ s.saveVersion(1, classCookie); /* 105 */ super.saveState(s); /* 106 */ s.saveString(this.txt); /* 107 */ s.saveBoolean(this.dumpArg); /* */ } /* */ /* */ public void restoreState(Restorer r) /* */ throws IOException, TooNewException /* */ { /* 113 */ switch (r.restoreVersion(classCookie)) { /* */ case 0: /* 115 */ super.restoreState(r); /* 116 */ this.txt = r.restoreString(); /* 117 */ r.setOldFlag(); /* 118 */ break; /* */ case 1: /* 120 */ super.restoreState(r); /* 121 */ this.txt = r.restoreString(); /* 122 */ this.dumpArg = r.restoreBoolean(); /* 123 */ break; /* */ default: /* 125 */ throw new TooNewException(); /* */ } /* */ /* */ } /* */ /* */ /* */ /* */ /* */ public String toString() /* */ { /* 135 */ return super.toString() + "[" + this.txt + "]"; /* */ } /* */ } /* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\StdoutAction.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */