1 /* JProgressBar.java --
2 Copyright (C) 2002 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
43 import javax
.accessibility
.*;
44 import javax
.swing
.event
.*;
45 import javax
.swing
.plaf
.*;
49 * @author Andrew Selkirk
52 public class JProgressBar
extends JComponent
implements SwingConstants
, Accessible
55 //-------------------------------------------------------------
56 // Classes ----------------------------------------------------
57 //-------------------------------------------------------------
61 * AccessibleJProgressBar
63 protected class AccessibleJProgressBar
extends AccessibleJComponent
64 implements AccessibleValue
{
66 //-------------------------------------------------------------
67 // Variables --------------------------------------------------
68 //-------------------------------------------------------------
71 //-------------------------------------------------------------
72 // Initialization ---------------------------------------------
73 //-------------------------------------------------------------
76 * Constructor AccessibleJProgressBar
77 * @param component TODO
79 protected AccessibleJProgressBar(JProgressBar component
) {
82 } // AccessibleJProgressBar()
85 //-------------------------------------------------------------
86 // Methods ----------------------------------------------------
87 //-------------------------------------------------------------
90 * getAccessibleStateSet
91 * @returns AccessibleStateSet
93 public AccessibleStateSet
getAccessibleStateSet() {
95 } // getAccessibleStateSet()
99 * @returns AccessibleRole
101 public AccessibleRole
getAccessibleRole() {
102 return AccessibleRole
.PROGRESS_BAR
;
103 } // getAccessibleRole()
107 * @returns AccessibleValue
109 public AccessibleValue
getAccessibleValue() {
111 } // getAccessibleValue()
114 * getCurrentAccessibleValue
117 public Number
getCurrentAccessibleValue() {
119 } // getCurrentAccessibleValue()
122 * setCurrentAccessibleValue
126 public boolean setCurrentAccessibleValue(Number value0
) {
127 return false; // TODO
128 } // setCurrentAccessibleValue()
131 * getMinimumAccessibleValue
134 public Number
getMinimumAccessibleValue() {
136 } // getMinimumAccessibleValue()
139 * getMaximumAccessibleValue
142 public Number
getMaximumAccessibleValue() {
144 } // getMaximumAccessibleValue()
147 } // AccessibleJProgressBar
150 //-------------------------------------------------------------
151 // Variables --------------------------------------------------
152 //-------------------------------------------------------------
157 private static final String uiClassID
= "ProgressBarUI";
162 protected int orientation
;
167 protected boolean paintBorder
;
172 protected BoundedRangeModel model
;
177 protected String progressString
;
182 protected boolean paintString
;
187 protected transient ChangeEvent changeEvent
;
192 protected ChangeListener changeListener
;
195 //-------------------------------------------------------------
196 // Initialization ---------------------------------------------
197 //-------------------------------------------------------------
200 * Constructor JProgressBar
202 public JProgressBar() {
207 * Constructor JProgressBar
208 * @param orientation TODO
210 public JProgressBar(int orientation
) {
215 * Constructor JProgressBar
216 * @param minimum TODO
217 * @param maximum TODO
219 public JProgressBar(int minimum
, int maximum
) {
224 * Constructor JProgressBar
225 * @param minimum TODO
226 * @param maximum TODO
227 * @param orientation TODO
229 public JProgressBar(int minimum
, int maximum
, int orientation
) {
234 * Constructor JProgressBar
237 public JProgressBar(BoundedRangeModel model
) {
242 //-------------------------------------------------------------
243 // Methods ----------------------------------------------------
244 //-------------------------------------------------------------
249 * @exception IOException TODO
251 private void writeObject(ObjectOutputStream stream
) throws IOException
{
259 public int getValue() {
267 public void setValue(int value
) {
273 * @param graphics TODO
275 protected void paintBorder(Graphics graphics
) {
283 public int getOrientation() {
285 } // getOrientation()
289 * @param orientation TODO
291 public void setOrientation(int orientation
) {
293 } // setOrientation()
299 public boolean isStringPainted() {
300 return false; // TODO
301 } // isStringPainted()
305 * @param painted TODO
307 public void setStringPainted(boolean painted
) {
309 } // setStringPainted()
315 public String
getString() {
323 public void setString(String string
) {
331 public double getPercentComplete() {
333 } // getPercentComplete()
339 public boolean isBorderPainted() {
340 return false; // TODO
341 } // isBorderPainted()
345 * @param painted TODO
347 public void setBorderPainted(boolean painted
) {
349 } // setBorderPainted()
353 * @returns ProgressBarUI
355 public ProgressBarUI
getUI() {
356 return (ProgressBarUI
) ui
;
363 public void setUI(ProgressBarUI ui
) {
371 public void updateUI() {
372 setUI((ProgressBarUI
) UIManager
.get(this));
380 public String
getUIClassID() {
385 * createChangeListener
386 * @returns ChangeListener
388 protected ChangeListener
createChangeListener() {
390 } // createChangeListener()
394 * @param listener TODO
396 public void addChangeListener(ChangeListener listener
) {
398 } // addChangeListener()
401 * removeChangeListener
402 * @param listener TODO
404 public void removeChangeListener(ChangeListener valulistener
) {
406 } // removeChangeListener()
411 protected void fireStateChanged() {
413 } // fireStateChanged()
417 * @returns BoundedRangeModel
419 public BoundedRangeModel
getModel() {
427 public void setModel(BoundedRangeModel model
) {
435 public int getMinimum() {
441 * @param minimum TODO
443 public void setMinimum(int minimum
) {
451 public int getMaximum() {
457 * @param maximum TODO
459 public void setMaximum(int maximum
) {
467 protected String
paramString() {
472 * getAccessibleContext
473 * @returns AccessibleContext
475 public AccessibleContext
getAccessibleContext() {
476 if (accessibleContext
== null) {
477 accessibleContext
= new AccessibleJProgressBar(this);
479 return accessibleContext
;
480 } // getAccessibleContext()