1. /*
  2. * @(#)JProgressBar.java 1.72 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing;
  8. import java.awt.Color;
  9. import java.awt.Graphics;
  10. import java.io.Serializable;
  11. import java.io.ObjectOutputStream;
  12. import java.io.ObjectInputStream;
  13. import java.io.IOException;
  14. import javax.swing.event.*;
  15. import javax.accessibility.*;
  16. import javax.swing.plaf.ProgressBarUI;
  17. /**
  18. * A component that displays an integer value within a bounded
  19. * interval. A progress bar typically communicates the progress of an
  20. * event by displaying its percentage of completion and possibly a textual
  21. * display of this percentage.
  22. *
  23. * <p>
  24. * <strong>Warning:</strong>
  25. * Serialized objects of this class will not be compatible with
  26. * future Swing releases. The current serialization support is appropriate
  27. * for short term storage or RMI between applications running the same
  28. * version of Swing. A future release of Swing will provide support for
  29. * long term persistence.
  30. *
  31. * @beaninfo
  32. * attribute: isContainer false
  33. * description: A component that displays an integer value.
  34. *
  35. * @version 1.72 11/29/01
  36. * @author Michael C. Albers
  37. */
  38. public class JProgressBar extends JComponent implements SwingConstants, Accessible
  39. {
  40. /**
  41. * @see #getUIClassID
  42. */
  43. private static final String uiClassID = "ProgressBarUI";
  44. /**
  45. * The orientation to display the progress bar.
  46. * The default is HORIZONTAL.
  47. */
  48. protected int orientation;
  49. /**
  50. * Whether to display the border around the progress bar.
  51. * The default is true.
  52. */
  53. protected boolean paintBorder;
  54. /**
  55. * The data structure that holds the various values for the progress bar.
  56. */
  57. protected BoundedRangeModel model;
  58. /**
  59. * A optional String that can be displayed on the progress bar.
  60. * The default is null. Setting this to a non-null value does not
  61. * imply that the String will be displayed.
  62. */
  63. protected String progressString;
  64. /**
  65. * Whether to textually display a String on the progress bar.
  66. * The default is false. Setting this to true will cause a textual
  67. * display of the progress to de rendered on the progress bar. If
  68. * the progressString is null, the percentage done to be displayed
  69. * on the progress bar. If the progressString is non-null, it is
  70. * rendered on the progress bar.
  71. */
  72. protected boolean paintString;
  73. /**
  74. * The default minimum for a progress bar is 0.
  75. */
  76. static final private int defaultMinimum = 0;
  77. /**
  78. * The default maximum for a progress bar is 100.
  79. */
  80. static final private int defaultMaximum = 100;
  81. /**
  82. * The default orientation for a progress bar is HORIZONTAL.
  83. */
  84. static final private int defaultOrientation = HORIZONTAL;
  85. /**
  86. * Only one ChangeEvent is needed per instance since the
  87. * event's only interesting property is the immutable source, which
  88. * is the progress bar.
  89. */
  90. protected transient ChangeEvent changeEvent = null;
  91. protected ChangeListener changeListener = null;
  92. /**
  93. * Creates a horizontal progress bar.
  94. * The default orientation for progress bars is
  95. * <code>JProgressBar.HORIZONTAL</code>.
  96. * By default, the String is set to <code>null</code> and the
  97. * StringPainted is not painted.
  98. * The border is painted by default.
  99. * Uses the defaultMinimum (0) and defaultMaximum (100).
  100. * Uses the defaultMinimum for the initial value of the progress bar.
  101. */
  102. public JProgressBar()
  103. {
  104. this(defaultOrientation);
  105. }
  106. /**
  107. * Creates a progress bar with the specified orientation, which can be
  108. * either <code>JProgressBar.VERTICAL</code> or
  109. * <code>JProgressBar.HORIZONTAL</code>.
  110. * By default, the String is set to <code>null</code> and the
  111. * StringPainted is not painted.
  112. * The border is painted by default.
  113. * Uses the defaultMinimum (0) and defaultMaximum (100).
  114. * Uses the defaultMinimum for the initial value of the progress bar.
  115. */
  116. public JProgressBar(int orient)
  117. {
  118. this(orient, defaultMinimum, defaultMaximum);
  119. }
  120. /**
  121. * Creates a horizontal progress bar, which is the default.
  122. * By default, the String is set to <code>null</code> and the
  123. * StringPainted is not painted.
  124. * The border is painted by default.
  125. * Uses the specified minimum and maximum.
  126. * Uses the specified minimum for the initial value of the progress bar.
  127. */
  128. public JProgressBar(int min, int max)
  129. {
  130. this(defaultOrientation, min, max);
  131. }
  132. /**
  133. * Creates a progress bar using the specified orientation,
  134. * minimum, and maximum.
  135. * By default, the String is set to <code>null</code> and the
  136. * StringPainted is not painted.
  137. * The border is painted by default.
  138. * Sets the inital value of the progress bar to the specified minimum.
  139. * The BoundedRangeModel that sits underneath the progress bar
  140. * handles any issues that may arrise from improperly setting the
  141. * minimum, value, and maximum on the progress bar.
  142. *
  143. * @see BoundedRangeModel
  144. * @see #setOrientation
  145. * @see #setBorderPainted
  146. * @see #setStringPainted
  147. * @see #setString
  148. */
  149. public JProgressBar(int orient, int min, int max)
  150. {
  151. // Creating the model this way is a bit simplistic, but
  152. // I believe that it is the the most common usage of this
  153. // component - it's what people will expect.
  154. setModel(new DefaultBoundedRangeModel(min, 0, min, max));
  155. updateUI();
  156. setOrientation(orient); // documented with set/getOrientation()
  157. setBorderPainted(true); // documented with is/setBorderPainted()
  158. setStringPainted(false); // see setStringPainted
  159. setString(null); // see getString
  160. }
  161. /**
  162. * Creates a horizontal progress bar, the default orientation.
  163. * By default, the String is set to <code>null</code> and the
  164. * StringPainted is not painted.
  165. * The border is painted by default.
  166. * Uses the specified BoundedRangeModel
  167. * which holds the minimum, value, and maximum.
  168. *
  169. * @see BoundedRangeModel
  170. * @see #setOrientation
  171. * @see #setBorderPainted
  172. * @see #setStringPainted
  173. * @see #setString
  174. */
  175. public JProgressBar(BoundedRangeModel newModel)
  176. {
  177. setModel(newModel);
  178. updateUI();
  179. setOrientation(defaultOrientation); // see setOrientation()
  180. setBorderPainted(true); // see setBorderPainted()
  181. setStringPainted(false); // see setStringPainted
  182. setString(null); // see getString
  183. }
  184. /**
  185. * Returns <code>JProgressBar.VERTICAL</code> or
  186. * <code>JProgressBar.HORIZONTAL</code>, depending on the orientation
  187. * of the progress bar. The default orientation is
  188. * <code>HORIZONTAL</code>.
  189. *
  190. * @return HORIZONTAL or VERTICAL
  191. * @see #setOrientation
  192. */
  193. public int getOrientation() {
  194. return orientation;
  195. }
  196. /**
  197. * Sets the progress bar's orientation to <I>newOrientation</I>, which
  198. * must be <code>JProgressBar.VERTICAL</code> or
  199. * <code>JProgressBar.HORIZONTAL</code>. The default orientation
  200. * is <code>HORIZONTAL</code>.
  201. *
  202. * @param newOrientation HORIZONTAL or VERTICAL
  203. * @exception IllegalArgumentException if <I>newOrientation</I>
  204. * is an illegal value
  205. * @see #getOrientation
  206. *
  207. * @beaninfo
  208. * preferred: true
  209. * bound: true
  210. * attribute: visualUpdate true
  211. * description: Set the progress bar's orientation.
  212. */
  213. public void setOrientation(int newOrientation) {
  214. if (orientation != newOrientation) {
  215. switch (newOrientation) {
  216. case VERTICAL:
  217. case HORIZONTAL:
  218. int oldOrientation = orientation;
  219. orientation = newOrientation;
  220. firePropertyChange("orientation", oldOrientation, newOrientation);
  221. if (accessibleContext != null) {
  222. accessibleContext.firePropertyChange(
  223. AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
  224. ((oldOrientation == VERTICAL)
  225. ? AccessibleState.VERTICAL
  226. : AccessibleState.HORIZONTAL),
  227. ((orientation == VERTICAL)
  228. ? AccessibleState.VERTICAL
  229. : AccessibleState.HORIZONTAL));
  230. }
  231. break;
  232. default:
  233. throw new IllegalArgumentException(newOrientation +
  234. " is not a legal orientation");
  235. }
  236. revalidate();
  237. }
  238. }
  239. /**
  240. * Returns true if the progress bar will render a string onto
  241. * the representation of the progress bar. Returns false if it
  242. * will not do this rendering. The default is false - the progress
  243. * bar does not draw the string by default.
  244. *
  245. * @return whether the progress bar renders a string
  246. * @see #setStringPainted
  247. * @see #setString
  248. */
  249. public boolean isStringPainted() {
  250. return paintString;
  251. }
  252. /**
  253. * Sets whether the progress bar will render a string.
  254. *
  255. * @param b true if the progress bar will render a string.
  256. * @see #isStringPainted
  257. * @beaninfo
  258. * bound: true
  259. * attribute: visualUpdate true
  260. * description: Whether the progress bar will render a string.
  261. */
  262. public void setStringPainted(boolean b) {
  263. boolean oldValue = paintString;
  264. paintString = b;
  265. firePropertyChange("stringPainted", oldValue, paintString);
  266. if (paintString != oldValue) {
  267. revalidate();
  268. repaint();
  269. }
  270. }
  271. /**
  272. * Returns the current value of the Progress String.
  273. * If you are providing a custom Progress String via this method,
  274. * you will want to ensure that you call setString() before
  275. * you call getString();
  276. *
  277. * @return the value of the percent string
  278. * @see #setString
  279. */
  280. public String getString(){
  281. if (progressString != null) {
  282. return progressString;
  283. } else {
  284. int pc = (int)Math.round(100 * getPercentComplete());
  285. return new String(pc + "%");
  286. }
  287. }
  288. /**
  289. * Sets the value of the Progress String. By default,
  290. * this String is set to <code>null</code>.
  291. * If you are providing a custom Progress String via this method,
  292. * you will want to ensure that you call setString() before
  293. * you call getString().
  294. * If you have provided a custom String and want to revert to
  295. * the built-in behavior, set the String back to <code>null</code>.
  296. *
  297. * @param s the value of the percent string
  298. * @see #getString
  299. * @beaninfo
  300. * bound: true
  301. * attribute: visualUpdate true
  302. * description: Whether the progress bar will render a percent string
  303. */
  304. public void setString(String s){
  305. String oldValue = progressString;
  306. progressString = s;
  307. firePropertyChange("string", oldValue, progressString);
  308. if (progressString == null || oldValue == null || !progressString.equals(oldValue)) {
  309. repaint();
  310. }
  311. }
  312. /**
  313. * Returns the percentage/percent complete for the progress bar.
  314. * Note that, as a double, this number is between 0.00 and 1.00.
  315. *
  316. * @return the percent complete for this progress bar.
  317. */
  318. public double getPercentComplete() {
  319. long span = model.getMaximum() - model.getMinimum();
  320. double currentValue = model.getValue();
  321. double pc = (currentValue - model.getMinimum()) / span;
  322. return pc;
  323. }
  324. /**
  325. * Returns true if the progress bar has a border or false if it does not.
  326. * By default, this is true - the progress bar paints it's border.
  327. *
  328. * @return whether the progress bar paints its border
  329. * @see #setBorderPainted
  330. * @beaninfo
  331. * description: Does the progress bar paint its border
  332. */
  333. public boolean isBorderPainted() {
  334. return paintBorder;
  335. }
  336. /**
  337. * Sets whether the progress bar should paint its border.
  338. * By default, this is true - paint the border.
  339. *
  340. * @param b true if the progress bar paints its border
  341. * @see #isBorderPainted
  342. * @beaninfo
  343. * bound: true
  344. * attribute: visualUpdate true
  345. * description: Whether the progress bar should paint its border.
  346. */
  347. public void setBorderPainted(boolean b) {
  348. boolean oldValue = paintBorder;
  349. paintBorder = b;
  350. firePropertyChange("borderPainted", oldValue, paintBorder);
  351. if (paintBorder != oldValue) {
  352. repaint();
  353. }
  354. }
  355. /**
  356. * Paint the progress bar's border if BorderPainted property is true.
  357. *
  358. * @param g the Graphics context within which to paint the border
  359. * @see #paint
  360. * @see #setBorder
  361. * @see #isBorderPainted
  362. * @see #setBorderPainted
  363. */
  364. protected void paintBorder(Graphics g) {
  365. if (isBorderPainted()) {
  366. super.paintBorder(g);
  367. }
  368. }
  369. /**
  370. * Returns the L&F object that renders this component.
  371. *
  372. * @return the ProgressBarUI object that renders this component
  373. */
  374. public ProgressBarUI getUI() {
  375. return (ProgressBarUI)ui;
  376. }
  377. /**
  378. * Sets the L&F object that renders this component.
  379. *
  380. * @param ui the ProgressBarUI L&F object
  381. * @see UIDefaults#getUI
  382. * @beaninfo
  383. * expert: true
  384. * attribute: visualUpdate true
  385. * description: The ProgressBarUI implementation that defines the progress bar's look and feel.
  386. */
  387. public void setUI(ProgressBarUI ui) {
  388. super.setUI(ui);
  389. }
  390. /**
  391. * Notification from the UIFactory that the L&F has changed.
  392. * Called to replace the UI with the latest version from the
  393. * UIFactory.
  394. *
  395. * @see JComponent#updateUI
  396. */
  397. public void updateUI() {
  398. setUI((ProgressBarUI)UIManager.getUI(this));
  399. }
  400. /**
  401. * Returns the name of the L&F class that renders this component.
  402. *
  403. * @return "ProgressBarUI"
  404. * @see JComponent#getUIClassID
  405. * @see UIDefaults#getUI
  406. * @beaninfo
  407. * expert: true
  408. * description: A string that specifies the name of the L&F class.
  409. */
  410. public String getUIClassID() {
  411. return uiClassID;
  412. }
  413. /* We pass each Change event to the listeners with the
  414. * the progress bar as the event source.
  415. * <p>
  416. * <strong>Warning:</strong>
  417. * Serialized objects of this class will not be compatible with
  418. * future Swing releases. The current serialization support is appropriate
  419. * for short term storage or RMI between applications running the same
  420. * version of Swing. A future release of Swing will provide support for
  421. * long term persistence.
  422. */
  423. private class ModelListener implements ChangeListener, Serializable {
  424. public void stateChanged(ChangeEvent e) {
  425. fireStateChanged();
  426. }
  427. }
  428. /* Subclasses that want to handle ChangeEvents differently
  429. * can override this to return a subclass of ModelListener or
  430. * another ChangeListener implementation.
  431. */
  432. protected ChangeListener createChangeListener() {
  433. return new ModelListener();
  434. }
  435. /**
  436. * Adds a ChangeListener to the button.
  437. *
  438. * @param l the ChangeListener to add
  439. */
  440. public void addChangeListener(ChangeListener l) {
  441. listenerList.add(ChangeListener.class, l);
  442. }
  443. /**
  444. * Removes a ChangeListener from the button.
  445. *
  446. * @param l the ChangeListener to remove
  447. */
  448. public void removeChangeListener(ChangeListener l) {
  449. listenerList.remove(ChangeListener.class, l);
  450. }
  451. /**
  452. * Notify all listeners that have registered interest for
  453. * notification on this event type. The event instance
  454. * is lazily created using the parameters passed into
  455. * the fire method.
  456. * @see EventListenerList
  457. */
  458. protected void fireStateChanged() {
  459. // Guaranteed to return a non-null array
  460. Object[] listeners = listenerList.getListenerList();
  461. // Process the listeners last to first, notifying
  462. // those that are interested in this event
  463. for (int i = listeners.length-2; i>=0; i-=2) {
  464. if (listeners[i]==ChangeListener.class) {
  465. // Lazily create the event:
  466. if (changeEvent == null)
  467. changeEvent = new ChangeEvent(this);
  468. ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);
  469. }
  470. }
  471. }
  472. /**
  473. * Returns the data model used by the JProgressBar.
  474. *
  475. * @return the BoundedRangeModel currently in use
  476. * @see BoundedRangeModel
  477. */
  478. public BoundedRangeModel getModel() {
  479. return model;
  480. }
  481. /**
  482. * Sets the data model used by the JProgressBar.
  483. *
  484. * @param newModel the BoundedRangeModel to use
  485. * @see BoundedRangeModel
  486. * @beaninfo
  487. * expert: true
  488. * description: The data model used by the JProgressBar.
  489. */
  490. public void setModel(BoundedRangeModel newModel) {
  491. // PENDING(???) setting the same model to multiple bars is broken; listeners
  492. BoundedRangeModel oldModel = getModel();
  493. if (newModel != oldModel) {
  494. if (oldModel != null) {
  495. oldModel.removeChangeListener(changeListener);
  496. changeListener = null;
  497. }
  498. model = newModel;
  499. if (newModel != null) {
  500. changeListener = createChangeListener();
  501. newModel.addChangeListener(changeListener);
  502. }
  503. if (accessibleContext != null) {
  504. accessibleContext.firePropertyChange(
  505. AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
  506. (oldModel== null
  507. ? null : new Integer(oldModel.getValue())),
  508. (newModel== null
  509. ? null : new Integer(newModel.getValue())));
  510. }
  511. model.setExtent(0);
  512. repaint();
  513. }
  514. }
  515. /* All of the model methods are implemented by delegation. */
  516. /**
  517. * Returns the model's current value. The value is always between the
  518. * model's minimum and maximum values, inclusive. By default, the value
  519. * equals the minimum.
  520. *
  521. * @return the value
  522. * @see #setValue
  523. * @see BoundedRangeModel
  524. */
  525. public int getValue() { return getModel().getValue(); }
  526. /**
  527. * Returns the model's minimum value.
  528. * By default, this is <code>0</code>.
  529. *
  530. * @return an int -- the model's minimum
  531. * @see #setMinimum
  532. * @see BoundedRangeModel
  533. */
  534. public int getMinimum() { return getModel().getMinimum(); }
  535. /**
  536. * Returns the model's maximum value.
  537. * By default, this is <code>100</code>.
  538. *
  539. * @return an int -- the model's maximum
  540. * @see #setMaximum
  541. * @see BoundedRangeModel
  542. */
  543. public int getMaximum() { return getModel().getMaximum(); }
  544. /**
  545. * Sets the model's current value to <I>x</I>.
  546. * The underlying BoundedRangeModel will handle any mathematical
  547. * issues arrising from assigning faulty values.
  548. *
  549. * @param x the new value
  550. * @see #getValue
  551. * @see BoundedRangeModel#setValue
  552. * @beaninfo
  553. * preferred: true
  554. * description: The model's current value.
  555. */
  556. public void setValue(int n) {
  557. BoundedRangeModel brm = getModel();
  558. int oldValue = brm.getValue();
  559. brm.setValue(n);
  560. if (accessibleContext != null) {
  561. accessibleContext.firePropertyChange(
  562. AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
  563. new Integer(oldValue),
  564. new Integer(brm.getValue()));
  565. }
  566. }
  567. /**
  568. * Sets the model's minimum to <I>x</I>.
  569. * The underlying BoundedRangeModel will handle any mathematical
  570. * issues arrising from assigning faulty values.
  571. * <p>
  572. * Notifies any listeners if the data changes.
  573. *
  574. * @param x the new minimum
  575. * @see #getMinimum
  576. * @see #addChangeListener
  577. * @see BoundedRangeModel
  578. * @beaninfo
  579. * preferred: true
  580. * description: The model's minimum value.
  581. */
  582. public void setMinimum(int n) { getModel().setMinimum(n); }
  583. /**
  584. * Sets the model's maximum to <I>x</I>.
  585. * The underlying BoundedRangeModel will handle any mathematical
  586. * issues arrising from assigning faulty values.
  587. * <p>
  588. * Notifies any listeners if the data changes.
  589. *
  590. * @param x the new maximum
  591. * @see #getMaximum
  592. * @see #addChangeListener
  593. * @see BoundedRangeModel
  594. * @beaninfo
  595. * preferred: true
  596. * description: The model's maximum value.
  597. */
  598. public void setMaximum(int n) { getModel().setMaximum(n); }
  599. /**
  600. * See readObject() and writeObject() in JComponent for more
  601. * information about serialization in Swing.
  602. */
  603. private void writeObject(ObjectOutputStream s) throws IOException {
  604. s.defaultWriteObject();
  605. if ((ui != null) && (getUIClassID().equals(uiClassID))) {
  606. ui.installUI(this);
  607. }
  608. }
  609. /**
  610. * Returns a string representation of this JProgressBar. This method
  611. * is intended to be used only for debugging purposes, and the
  612. * content and format of the returned string may vary between
  613. * implementations. The returned string may be empty but may not
  614. * be <code>null</code>.
  615. *
  616. * @return a string representation of this JProgressBar.
  617. */
  618. protected String paramString() {
  619. String orientationString = (orientation == HORIZONTAL ?
  620. "HORIZONTAL" : "VERTICAL");
  621. String paintBorderString = (paintBorder ?
  622. "true" : "false");
  623. String progressStringString = (progressString != null ?
  624. progressString : "");
  625. String paintStringString = (paintString ?
  626. "true" : "false");
  627. return super.paramString() +
  628. ",orientation=" + orientationString +
  629. ",paintBorder=" + paintBorderString +
  630. ",paintString=" + paintStringString +
  631. ",progressString=" + progressStringString;
  632. }
  633. /////////////////
  634. // Accessibility support
  635. ////////////////
  636. /**
  637. * Get the AccessibleContext associated with this JComponent
  638. *
  639. * @return the AccessibleContext of this JComponent
  640. * @beaninfo
  641. * expert: true
  642. * description: The AccessibleContext associated with this ProgressBar.
  643. */
  644. public AccessibleContext getAccessibleContext() {
  645. if (accessibleContext == null) {
  646. accessibleContext = new AccessibleJProgressBar();
  647. }
  648. return accessibleContext;
  649. }
  650. /**
  651. * The class used to obtain the accessible role for this object.
  652. * <p>
  653. * <strong>Warning:</strong>
  654. * Serialized objects of this class will not be compatible with
  655. * future Swing releases. The current serialization support is appropriate
  656. * for short term storage or RMI between applications running the same
  657. * version of Swing. A future release of Swing will provide support for
  658. * long term persistence.
  659. */
  660. protected class AccessibleJProgressBar extends AccessibleJComponent
  661. implements AccessibleValue {
  662. /**
  663. * Get the state set of this object.
  664. *
  665. * @return an instance of AccessibleState containing the current state
  666. * of the object
  667. * @see AccessibleState
  668. */
  669. public AccessibleStateSet getAccessibleStateSet() {
  670. AccessibleStateSet states = super.getAccessibleStateSet();
  671. if (getModel().getValueIsAdjusting()) {
  672. states.add(AccessibleState.BUSY);
  673. }
  674. if (getOrientation() == VERTICAL) {
  675. states.add(AccessibleState.VERTICAL);
  676. } else {
  677. states.add(AccessibleState.HORIZONTAL);
  678. }
  679. return states;
  680. }
  681. /**
  682. * Get the role of this object.
  683. *
  684. * @return an instance of AccessibleRole describing the role of the
  685. * object
  686. */
  687. public AccessibleRole getAccessibleRole() {
  688. return AccessibleRole.PROGRESS_BAR;
  689. }
  690. /**
  691. * Get the AccessibleValue associated with this object if one
  692. * exists. Otherwise return null.
  693. */
  694. public AccessibleValue getAccessibleValue() {
  695. return this;
  696. }
  697. /**
  698. * Get the accessible value of this object.
  699. *
  700. * @return The current value of this object.
  701. */
  702. public Number getCurrentAccessibleValue() {
  703. return new Integer(getValue());
  704. }
  705. /**
  706. * Set the value of this object as a Number.
  707. *
  708. * @return True if the value was set.
  709. */
  710. public boolean setCurrentAccessibleValue(Number n) {
  711. if (n instanceof Integer) {
  712. setValue(n.intValue());
  713. return true;
  714. } else {
  715. return false;
  716. }
  717. }
  718. /**
  719. * Get the minimum accessible value of this object.
  720. *
  721. * @return The minimum value of this object.
  722. */
  723. public Number getMinimumAccessibleValue() {
  724. return new Integer(getMinimum());
  725. }
  726. /**
  727. * Get the maximum accessible value of this object.
  728. *
  729. * @return The maximum value of this object.
  730. */
  731. public Number getMaximumAccessibleValue() {
  732. return new Integer(getMaximum());
  733. }
  734. } // AccessibleJProgressBar
  735. }