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.markup.generic;
032:
033: import java.util.*;
034:
035: import de.ug2t.channel.markup.html.renderer.*;
036: import de.ug2t.connector.*;
037: import de.ug2t.kernel.*;
038: import de.ug2t.unifiedGui.interfaces.*;
039:
040: public class MuGenericForm extends MuGenericContainer implements
041: IUnForm, IKePoolable {
042: private IKeView pem_view = new HtmlFormRenderer();
043: private IUnImage pem_icon = null;
044: protected IUnImage pdm_bgImg = null;
045: private boolean pem_scroll = true;
046: protected MuGenericScrollController pdm_scrCrt = null;
047:
048: public MuGenericForm(String xName, ACoDataGetter xTplGetter,
049: Object xTplName, MuGenericApplication xAppl)
050: throws Exception {
051: super (xName, xTplGetter, xTplName, xAppl);
052:
053: this .pcmf_setView(pem_view);
054: this .pcmf_setValue(xName);
055: this .pcmf_setBgColor(this .pdm_kit.getPANEL_BG());
056: this .pcmf_setFill(true, true);
057: this .pdm_getMaxSpace = true;
058:
059: this .pdm_scrCrt = new MuGenericScrollController("myscrcrt",
060: this );
061:
062: return;
063: };
064:
065: // @@
066:
067: public Object pcmf_execView() {
068: try {
069: if (this .pcmf_isHidden() && !this .pcmf_getRenderIfHidden()) {
070: this .pcmf_setPropChanged(false);
071: Iterator l_it = this .pcmf_getDeepSubNodeIt();
072: while (l_it.hasNext())
073: ((KeTreeElement) l_it.next())
074: .pcmf_setPropChanged(false);
075:
076: return (((MuGenericApplication) this .pcmf_getAppl())
077: .pcmf_getRenderer().pcmf_wrapMarkup("", this ));
078: }
079:
080: KeStringTemplate l_retval = null;
081: KeStringTemplate l_body = new KeStringTemplate("");
082: Iterator it = this .pcmf_getSubIterator();
083:
084: l_retval = (KeStringTemplate) pdm_NodeView
085: .pcmf_output(this );
086:
087: IMuGenericLayoutManager l_layout = this
088: .pcmf_getLayoutManager();
089: if (l_layout == null) {
090: Object l_obj = null;
091: while (it.hasNext()) {
092: l_obj = it.next();
093: l_body.pcmf_stringAddEnd(((KeTreeElement) l_obj)
094: .pcmf_execView().toString());
095: }
096: } else {
097: l_layout.pcmf_layout();
098: l_body.pcmf_stringAddEnd(l_layout
099: .pcmf_getMarkupString());
100: }
101:
102: l_retval = KeTools.pcmf_stringSubst(l_retval, "$BODY",
103: l_body.toString());
104:
105: return (((MuGenericApplication) this .pcmf_getAppl())
106: .pcmf_getRenderer().pcmf_wrapMarkup(l_retval
107: .toString()
108: + pcmf_evChannelandMenuOut(), this ));
109: } catch (Exception e) {
110: KeLog.pcmf_logException("ug2t", this , e);
111: return ("ERROR");
112: }
113: };
114:
115: public void pcmf_setIcon(IUnImage xIcon) {
116: if (xIcon == this .pem_icon)
117: return;
118:
119: if (this .pem_icon != null)
120: this .pem_icon.pcmf_detach();
121:
122: pem_icon = xIcon;
123: this .pem_icon.pcmf_attach();
124:
125: this .pcmf_setPropChanged(true);
126: };
127:
128: public IUnImage pcmf_getIcon() {
129: return (this .pem_icon);
130: }
131:
132: public void pcmf_setBgImage(IUnImage xImg) {
133: if (this .pdm_bgImg == xImg)
134: return;
135:
136: this .pdm_bgImg = xImg;
137: this .pcmf_setPropChanged(true);
138: }
139:
140: public IUnImage pcmf_getBgImage() {
141: return (this .pdm_bgImg);
142: };
143:
144: public void pcmf_setScroll(boolean xScroll) {
145: if (this .pem_scroll == xScroll)
146: return;
147:
148: pem_scroll = xScroll;
149: this .pcmf_setPropChanged(true);
150: return;
151: }
152:
153: public boolean pcmf_getScroll() {
154: return (this .pem_scroll);
155: }
156:
157: public void pcmf_scrollXRel(int xPx) {
158: this .pdm_scrCrt.pcmf_scrollXRel(xPx);
159: }
160:
161: public void pcmf_scrollXAbs(int xPx) {
162: this .pdm_scrCrt.pcmf_scrollXAbs(xPx);
163: }
164:
165: public void pcmf_scrollYRel(int xPy) {
166: this .pdm_scrCrt.pcmf_scrollYRel(xPy);
167: }
168:
169: public void pcmf_scrollYAbs(int xPy) {
170: this .pdm_scrCrt.pcmf_scrollYAbs(xPy);
171: }
172:
173: public int pcmf_getXScroll() {
174: return (this .pdm_scrCrt.pcmf_getX());
175: }
176:
177: public int pcmf_getYScroll() {
178: return (this .pdm_scrCrt.pcmf_getY());
179: }
180:
181: public MuGenericScrollController pcmf_getScrollCrt() {
182: return (this .pdm_scrCrt);
183: }
184:
185: public void pcmf_delete() throws Exception {
186: if (this .pdm_deleted == true)
187: return;
188:
189: this .pdm_scrCrt.pcmf_delete();
190:
191: if (this .pem_icon != null) {
192: this .pem_icon.pcmf_detach();
193: this .pem_icon.pcmf_getUnComponent().pcmf_delete();
194: }
195:
196: super .pcmf_delete();
197: }
198:
199: // @@
200: }
|