Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 2 3 package Jt; 4 import java.util.*; 5 import java.lang.reflect.*; 6 import java.beans.*; 7 import java.io.*; 8 9 12 13 public class JtDecorator extends JtObject { 14 15 private Object component = null; 16 17 18 22 23 public void setComponent (Object component) { 24 this.component = component; 25 } 26 27 28 31 32 public Object getComponent () { 33 return (component); 34 } 35 36 public JtDecorator () { 37 } 38 39 40 41 42 48 49 public Object processMessage (Object event) { 50 51 String msgid = null; 52 JtMessage e = (JtMessage) event; 53 Object content; 54 Object data; 55 56 57 if (e == null) 58 return null; 59 60 msgid = (String ) e.getMsgId (); 61 62 if (msgid == null) 63 return null; 64 65 content = e.getMsgContent(); 66 68 69 if (msgid.equals ("JtREMOVE")) { 70 return (super.processMessage (null)); 71 } 72 73 74 handleError ("JtDecortator.processMessage: invalid message id:" + msgid); 75 return (null); 76 77 } 78 79 80 83 84 public static void main(String [] args) { 85 86 JtFactory factory = new JtFactory (); 87 88 JtDecorator decorator; 89 90 93 94 96 decorator = (JtDecorator) factory.createObject ("Jt.JtDecorator", "decorator"); 97 98 System.out.println (decorator); 99 100 factory.removeObject ("decorator"); 101 102 103 } 104 105 } 106 107 108
| Popular Tags
|