001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005 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 HoSrvGenericAnchoredPopup extends AHoSrvGenericComponent
039: implements IUnAnchoredPopUp {
040: private int pem_hoffs = 0;
041: private int pem_voffs = 2;
042: private boolean pem_display = false;
043: private IUnImage pem_icon = null;
044:
045: public HoSrvGenericAnchoredPopup(String xName,
046: IUnApplication xAppl, String xClass) throws Exception {
047: super (xName);
048: this .pcmf_setAppl(xAppl);
049: this .pcmf_setLocalValue("");
050:
051: if (xClass == null)
052: pdm_clientClass = "de.ug2t.channel.ho.client.swing.HoSwingAnchoredPopup";
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:
071: ScXmlScript.pcmf_addDeclPar(l_remCall,
072: ((HoSrvGenericApplication) xAppl).pcmf_getRemName(),
073: "true", "de.ug2t.unifiedGui.interfaces.IUnApplication");
074:
075: ScXmlScript.pcmf_endAll(l_remCall);
076:
077: this .pdm_session.pcmf_call(l_remCall.toString(), this );
078:
079: return;
080: };
081:
082: public AHoSrvGenericComponent pcmf_buildRefObj() throws Exception {
083: HoSrvGenericAnchoredPopup l_obj = new HoSrvGenericAnchoredPopup(
084: this .pcmf_getName(), this .pcmf_getAppl(),
085: this .pdm_clientClass);
086: l_obj.pcmf_setIcon(this .pcmf_getIcon());
087: l_obj.pcmf_setGlobal(true);
088: l_obj.pcmf_setAutoEcho(this .pcmf_doAutoEcho());
089: this .pcmf_setGlobal(true);
090: l_obj.pcmf_setRefFrom(this );
091: this .pcmf_addRef(l_obj);
092:
093: return l_obj;
094: }
095:
096: public void pcmf_setComponent(IUnComponent xComp) {
097: this .pcmf_clear();
098: this .pcmf_addNode("POPUP", xComp.pcmf_getUnComponent());
099: }
100:
101: public void pcmf_setComponent(UnComponent xComp) {
102: this .pcmf_clear();
103: this .pcmf_addNode("POPUP", xComp.pcmf_getUnComponent());
104: }
105:
106: public void pcmf_setPopUpHorizontalOffset(int xOffs) {
107: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
108: "");
109:
110: if (this .pdm_session.pcmf_isInTransaction()) {
111: ScXmlScript.pcmf_createPBody(l_remCall);
112: } else {
113: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
114: ScXmlScript.pcmf_addProc(l_remCall, null);
115: }
116: ;
117: ScXmlScript.pcmf_addCall(l_remCall, null, this
118: .pcmf_getRemName(), "pcmf_setPopUpHorizontalOffset");
119: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xOffs),
120: "false", "int");
121: ScXmlScript.pcmf_endAll(l_remCall);
122:
123: this .pdm_session.pcmf_call(l_remCall.toString(), this );
124: this .pem_hoffs = xOffs;
125: }
126:
127: public int pcmf_getPopUpVerticalOffset() {
128: return (this .pem_voffs);
129: }
130:
131: public void pcmf_setPopUpVerticalOffset(int xOffs) {
132: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
133: "");
134:
135: if (this .pdm_session.pcmf_isInTransaction()) {
136: ScXmlScript.pcmf_createPBody(l_remCall);
137: } else {
138: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
139: ScXmlScript.pcmf_addProc(l_remCall, null);
140: }
141: ;
142: ScXmlScript.pcmf_addCall(l_remCall, null, this
143: .pcmf_getRemName(), "pcmf_setPopUpVerticalOffset");
144: ScXmlScript.pcmf_addCallPar(l_remCall, Integer.toString(xOffs),
145: "false", "int");
146: ScXmlScript.pcmf_endAll(l_remCall);
147:
148: this .pdm_session.pcmf_call(l_remCall.toString(), this );
149: this .pem_voffs = xOffs;
150: }
151:
152: public int pcmf_getPopUpHorizontalOffset() {
153: return (this .pem_hoffs);
154: }
155:
156: public boolean pcmf_isDisplay() {
157: return this .pem_display;
158: }
159:
160: public void pcmf_displayPopup() {
161: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
162: "");
163:
164: if (this .pdm_session.pcmf_isInTransaction()) {
165: ScXmlScript.pcmf_createPBody(l_remCall);
166: } else {
167: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
168: ScXmlScript.pcmf_addProc(l_remCall, null);
169: }
170: ;
171: ScXmlScript.pcmf_addCall(l_remCall, null, this
172: .pcmf_getRemName(), "pcmf_displayPopup");
173: ScXmlScript.pcmf_endAll(l_remCall);
174:
175: this .pdm_session.pcmf_call(l_remCall.toString(), this );
176: this .pem_display = true;
177: }
178:
179: public void pcmf_hidePopup() {
180: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
181: "");
182:
183: if (this .pdm_session.pcmf_isInTransaction()) {
184: ScXmlScript.pcmf_createPBody(l_remCall);
185: } else {
186: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
187: ScXmlScript.pcmf_addProc(l_remCall, null);
188: }
189: ;
190: ScXmlScript.pcmf_addCall(l_remCall, null, this
191: .pcmf_getRemName(), "pcmf_hidePopup");
192: ScXmlScript.pcmf_endAll(l_remCall);
193:
194: this .pdm_session.pcmf_call(l_remCall.toString(), this );
195:
196: this .pem_display = false;
197: }
198:
199: public void pcmf_setIcon(IUnImage xIcon) {
200: KeStringTemplateWrapper l_remCall = new KeStringTemplateWrapper(
201: "");
202:
203: if (this .pdm_session.pcmf_isInTransaction()) {
204: ScXmlScript.pcmf_createPBody(l_remCall);
205: } else {
206: ScXmlScript.pcmf_createxScriptString(l_remCall, null);
207: ScXmlScript.pcmf_addProc(l_remCall, null);
208: }
209: ;
210: ScXmlScript.pcmf_addCall(l_remCall, null, this
211: .pcmf_getRemName(), "pcmf_setIcon");
212:
213: if (xIcon != null)
214: ScXmlScript.pcmf_addCallPar(l_remCall, xIcon
215: .pcmf_getUnComponent().pcmf_getRemName(), "true",
216: "de.ug2t.unifiedGui.interfaces.IUnImage");
217: else
218: ScXmlScript.pcmf_addCallPar(l_remCall, "null", "true",
219: "de.ug2t.unifiedGui.interfaces.IUnImage");
220:
221: ScXmlScript.pcmf_endAll(l_remCall);
222:
223: this .pdm_session.pcmf_call(l_remCall.toString(), this );
224:
225: if (this .pem_icon != null)
226: this .pem_icon.pcmf_detach();
227:
228: this .pem_icon = xIcon;
229: if (this .pem_icon != null)
230: this .pem_icon.pcmf_attach();
231: };
232:
233: public IUnImage pcmf_getIcon() {
234: return (this .pem_icon);
235: };
236:
237: public void pcmf_delete() throws Exception {
238: if (this .pdm_deleted == true)
239: return;
240:
241: if (this.pem_icon != null) {
242: this.pem_icon.pcmf_detach();
243: this.pem_icon.pcmf_getUnComponent().pcmf_delete();
244: }
245:
246: super.pcmf_delete();
247: }
248: }
|