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 de.ug2t.unifiedGui.interfaces.*;
034:
035: public class UnDefaultProps {
036: private Object pem_value = null;
037: private String pem_fgColor = null;
038: private String pem_bgColor = null;
039: private IUnImage pem_image = null;
040:
041: private int pem_border = -1;
042: private int pem_borderw = 0;
043: private String pem_borderColor = null;
044:
045: private UnFontDescriptor pem_font = null;
046: private String pem_toolTip = null;
047:
048: public UnDefaultProps(Object xValue, String xFgColor,
049: String xBgColor, int xBorder, String xBorderColor,
050: int xBorderW, UnFontDescriptor xFont, String xToolTip,
051: IUnImage xImage) {
052: this .pem_fgColor = xFgColor;
053: this .pem_bgColor = xBgColor;
054: this .pem_border = xBorder;
055: this .pem_borderColor = xBorderColor;
056: this .pem_borderw = xBorderW;
057: this .pem_font = xFont;
058: this .pem_toolTip = xToolTip;
059: this .pem_value = xValue;
060: this .pem_image = xImage;
061: }
062:
063: public UnDefaultProps(Object xValue, String xFgColor,
064: String xBgColor, int xBorder, String xBorderColor,
065: int xBorderW, UnFontDescriptor xFont, String xToolTip) {
066: this .pem_fgColor = xFgColor;
067: this .pem_bgColor = xBgColor;
068: this .pem_border = xBorder;
069: this .pem_borderColor = xBorderColor;
070: this .pem_borderw = xBorderW;
071: this .pem_font = xFont;
072: this .pem_toolTip = xToolTip;
073: this .pem_value = xValue;
074: }
075:
076: public void pcmf_assign(UnComponent xComp) {
077: if (this .pem_bgColor != null)
078: xComp.pcmf_setBgColor(this .pem_bgColor);
079:
080: if (this .pem_fgColor != null)
081: xComp.pcmf_setFgColor(this .pem_fgColor);
082:
083: if (this .pem_border != -1)
084: xComp.pcmf_setBorder(pem_border, pem_borderColor,
085: pem_borderw);
086:
087: if (this .pem_font != null)
088: xComp.pcmf_setFont(pem_font);
089:
090: if (this .pem_toolTip != null) {
091: if (this .pem_toolTip.equals(""))
092: xComp.pcmf_setToolTip(null);
093: else
094: xComp.pcmf_setToolTip(pem_toolTip);
095: }
096:
097: if (this .pem_value != null)
098: xComp.pcmf_setValue(this .pem_value);
099:
100: if (this .pem_image != null && xComp instanceof IUnIconView)
101: ((IUnIconView) xComp).pcmf_setIcon(pem_image);
102: }
103: }
|