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 HoSrvGenericSplitPane extends AHoSrvGenericComponent
038: implements IUnSplitPane {
039: private int pem_percent = 20;
040: private int pem_mode = VSPLIT;
041: private int pem_slider = 2;
042: private int pem_sAbs = -1;
043:
044: public HoSrvGenericSplitPane(String xName, IUnApplication xAppl,
045: String xClass) throws Exception {
046: super (xName);
047: this .pcmf_setAppl(xAppl);
048:
049: this .pcmf_setLocalValue(xName);
050:
051: if (xClass == null)
052: pdm_clientClass = "de.ug2t.channel.ho.client.swing.HoSwingSplitPane";
053: else
054: pdm_clientClass = xClass;
055:
056: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
057: "");
058:
059: if (this .pdm_session.pcmf_isInTransaction()) {
060: ScXmlScript.pcmf_createPBody(l_remCall);
061: } else {
062: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
063: ScXmlScript.pcmf_addProc(l_remCall, null);
064: }
065: ;
066: ScXmlScript.pcmf_addDecl(l_remCall, this .pcmf_getRemName(),
067: this .pdm_clientClass, "global");
068: ScXmlScript.pcmf_addDeclPar(l_remCall, xName, "false",
069: "java.lang.String");
070: ScXmlScript.pcmf_addDeclPar(l_remCall,
071: ((HoSrvGenericApplication) xAppl).pcmf_getRemName(),
072: "true", "de.ug2t.unifiedGui.interfaces.IUnApplication");
073:
074: ScXmlScript.pcmf_endAll(l_remCall);
075:
076: this .pdm_session.pcmf_call(l_remCall.toString(), this );
077:
078: // Debug
079: // this.pcmf_addListener(new UnPrintValueListener());
080:
081: return;
082: }
083:
084: public AHoSrvGenericComponent pcmf_buildRefObj() throws Exception {
085: AHoSrvGenericComponent l_obj = new HoSrvGenericSplitPane(this
086: .pcmf_getName(), this .pcmf_getAppl(),
087: this .pdm_clientClass);
088:
089: l_obj.pcmf_setGlobal(true);
090: l_obj.pcmf_setRefFrom(this );
091: this .pcmf_setGlobal(true);
092: l_obj.pcmf_setAutoEcho(this .pcmf_doAutoEcho());
093: this .pcmf_addRef(l_obj);
094:
095: return (l_obj);
096: }
097:
098: public void pcmf_addFirst(IUnForm xForm) {
099: this .pcmf_removeFirst();
100: this .pcmf_addNode(FNAME, xForm.pcmf_getUnComponent());
101: return;
102: }
103:
104: public void pcmf_addSecond(IUnForm xForm) {
105: this .pcmf_removeSecond();
106: this .pcmf_addNode(SNAME, xForm.pcmf_getUnComponent());
107: return;
108: }
109:
110: public void pcmf_removeFirst() {
111: this .pcmf_removeNode(FNAME);
112: return;
113: }
114:
115: public void pcmf_removeSecond() {
116: this .pcmf_removeNode(SNAME);
117: return;
118: }
119:
120: public void pcmf_setSplitPercent(int xPercent) {
121: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
122: "");
123:
124: if (this .pdm_session.pcmf_isInTransaction()) {
125: ScXmlScript.pcmf_createPBody(l_remCall);
126: } else {
127: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
128: ScXmlScript.pcmf_addProc(l_remCall, null);
129: }
130: ;
131: ScXmlScript.pcmf_addCall(l_remCall, null, this
132: .pcmf_getRemName(), "pcmf_setSplitPercent");
133: ScXmlScript.pcmf_addCallPar(l_remCall, Integer
134: .toString(xPercent), "false", "int");
135: ScXmlScript.pcmf_endAll(l_remCall);
136:
137: this .pdm_session.pcmf_call(l_remCall.toString(), this );
138:
139: this .pem_percent = xPercent;
140: }
141:
142: public void pcmf_setSplitMode(int xSplit) {
143: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
144: "");
145:
146: if (this .pdm_session.pcmf_isInTransaction()) {
147: ScXmlScript.pcmf_createPBody(l_remCall);
148: } else {
149: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
150: ScXmlScript.pcmf_addProc(l_remCall, null);
151: }
152: ;
153: ScXmlScript.pcmf_addCall(l_remCall, null, this
154: .pcmf_getRemName(), "pcmf_setSplitMode");
155: ScXmlScript.pcmf_addCallPar(l_remCall,
156: Integer.toString(xSplit), "false", "int");
157: ScXmlScript.pcmf_endAll(l_remCall);
158:
159: this .pdm_session.pcmf_call(l_remCall.toString(), this );
160:
161: this .pem_mode = xSplit;
162: }
163:
164: public int pcmf_getSplitPercent() {
165: return (this .pem_percent);
166: }
167:
168: public int pcmf_getSplitMode() {
169: return (this .pem_mode);
170: }
171:
172: public void pcmf_setSliderPercent(int xPercent) {
173: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
174: "");
175:
176: if (this .pdm_session.pcmf_isInTransaction()) {
177: ScXmlScript.pcmf_createPBody(l_remCall);
178: } else {
179: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
180: ScXmlScript.pcmf_addProc(l_remCall, null);
181: }
182: ;
183: ScXmlScript.pcmf_addCall(l_remCall, null, this
184: .pcmf_getRemName(), "pcmf_setSliderPercent");
185: ScXmlScript.pcmf_addCallPar(l_remCall, Integer
186: .toString(xPercent), "false", "int");
187: ScXmlScript.pcmf_endAll(l_remCall);
188:
189: this .pdm_session.pcmf_call(l_remCall.toString(), this );
190: this .pem_slider = xPercent;
191: this .pem_sAbs = -1;
192:
193: return;
194: }
195:
196: public void pcmf_setSliderAbs(int xPixel) {
197: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
198: "");
199:
200: if (this .pdm_session.pcmf_isInTransaction()) {
201: ScXmlScript.pcmf_createPBody(l_remCall);
202: } else {
203: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
204: ScXmlScript.pcmf_addProc(l_remCall, null);
205: }
206: ;
207: ScXmlScript.pcmf_addCall(l_remCall, null, this
208: .pcmf_getRemName(), "pcmf_setSliderAbs");
209: ScXmlScript.pcmf_addCallPar(l_remCall,
210: Integer.toString(xPixel), "false", "int");
211: ScXmlScript.pcmf_endAll(l_remCall);
212:
213: this .pdm_session.pcmf_call(l_remCall.toString(), this );
214: this .pem_slider = -1;
215: this .pem_sAbs = xPixel;
216:
217: return;
218: }
219:
220: public int pcmf_getSliderAbs() {
221: return (this .pem_sAbs);
222: }
223:
224: public int pcmf_getSliderPercent() {
225: return (this.pem_slider);
226: }
227: }
|