View Javadoc

1   package org.catacomb.druid.gui.edit;
2   
3   import org.catacomb.druid.gui.base.DruPanel;
4   import org.catacomb.interlish.structure.ActionRelay;
5   import org.catacomb.interlish.structure.ActionSource;
6   
7   
8   
9   
10  class DruGCPanel extends DruPanel implements ActionSource {
11      static final long serialVersionUID = 1001;
12  
13  
14      String methodName;
15      ActionRelay actionRelay;
16  
17      // boolean relaying;
18  
19  
20  
21      public DruGCPanel() {
22          super();
23          //   relaying = true;
24          methodName = null;
25      }
26  
27  
28  
29  
30  
31      public void setAction(String s) {
32          setActionMethod(s);
33      }
34  
35      public void setActionMethod(String s) {
36          methodName = s;
37      }
38  
39      public void setMethodName(String s) {
40          setActionMethod(s);
41      }
42  
43      public String getAction() {
44          return methodName;
45      }
46  
47      public boolean hasAction() {
48          return (methodName != null);
49      }
50  
51      public void disableRelaying() {
52          //   relaying = false;
53      }
54  
55  
56      public boolean hasRelay() {
57          return (actionRelay != null);
58      }
59  
60  
61      public void setActionRelay(ActionRelay ar) {
62          actionRelay = ar;
63      }
64  
65  
66  
67      public ActionRelay getActionRelay() {
68          return actionRelay;
69      }
70  
71  
72  
73  
74      public void valueChange(String s) {
75          action(s);
76      }
77  
78  
79      public void valueChange(boolean b) {
80  
81          action(b);
82      }
83  
84      public void unstoredValueChange(boolean b) {
85          action(b);
86      }
87  
88      public void valueChange(double d) {
89          action(d);
90      }
91  
92      public void valueChange(int i) {
93          action(i);
94      }
95  
96      public void valueChange(Object obj) {
97          action(obj);
98      }
99  
100 
101 
102     public void performAction(String mnm) {
103         if (actionRelay != null) {
104             actionRelay.action(mnm);
105         }
106     }
107     public void performAction(String mnm, boolean b) {
108         if (actionRelay != null) {
109             actionRelay.actionB(mnm, b);
110         }
111     }
112 
113 
114     public void action() {
115         if (methodName != null && actionRelay != null) {
116             actionRelay.action(methodName);
117         }
118     }
119 
120 
121     public void action(boolean b) {
122         if (methodName != null && actionRelay != null) {
123             actionRelay.actionB(methodName, b);
124         }
125     }
126 
127 
128     public void action(String sarg) {
129         if (actionRelay != null && methodName != null) {
130             actionRelay.actionS(methodName, sarg);
131         }
132     }
133 
134 
135     public void action(double d) {
136         if (methodName != null && actionRelay != null) {
137             actionRelay.actionD(methodName, d);
138         }
139     }
140 
141     public void action(int i) {
142         if (methodName != null && actionRelay != null) {
143             actionRelay.actionI(methodName, i);
144         }
145     }
146 
147 
148     public void action(Object obj) {
149         if (methodName != null && actionRelay != null) {
150             actionRelay.actionO(methodName, obj);
151         }
152     }
153 
154     public void action(String mnm, String arg) {
155         if (actionRelay != null) {
156             actionRelay.actionS(mnm, arg);
157         }
158     }
159 
160 }