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 final class MuGenericBorder extends MuGenericContainer implements
041: IUnBorder, IKePoolable {
042: private IKeView pem_view = new HtmlBorderRenderer();
043:
044: protected String pdm_border = "1";
045: protected String pdm_boColor = "black";
046: protected String pdm_boStyle = "solid";
047: protected IUnImage pem_bgImg = null;
048: private boolean pem_scroll = true;
049:
050: public MuGenericBorder(String xName, ACoDataGetter xTplGetter,
051: Object xTplName, MuGenericApplication xAppl)
052: throws Exception {
053: super (xName, xTplGetter, xTplName, xAppl);
054:
055: this .pcmf_setView(pem_view);
056: this .pcmf_setValue(xName);
057:
058: this .pcmf_setFill(true, true);
059: this .pdm_getMaxSpace = true;
060:
061: return;
062: };
063:
064: // @@
065:
066: public Object pcmf_execView() {
067: try {
068: if (this .pcmf_isHidden() && !this .pcmf_getRenderIfHidden()) {
069: this .pcmf_setPropChanged(false);
070: Iterator l_it = this .pcmf_getDeepSubNodeIt();
071: while (l_it.hasNext())
072: ((KeTreeElement) l_it.next())
073: .pcmf_setPropChanged(false);
074:
075: return (((MuGenericApplication) this .pcmf_getAppl())
076: .pcmf_getRenderer().pcmf_wrapMarkup("", this ));
077: }
078:
079: KeStringTemplate l_retval = null;
080: KeStringTemplate l_body = new KeStringTemplate("");
081: Iterator it = this .pcmf_getSubIterator();
082:
083: l_retval = (KeStringTemplate) pdm_NodeView
084: .pcmf_output(this );
085:
086: IMuGenericLayoutManager l_layout = this
087: .pcmf_getLayoutManager();
088: if (l_layout == null) {
089: Object l_obj = null;
090: while (it.hasNext()) {
091: l_obj = it.next();
092: l_body.pcmf_stringAddEnd(((KeTreeElement) l_obj)
093: .pcmf_execView().toString());
094: }
095: } else {
096: l_layout.pcmf_layout();
097: l_body.pcmf_stringAddEnd(l_layout
098: .pcmf_getMarkupString());
099: }
100:
101: l_retval = KeTools.pcmf_stringSubst(l_retval, "$BODY",
102: l_body.toString());
103:
104: return (((MuGenericApplication) this .pcmf_getAppl())
105: .pcmf_getRenderer().pcmf_wrapMarkup(l_retval
106: .toString()
107: + pcmf_evChannelandMenuOut(), this ));
108: } catch (Exception e) {
109: KeLog.pcmf_logException("ug2t", this , e);
110: return ("ERROR");
111: }
112: };
113:
114: public void pcmf_setBorderLine(int xBorder) {
115: String l_border = Integer.toString(xBorder);
116:
117: if (pdm_border.equals(l_border))
118: return;
119:
120: this .pdm_border = l_border;
121: this .pcmf_setPropChanged(true);
122:
123: return;
124: };
125:
126: public String pcmf_getBoLine() {
127: return (this .pdm_border);
128: }
129:
130: public void pcmf_setBoColor(String xColor) {
131: if (this .pdm_boColor.equals(xColor))
132: return;
133:
134: this .pdm_boColor = xColor;
135: this .pcmf_setPropChanged(true);
136:
137: return;
138: };
139:
140: public String pcmf_getBoColor() {
141: return (this .pdm_boColor);
142: }
143:
144: public void pcmf_setBoStyle(int xStyle) {
145: String l_oldStyle = this .pdm_boStyle;
146: switch (xStyle) {
147: case IUnComponent.INSETS_BORDER:
148: this .pdm_boStyle = "inset";
149: break;
150: case IUnComponent.OUTSETS_BORDER:
151: this .pdm_boStyle = "outset";
152: break;
153: case IUnComponent.LINE_BORDER:
154: this .pdm_boStyle = "solid";
155: break;
156: default:
157: this .pdm_boStyle = "none";
158: }
159:
160: if (l_oldStyle.equals(this .pdm_boStyle))
161: return;
162:
163: this .pcmf_setPropChanged(true);
164:
165: return;
166: };
167:
168: public String pcmf_getBoStyleText() {
169: return (this .pdm_boStyle);
170: }
171:
172: public void pcmf_setBgImage(IUnImage xImg) {
173: if (this .pem_bgImg == xImg)
174: return;
175:
176: this .pcmf_setPropChanged(true);
177: this .pem_bgImg = xImg;
178: }
179:
180: public IUnImage pcmf_getBgImage() {
181: return (this .pem_bgImg);
182: };
183:
184: public void pcmf_setScroll(boolean xScroll) {
185: if (this .pem_scroll == xScroll)
186: return;
187:
188: pem_scroll = xScroll;
189: this .pcmf_setPropChanged(true);
190:
191: return;
192: }
193:
194: public boolean pcmf_getScroll() {
195: return (this .pem_scroll);
196: }
197:
198: // @@
199: }
|