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.unifiedGui;
032:
033: import java.util.*;
034:
035: import de.ug2t.channel.ho.server.generic.*;
036:
037: /**
038: * @author Dirk
039: *
040: * date: 03.04.2004 project: WiSer-Framework
041: *
042: * <p>
043: * Represents a button group (radio)
044: * </p>
045: */
046: public class UnButtonGroup extends UnComponent {
047: private ArrayList pem_radios = new ArrayList();
048:
049: public UnButtonGroup(String xName) throws Exception {
050: super (xName);
051: this .pcmf_setValue("");
052: }
053:
054: public void pcmf_attach(UnComponent xRadio) {
055: this .pem_radios.add(xRadio);
056: }
057:
058: public void pcmf_detach(UnComponent xRadio) {
059: this .pem_radios.remove(xRadio);
060: }
061:
062: public boolean pcmf_isInUse() {
063: return (this .pem_radios.size() > 0 ? true : false);
064: }
065:
066: public void pcmf_setValue(Object xObj) {
067: Iterator l_it = this .pem_radios.iterator();
068: while (l_it.hasNext()) {
069: UnComponent l_obj = (UnComponent) l_it.next();
070: if (l_obj instanceof AHoSrvGenericComponent) {
071: if (xObj.equals(l_obj.pcmf_getValue()))
072: ((AHoSrvGenericComponent) l_obj)
073: .pcmf_setRemoteValue("CHECKED");
074: else
075: ((AHoSrvGenericComponent) l_obj)
076: .pcmf_setRemoteValue("NOTCHECKED");
077: }
078: l_obj.pcmf_setPropChanged(true);
079: }
080: super .pcmf_setValue(xObj);
081: }
082:
083: public ArrayList pcmf_getRadioButtonList() {
084: return (new ArrayList(this .pem_radios));
085: }
086:
087: public void pcmf_setBgColor(String xCol) {
088: super .pcmf_setBgColor(xCol);
089: Iterator l_it = this .pem_radios.iterator();
090: while (l_it.hasNext())
091: ((UnComponent) l_it.next()).pcmf_setBgColor(xCol);
092: }
093:
094: public void pcmf_setBorder(int xBorder, String xColor, int xWidth) {
095: super .pcmf_setBorder(xBorder, xColor, xWidth);
096: Iterator l_it = this .pem_radios.iterator();
097: while (l_it.hasNext())
098: ((UnComponent) l_it.next()).pcmf_setBorder(xBorder, xColor,
099: xWidth);
100: }
101:
102: public void pcmf_setFgColor(String xCol) {
103: super .pcmf_setFgColor(xCol);
104: Iterator l_it = this .pem_radios.iterator();
105: while (l_it.hasNext())
106: ((UnComponent) l_it.next()).pcmf_setFgColor(xCol);
107: }
108:
109: public void pcmf_setFont(UnFontDescriptor xFont) {
110: super .pcmf_setFont(xFont);
111: Iterator l_it = this .pem_radios.iterator();
112: while (l_it.hasNext())
113: ((UnComponent) l_it.next()).pcmf_setFont(xFont);
114: }
115:
116: public void pcmf_setToolTip(String xTip) {
117: super .pcmf_setToolTip(xTip);
118: Iterator l_it = this .pem_radios.iterator();
119: while (l_it.hasNext())
120: ((UnComponent) l_it.next()).pcmf_setToolTip(xTip);
121: }
122: }
|