1 /*****************************************************/
\r
2 /* This java file is a part of the */
\r
4 /* - Plouf's Java IRC Client - */
\r
6 /* Copyright (C) 2002 - 2004 Philippe Detournay */
\r
8 /* All contacts : theplouf@yahoo.com */
\r
10 /* PJIRC is free software; you can redistribute */
\r
11 /* it and/or modify it under the terms of the GNU */
\r
12 /* General Public License as published by the */
\r
13 /* Free Software Foundation; version 2 or later of */
\r
16 /* PJIRC is distributed in the hope that it will */
\r
17 /* be useful, but WITHOUT ANY WARRANTY; without */
\r
18 /* even the implied warranty of MERCHANTABILITY or */
\r
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
\r
20 /* General Public License for more details. */
\r
22 /* You should have received a copy of the GNU */
\r
23 /* General Public License along with PJIRC; if */
\r
24 /* not, write to the Free Software Foundation, */
\r
25 /* Inc., 59 Temple Place, Suite 330, Boston, */
\r
26 /* MA 02111-1307 USA */
\r
28 /*****************************************************/
\r
30 package irc.gui.pixx;
\r
32 import java.awt.Color;
\r
33 import java.awt.Graphics;
\r
34 import java.awt.Panel;
\r
37 * A progress bar panel.
\r
39 public class AWTProgressBar extends Panel {
\r
45 * Set the value, between 0 and 1 inclusive.
\r
48 * the value, between 0 and 1 inclusive.
\r
50 public void setValue(double v) {
\r
55 * Set the display color.
\r
58 * the display color.
\r
60 public void setColor(Color c) {
\r
65 public void paint(Graphics g) {
\r
67 int w = getSize().width;
\r
68 int h = getSize().height;
\r
70 int pos = (int) (_v * w);
\r
72 g.fillRect(0, 0, pos, h);
\r
73 g.setColor(Color.white);
\r
74 g.fillRect(pos, 0, w - pos, h);
\r