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.interfaces.*;
035: import de.ug2t.xmlScript.*;
036:
037: public final class HoSrvGenericProgressBar extends
038: AHoSrvGenericComponent implements IUnProgressBar {
039: private int pem_min = 0;
040: private int pem_max = 0;
041: private int pem_progress = 0;
042:
043: public HoSrvGenericProgressBar(String xName, String xValue,
044: int xMin, int xMax, IUnApplication xAppl, String xClass)
045: throws Exception {
046: super (xName);
047: this .pcmf_setAppl(xAppl);
048: this .pcmf_setLocalValue(xValue);
049:
050: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
051: "");
052:
053: if (xClass == null)
054: pdm_clientClass = "de.ug2t.channel.ho.client.swing.HoSwingProgressBar";
055: else
056: pdm_clientClass = xClass;
057:
058: if (this .pdm_session.pcmf_isInTransaction()) {
059: ScXmlScript.pcmf_createPBody(l_remCall);
060: } else {
061: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
062: ScXmlScript.pcmf_addProc(l_remCall, null);
063: }
064: ;
065: ScXmlScript.pcmf_addDecl(l_remCall, this .pcmf_getRemName(),
066: this .pdm_clientClass, "global");
067: ScXmlScript.pcmf_addDeclPar(l_remCall, xName, "false",
068: "java.lang.String");
069: ScXmlScript.pcmf_addDeclPar(l_remCall, xValue, "false",
070: "java.lang.String");
071: ScXmlScript.pcmf_addDeclPar(l_remCall, Integer.toString(xMin),
072: "false", "int");
073: ScXmlScript.pcmf_addDeclPar(l_remCall, Integer.toString(xMax),
074: "false", "int");
075: ScXmlScript.pcmf_addDeclPar(l_remCall,
076: ((HoSrvGenericApplication) xAppl).pcmf_getRemName(),
077: "true", "de.ug2t.unifiedGui.interfaces.IUnApplication");
078:
079: ScXmlScript.pcmf_endAll(l_remCall);
080:
081: this .pdm_session.pcmf_call(l_remCall.toString(), this );
082:
083: this .pem_min = xMin;
084: this .pem_max = xMax;
085:
086: return;
087: };
088:
089: public AHoSrvGenericComponent pcmf_buildRefObj() throws Exception {
090: AHoSrvGenericComponent l_obj = new HoSrvGenericProgressBar(this
091: .pcmf_getName(), this .pcmf_getValue().toString(),
092: pem_min, pem_max, this .pcmf_getAppl(),
093: this .pdm_clientClass);
094: l_obj.pcmf_setGlobal(true);
095: l_obj.pcmf_setRefFrom(this );
096: l_obj.pcmf_setAutoEcho(this .pcmf_doAutoEcho());
097: this .pcmf_setGlobal(true);
098: this .pcmf_addRef(l_obj);
099:
100: return l_obj;
101: }
102:
103: public void pcmf_setMin(int xMin) {
104: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
105: "");
106:
107: if (this .pdm_session.pcmf_isInTransaction()) {
108: ScXmlScript.pcmf_createPBody(l_remCall);
109: } else {
110: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
111: ScXmlScript.pcmf_addProc(l_remCall, null);
112: }
113: ;
114: ScXmlScript.pcmf_addCall(l_remCall, null, this
115: .pcmf_getRemName(), "pcmf_setMin");
116: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xMin),
117: "false", "int");
118: ScXmlScript.pcmf_endAll(l_remCall);
119:
120: this .pdm_session.pcmf_call(l_remCall.toString(), this );
121:
122: this .pem_min = xMin;
123:
124: return;
125: }
126:
127: public void pcmf_setMax(int xMax) {
128: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
129: "");
130:
131: if (this .pdm_session.pcmf_isInTransaction()) {
132: ScXmlScript.pcmf_createPBody(l_remCall);
133: } else {
134: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
135: ScXmlScript.pcmf_addProc(l_remCall, null);
136: }
137: ;
138: ScXmlScript.pcmf_addCall(l_remCall, null, this
139: .pcmf_getRemName(), "pcmf_setMax");
140: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xMax),
141: "false", "int");
142: ScXmlScript.pcmf_endAll(l_remCall);
143:
144: this .pdm_session.pcmf_call(l_remCall.toString(), this );
145:
146: this .pem_max = xMax;
147:
148: return;
149: }
150:
151: public void pcmf_setProgress(int xProgress) {
152: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
153: "");
154:
155: if (this .pdm_session.pcmf_isInTransaction()) {
156: ScXmlScript.pcmf_createPBody(l_remCall);
157: } else {
158: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
159: ScXmlScript.pcmf_addProc(l_remCall, null);
160: }
161: ;
162: ScXmlScript.pcmf_addCall(l_remCall, null, this
163: .pcmf_getRemName(), "pcmf_setProgress");
164: ScXmlScript.pcmf_addCallPar(l_remCall, Integer
165: .toString(xProgress), "false", "int");
166: ScXmlScript.pcmf_endAll(l_remCall);
167:
168: this .pdm_session.pcmf_call(l_remCall.toString(), this );
169:
170: this .pem_progress = xProgress;
171:
172: return;
173: }
174:
175: public int pcmf_getProgress() {
176: return (this.pem_progress);
177: }
178: }
|