001: // @@
002: // @@
003: /*
004: * Wi.Ser Framework
005: *
006: * LGPL Version: 1.8.1, 20-September-2007
007: * Copyright (C) 2005-2006 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.client.swing;
032:
033: import javax.swing.*;
034: import javax.swing.plaf.basic.*;
035:
036: import de.ug2t.unifiedGui.interfaces.*;
037:
038: public final class HoSwingProgressBar extends HoSwingComponent
039: implements IUnProgressBar {
040: private JProgressBar pem_swingObj = null;
041:
042: public HoSwingProgressBar(String xName, String xValue, int xMin,
043: int xMax, IUnApplication xAppl) throws Exception {
044: super (xName, xAppl);
045:
046: this .pem_swingObj = new JProgressBar(xMin, xMax);
047: this .pem_swingObj.setValue(0);
048: if (xValue == null)
049: this .pem_swingObj.setStringPainted(false);
050: else {
051: this .pem_swingObj.setStringPainted(true);
052: this .pem_swingObj.setString(xValue);
053: }
054:
055: ((JComponent) this .pem_swingObj).setOpaque(true);
056:
057: this .pdm_realSwingCmp = this .pem_swingObj;
058: };
059:
060: public void pcmf_setBgColor(String xCol) {
061: this .pem_swingObj.setUI(new BasicProgressBarUI());
062: super .pcmf_setBgColor(xCol);
063: }
064:
065: public void pcmf_setBorder(int xBorder, String xColor, int xWidth) {
066: if (xWidth == 0 && !this .pdm_colorSet)
067: this .pem_swingObj.updateUI();
068: else
069: this .pem_swingObj.setUI(new BasicProgressBarUI());
070:
071: super .pcmf_setBorder(xBorder, xColor, xWidth);
072: }
073:
074: public void pcmf_setValue(Object xValue) {
075: if (xValue == null)
076: this .pem_swingObj.setStringPainted(false);
077: else {
078: this .pem_swingObj.setStringPainted(true);
079: this .pem_swingObj.setString(xValue.toString());
080: }
081: super .pcmf_setValue(xValue);
082:
083: return;
084: };
085:
086: public void pcmf_setMin(int xMin) {
087: this .pem_swingObj.setMinimum(xMin);
088: }
089:
090: public void pcmf_setMax(int xMax) {
091: this .pem_swingObj.setMaximum(xMax);
092: }
093:
094: public void pcmf_setProgress(int xProgress) {
095: this .pem_swingObj.setValue(xProgress);
096: }
097:
098: public int pcmf_getProgress() {
099: return (this.pem_swingObj.getValue());
100: }
101: }
|