001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * LGPL Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005-2006 Dirk von der Weiden <dvdw@imail.de>
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2 of the License, or (at your option) any later version.
013: *
014: * This library is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library located in LGPL.txt in the
021: * license directory; if not, write to the
022: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
023: * Boston, MA 02111-1307, USA.
024: *
025: * If this agreement does not cover your requirements, please contact us
026: * via email to get detailed information about the commercial license
027: * or our service offerings!
028: *
029: */
030: // @@
031: package de.ug2t.channel.ho.server.generic;
032:
033: import de.ug2t.kernel.*;
034: import de.ug2t.unifiedGui.*;
035: import de.ug2t.unifiedGui.interfaces.*;
036: import de.ug2t.xmlScript.*;
037:
038: public class HoSrvGenericBox extends AHoSrvGenericComponent implements
039: IUnBox {
040: public HoSrvGenericBox(String xName, IUnApplication xAppl,
041: String xClass) throws Exception {
042: super (xName);
043: this .pcmf_setAppl(xAppl);
044: this .pcmf_setLocalValue("");
045:
046: if (xClass == null)
047: pdm_clientClass = "de.ug2t.channel.ho.client.swing.HoSwingBox";
048: else
049: pdm_clientClass = xClass;
050:
051: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
052: "");
053:
054: if (this .pdm_session.pcmf_isInTransaction()) {
055: ScXmlScript.pcmf_createPBody(l_remCall);
056: } else {
057: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
058: ScXmlScript.pcmf_addProc(l_remCall, null);
059: }
060: ;
061: ScXmlScript.pcmf_addDecl(l_remCall, this .pcmf_getRemName(),
062: this .pdm_clientClass, "global");
063: ScXmlScript.pcmf_addDeclPar(l_remCall, xName, "false",
064: "java.lang.String");
065: ScXmlScript.pcmf_addDeclPar(l_remCall,
066: ((HoSrvGenericApplication) xAppl).pcmf_getRemName(),
067: "true", "de.ug2t.unifiedGui.interfaces.IUnApplication");
068:
069: ScXmlScript.pcmf_endAll(l_remCall);
070:
071: this .pdm_session.pcmf_call(l_remCall.toString(), this );
072: this .pcmf_enableSubmit();
073: return;
074: };
075:
076: public AHoSrvGenericComponent pcmf_buildRefObj() throws Exception {
077: HoSrvGenericBox l_obj = new HoSrvGenericBox(
078: this .pcmf_getName(), this .pcmf_getAppl(),
079: this .pdm_clientClass);
080: l_obj.pcmf_setGlobal(true);
081: this .pcmf_setGlobal(true);
082: l_obj.pcmf_setAutoEcho(this .pcmf_doAutoEcho());
083: l_obj.pcmf_setRefFrom(this );
084: this .pcmf_addRef(l_obj);
085:
086: return l_obj;
087: };
088:
089: public void pcmf_setBorder(int xDir, String xCol, int xWidth,
090: int xStyle) {
091: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
092: "");
093:
094: if (this .pdm_session.pcmf_isInTransaction()) {
095: ScXmlScript.pcmf_createPBody(l_remCall);
096: } else {
097: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
098: ScXmlScript.pcmf_addProc(l_remCall, null);
099: }
100: ;
101: ScXmlScript.pcmf_addCall(l_remCall, null, this
102: .pcmf_getRemName(), "pcmf_setBorder");
103: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xDir),
104: "false", "int");
105: ScXmlScript.pcmf_addCallPar(l_remCall, xCol, "false",
106: "java.lang.String");
107: ScXmlScript.pcmf_addCallPar(l_remCall,
108: Integer.toString(xWidth), "false", "int");
109: ScXmlScript.pcmf_addCallPar(l_remCall,
110: Integer.toString(xStyle), "false", "int");
111: ScXmlScript.pcmf_endAll(l_remCall);
112:
113: this .pdm_session.pcmf_call(l_remCall.toString(), this );
114: }
115:
116: public void pcmf_setBoxAlign(String xAlign) {
117: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
118: "");
119:
120: if (this .pdm_session.pcmf_isInTransaction()) {
121: ScXmlScript.pcmf_createPBody(l_remCall);
122: } else {
123: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
124: ScXmlScript.pcmf_addProc(l_remCall, null);
125: }
126: ;
127: ScXmlScript.pcmf_addCall(l_remCall, null, this
128: .pcmf_getRemName(), "pcmf_setBoxAlign");
129: ScXmlScript.pcmf_addCallPar(l_remCall, xAlign, "false",
130: "java.lang.String");
131: ScXmlScript.pcmf_endAll(l_remCall);
132:
133: this .pdm_session.pcmf_call(l_remCall.toString(), this );
134: }
135:
136: public void pcmf_setFill(boolean xFill, boolean yFill) {
137: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
138: "");
139:
140: if (this .pdm_session.pcmf_isInTransaction()) {
141: ScXmlScript.pcmf_createPBody(l_remCall);
142: } else {
143: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
144: ScXmlScript.pcmf_addProc(l_remCall, null);
145: }
146: ;
147: ScXmlScript.pcmf_addCall(l_remCall, null, this
148: .pcmf_getRemName(), "pcmf_setFill");
149: ScXmlScript.pcmf_addCallPar(l_remCall,
150: xFill ? "true" : "false", "false", "boolean");
151: ScXmlScript.pcmf_addCallPar(l_remCall,
152: yFill ? "true" : "false", "false", "bolean");
153: ScXmlScript.pcmf_endAll(l_remCall);
154:
155: this .pdm_session.pcmf_call(l_remCall.toString(), this );
156: }
157:
158: public void pcmf_setPadding(int xDir, int xWidth) {
159: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
160: "");
161:
162: if (this .pdm_session.pcmf_isInTransaction()) {
163: ScXmlScript.pcmf_createPBody(l_remCall);
164: } else {
165: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
166: ScXmlScript.pcmf_addProc(l_remCall, null);
167: }
168: ;
169: ScXmlScript.pcmf_addCall(l_remCall, null, this
170: .pcmf_getRemName(), "pcmf_setPadding");
171: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xDir),
172: "false", "int");
173: ScXmlScript.pcmf_addCallPar(l_remCall,
174: Integer.toString(xWidth), "false", "int");
175: ScXmlScript.pcmf_endAll(l_remCall);
176:
177: this .pdm_session.pcmf_call(l_remCall.toString(), this );
178: }
179:
180: public void pcmf_setMargin(int xDir, int xWidth) {
181: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
182: "");
183:
184: if (this .pdm_session.pcmf_isInTransaction()) {
185: ScXmlScript.pcmf_createPBody(l_remCall);
186: } else {
187: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
188: ScXmlScript.pcmf_addProc(l_remCall, null);
189: }
190: ;
191: ScXmlScript.pcmf_addCall(l_remCall, null, this
192: .pcmf_getRemName(), "pcmf_setMargin");
193: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xDir),
194: "false", "int");
195: ScXmlScript.pcmf_addCallPar(l_remCall,
196: Integer.toString(xWidth), "false", "int");
197: ScXmlScript.pcmf_endAll(l_remCall);
198:
199: this .pdm_session.pcmf_call(l_remCall.toString(), this );
200: }
201:
202: public void pcmf_setBgImage(IUnImage xImg) {
203: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
204: "");
205:
206: if (this .pdm_session.pcmf_isInTransaction()) {
207: ScXmlScript.pcmf_createPBody(l_remCall);
208: } else {
209: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
210: ScXmlScript.pcmf_addProc(l_remCall, null);
211: }
212: ;
213: ScXmlScript.pcmf_addCall(l_remCall, null, this
214: .pcmf_getRemName(), "pcmf_setBgImage");
215: ScXmlScript.pcmf_addCallPar(l_remCall, xImg
216: .pcmf_getUnComponent().pcmf_getRemName(), "true",
217: "de.ug2t.unifiedGui.interfaces.IUnImage");
218: ScXmlScript.pcmf_endAll(l_remCall);
219:
220: this .pdm_session.pcmf_call(l_remCall.toString(), this );
221: }
222:
223: public void pcmf_setGap(int xGap) {
224: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
225: "");
226:
227: if (this .pdm_session.pcmf_isInTransaction()) {
228: ScXmlScript.pcmf_createPBody(l_remCall);
229: } else {
230: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
231: ScXmlScript.pcmf_addProc(l_remCall, null);
232: }
233: ;
234: ScXmlScript.pcmf_addCall(l_remCall, null, this
235: .pcmf_getRemName(), "pcmf_setGap");
236: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xGap),
237: "false", "int");
238: ScXmlScript.pcmf_endAll(l_remCall);
239:
240: this .pdm_session.pcmf_call(l_remCall.toString(), this );
241: }
242:
243: public void pcmf_setBoxHVType(int xType) {
244: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
245: "");
246:
247: if (this .pdm_session.pcmf_isInTransaction()) {
248: ScXmlScript.pcmf_createPBody(l_remCall);
249: } else {
250: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
251: ScXmlScript.pcmf_addProc(l_remCall, null);
252: }
253: ;
254: ScXmlScript.pcmf_addCall(l_remCall, null, this
255: .pcmf_getRemName(), "pcmf_setBoxHVType");
256: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xType),
257: "false", "int");
258: ScXmlScript.pcmf_endAll(l_remCall);
259:
260: this .pdm_session.pcmf_call(l_remCall.toString(), this );
261: }
262:
263: public void pcmf_setBoxType(int xType) {
264: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
265: "");
266:
267: if (this .pdm_session.pcmf_isInTransaction()) {
268: ScXmlScript.pcmf_createPBody(l_remCall);
269: } else {
270: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
271: ScXmlScript.pcmf_addProc(l_remCall, null);
272: }
273: ;
274: ScXmlScript.pcmf_addCall(l_remCall, null, this
275: .pcmf_getRemName(), "pcmf_setBoxType");
276: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xType),
277: "false", "int");
278: ScXmlScript.pcmf_endAll(l_remCall);
279:
280: this .pdm_session.pcmf_call(l_remCall.toString(), this );
281: }
282:
283: public void pcmf_addWidget(String xName, UnComponent xObj) {
284: this .pcmf_addNode(xName, xObj);
285: };
286:
287: public UnComponent pcmf_removeWidget(String xName) {
288: return ((UnComponent) this .pcmf_removeNode(xName));
289: };
290:
291: public UnComponent pcmf_removeWidget(UnComponent xObj) {
292: return ((UnComponent) this .pcmf_removeNode(xObj));
293: };
294:
295: public UnComponent pcmf_getWidget(String xName) {
296: return ((UnComponent) this .pcmf_getSubNode(xName));
297: };
298:
299: public boolean pcmf_contains(UnComponent xObj) {
300: return (super .pcmf_contains(xObj));
301: };
302:
303: // New methods (delegates only) due to interface harmonisation
304: public void pcmf_addWidget(String xName, IUnComponent xObj) {
305: this .pcmf_addWidget(xName, (UnComponent) xObj);
306: }
307:
308: public boolean pcmf_contains(IUnComponent xObj) {
309: return (super .pcmf_contains((UnComponent) xObj));
310: }
311:
312: public IUnComponent pcmf_getWidgetbyName(String xName) {
313: return ((IUnComponent) this .pcmf_getWidget(xName));
314: }
315:
316: public IUnComponent pcmf_removeWidget(IUnComponent xObj) {
317: return ((IUnComponent) this
318: .pcmf_removeWidget((UnComponent) xObj));
319: }
320:
321: public void pcmf_setContraint(UnComponent xObj, int xConstraint) {
322: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
323: "");
324:
325: if (this .pdm_session.pcmf_isInTransaction()) {
326: ScXmlScript.pcmf_createPBody(l_remCall);
327: } else {
328: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
329: ScXmlScript.pcmf_addProc(l_remCall, null);
330: }
331: ;
332: ScXmlScript.pcmf_addCall(l_remCall, null, this
333: .pcmf_getRemName(), "pcmf_setContraint");
334: ScXmlScript.pcmf_addCallPar(l_remCall, xObj.pcmf_getRemName(),
335: "true", "de.ug2t.unifiedGui.UnComponent");
336: ScXmlScript.pcmf_addCallPar(l_remCall, Integer
337: .toString(xConstraint), "false", "int");
338: ScXmlScript.pcmf_endAll(l_remCall);
339:
340: this.pdm_session.pcmf_call(l_remCall.toString(), this);
341:
342: return;
343: };
344: }
|