< prev index next >

src/java.desktop/share/classes/javax/swing/JProgressBar.java

Print this page

        

*** 64,74 **** * and switch it back to determinate mode. * * <p> * * Here is an example of creating a progress bar, ! * where <code>task</code> is an object (representing some piece of work) * which returns information about the progress of the task: * *<pre> *progressBar = new JProgressBar(0, task.getLengthOfTask()); *progressBar.setValue(0); --- 64,74 ---- * and switch it back to determinate mode. * * <p> * * Here is an example of creating a progress bar, ! * where {@code task} is an object (representing some piece of work) * which returns information about the progress of the task: * *<pre> *progressBar = new JProgressBar(0, task.getLengthOfTask()); *progressBar.setValue(0);
*** 113,123 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. * * @see javax.swing.plaf.basic.BasicProgressBarUI * @see javax.swing.BoundedRangeModel * @see javax.swing.SwingWorker --- 113,123 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. * * @see javax.swing.plaf.basic.BasicProgressBarUI * @see javax.swing.BoundedRangeModel * @see javax.swing.SwingWorker
*** 138,156 **** */ private static final String uiClassID = "ProgressBarUI"; /** * Whether the progress bar is horizontal or vertical. ! * The default is <code>HORIZONTAL</code>. * * @see #setOrientation */ protected int orientation; /** * Whether to display a border around the progress bar. ! * The default is <code>true</code>. * * @see #setBorderPainted */ protected boolean paintBorder; --- 138,156 ---- */ private static final String uiClassID = "ProgressBarUI"; /** * Whether the progress bar is horizontal or vertical. ! * The default is {@code HORIZONTAL}. * * @see #setOrientation */ protected int orientation; /** * Whether to display a border around the progress bar. ! * The default is {@code true}. * * @see #setBorderPainted */ protected boolean paintBorder;
*** 161,187 **** */ protected BoundedRangeModel model; /** * An optional string that can be displayed on the progress bar. ! * The default is <code>null</code>. Setting this to a non-<code>null</code> * value does not imply that the string will be displayed. * To display the string, {@code paintString} must be {@code true}. * * @see #setString * @see #setStringPainted */ protected String progressString; /** * Whether to display a string of text on the progress bar. ! * The default is <code>false</code>. ! * Setting this to <code>true</code> causes a textual * display of the progress to be rendered on the progress bar. If ! * the <code>progressString</code> is <code>null</code>, * the percentage of completion is displayed on the progress bar. ! * Otherwise, the <code>progressString</code> is * rendered on the progress bar. * * @see #setStringPainted * @see #setString */ --- 161,187 ---- */ protected BoundedRangeModel model; /** * An optional string that can be displayed on the progress bar. ! * The default is {@code null}. Setting this to a non-{@code null} * value does not imply that the string will be displayed. * To display the string, {@code paintString} must be {@code true}. * * @see #setString * @see #setStringPainted */ protected String progressString; /** * Whether to display a string of text on the progress bar. ! * The default is {@code false}. ! * Setting this to {@code true} causes a textual * display of the progress to be rendered on the progress bar. If ! * the {@code progressString} is {@code null}, * the percentage of completion is displayed on the progress bar. ! * Otherwise, the {@code progressString} is * rendered on the progress bar. * * @see #setStringPainted * @see #setString */
*** 194,209 **** /** * The default maximum for a progress bar is 100. */ private static final int defaultMaximum = 100; /** ! * The default orientation for a progress bar is <code>HORIZONTAL</code>. */ private static final int defaultOrientation = HORIZONTAL; /** ! * Only one <code>ChangeEvent</code> is needed per instance since the * event's only interesting property is the immutable source, which * is the progress bar. * The event is lazily created the first time that an * event notification is fired. * --- 194,209 ---- /** * The default maximum for a progress bar is 100. */ private static final int defaultMaximum = 100; /** ! * The default orientation for a progress bar is {@code HORIZONTAL}. */ private static final int defaultOrientation = HORIZONTAL; /** ! * Only one {@code ChangeEvent} is needed per instance since the * event's only interesting property is the immutable source, which * is the progress bar. * The event is lazily created the first time that an * event notification is fired. *
*** 225,236 **** * Format used when displaying percent complete. */ private transient Format format; /** ! * Whether the progress bar is indeterminate (<code>true</code>) or ! * normal (<code>false</code>); the default is <code>false</code>. * * @see #setIndeterminate * @since 1.4 */ private boolean indeterminate; --- 225,236 ---- * Format used when displaying percent complete. */ private transient Format format; /** ! * Whether the progress bar is indeterminate ({@code true}) or ! * normal ({@code false}); the default is {@code false}. * * @see #setIndeterminate * @since 1.4 */ private boolean indeterminate;
*** 281,291 **** * Creates a horizontal progress bar * with the specified minimum and maximum. * Sets the initial value of the progress bar to the specified minimum. * By default, a border is painted but a progress string is not. * <p> ! * The <code>BoundedRangeModel</code> that holds the progress bar's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the progress bar. * See the {@code BoundedRangeModel} documentation for details. * * @param min the minimum value of the progress bar --- 281,291 ---- * Creates a horizontal progress bar * with the specified minimum and maximum. * Sets the initial value of the progress bar to the specified minimum. * By default, a border is painted but a progress string is not. * <p> ! * The {@code BoundedRangeModel} that holds the progress bar's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the progress bar. * See the {@code BoundedRangeModel} documentation for details. * * @param min the minimum value of the progress bar
*** 308,318 **** * Creates a progress bar using the specified orientation, * minimum, and maximum. * By default, a border is painted but a progress string is not. * Sets the initial value of the progress bar to the specified minimum. * <p> ! * The <code>BoundedRangeModel</code> that holds the progress bar's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the progress bar. * See the {@code BoundedRangeModel} documentation for details. * * @param orient the desired orientation of the progress bar --- 308,318 ---- * Creates a progress bar using the specified orientation, * minimum, and maximum. * By default, a border is painted but a progress string is not. * Sets the initial value of the progress bar to the specified minimum. * <p> ! * The {@code BoundedRangeModel} that holds the progress bar's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the progress bar. * See the {@code BoundedRangeModel} documentation for details. * * @param orient the desired orientation of the progress bar
*** 374,399 **** * Returns {@code SwingConstants.VERTICAL} or * {@code SwingConstants.HORIZONTAL}, depending on the orientation * of the progress bar. The default orientation is * {@code SwingConstants.HORIZONTAL}. * ! * @return <code>HORIZONTAL</code> or <code>VERTICAL</code> * @see #setOrientation */ public int getOrientation() { return orientation; } /** ! * Sets the progress bar's orientation to <code>newOrientation</code>, * which must be {@code SwingConstants.VERTICAL} or * {@code SwingConstants.HORIZONTAL}. The default orientation * is {@code SwingConstants.HORIZONTAL}. * ! * @param newOrientation <code>HORIZONTAL</code> or <code>VERTICAL</code> ! * @exception IllegalArgumentException if <code>newOrientation</code> * is an illegal value * @see #getOrientation * * @beaninfo * preferred: true --- 374,399 ---- * Returns {@code SwingConstants.VERTICAL} or * {@code SwingConstants.HORIZONTAL}, depending on the orientation * of the progress bar. The default orientation is * {@code SwingConstants.HORIZONTAL}. * ! * @return {@code HORIZONTAL} or {@code VERTICAL} * @see #setOrientation */ public int getOrientation() { return orientation; } /** ! * Sets the progress bar's orientation to {@code newOrientation}, * which must be {@code SwingConstants.VERTICAL} or * {@code SwingConstants.HORIZONTAL}. The default orientation * is {@code SwingConstants.HORIZONTAL}. * ! * @param newOrientation {@code HORIZONTAL} or {@code VERTICAL} ! * @exception IllegalArgumentException if {@code newOrientation} * is an illegal value * @see #getOrientation * * @beaninfo * preferred: true
*** 428,458 **** } } /** ! * Returns the value of the <code>stringPainted</code> property. * ! * @return the value of the <code>stringPainted</code> property * @see #setStringPainted * @see #setString */ public boolean isStringPainted() { return paintString; } /** ! * Sets the value of the <code>stringPainted</code> property, * which determines whether the progress bar * should render a progress string. ! * The default is <code>false</code>, meaning * no string is painted. * Some look and feels might not support progress strings * or might support them only when the progress bar is in determinate mode. * ! * @param b <code>true</code> if the progress bar should render a string * @see #isStringPainted * @see #setString * @beaninfo * bound: true * attribute: visualUpdate true --- 428,458 ---- } } /** ! * Returns the value of the {@code stringPainted} property. * ! * @return the value of the {@code stringPainted} property * @see #setStringPainted * @see #setString */ public boolean isStringPainted() { return paintString; } /** ! * Sets the value of the {@code stringPainted} property, * which determines whether the progress bar * should render a progress string. ! * The default is {@code false}, meaning * no string is painted. * Some look and feels might not support progress strings * or might support them only when the progress bar is in determinate mode. * ! * @param b {@code true} if the progress bar should render a string * @see #isStringPainted * @see #setString * @beaninfo * bound: true * attribute: visualUpdate true
*** 492,508 **** } } /** * Sets the value of the progress string. By default, ! * this string is <code>null</code>, implying the built-in behavior of * using a simple percent string. * If you have provided a custom progress string and want to revert to ! * the built-in behavior, set the string back to <code>null</code>. * <p> * The progress string is painted only if ! * the <code>isStringPainted</code> method returns <code>true</code>. * * @param s the value of the progress string * @see #getString * @see #setStringPainted * @see #isStringPainted --- 492,508 ---- } } /** * Sets the value of the progress string. By default, ! * this string is {@code null}, implying the built-in behavior of * using a simple percent string. * If you have provided a custom progress string and want to revert to ! * the built-in behavior, set the string back to {@code null}. * <p> * The progress string is painted only if ! * the {@code isStringPainted} method returns {@code true}. * * @param s the value of the progress string * @see #getString * @see #setStringPainted * @see #isStringPainted
*** 532,562 **** double pc = (currentValue - model.getMinimum()) / span; return pc; } /** ! * Returns the <code>borderPainted</code> property. * ! * @return the value of the <code>borderPainted</code> property * @see #setBorderPainted * @beaninfo * description: Does the progress bar paint its border */ public boolean isBorderPainted() { return paintBorder; } /** ! * Sets the <code>borderPainted</code> property, which is ! * <code>true</code> if the progress bar should paint its border. ! * The default value for this property is <code>true</code>. * Some look and feels might not implement painted borders; * they will ignore this property. * ! * @param b <code>true</code> if the progress bar * should paint its border; ! * otherwise, <code>false</code> * @see #isBorderPainted * @beaninfo * bound: true * attribute: visualUpdate true * description: Whether the progress bar should paint its border. --- 532,562 ---- double pc = (currentValue - model.getMinimum()) / span; return pc; } /** ! * Returns the {@code borderPainted} property. * ! * @return the value of the {@code borderPainted} property * @see #setBorderPainted * @beaninfo * description: Does the progress bar paint its border */ public boolean isBorderPainted() { return paintBorder; } /** ! * Sets the {@code borderPainted} property, which is ! * {@code true} if the progress bar should paint its border. ! * The default value for this property is {@code true}. * Some look and feels might not implement painted borders; * they will ignore this property. * ! * @param b {@code true} if the progress bar * should paint its border; ! * otherwise, {@code false} * @see #isBorderPainted * @beaninfo * bound: true * attribute: visualUpdate true * description: Whether the progress bar should paint its border.
*** 569,582 **** repaint(); } } /** ! * Paints the progress bar's border if the <code>borderPainted</code> ! * property is <code>true</code>. * ! * @param g the <code>Graphics</code> context within which to paint the border * @see #paint * @see #setBorder * @see #isBorderPainted * @see #setBorderPainted */ --- 569,582 ---- repaint(); } } /** ! * Paints the progress bar's border if the {@code borderPainted} ! * property is {@code true}. * ! * @param g the {@code Graphics} context within which to paint the border * @see #paint * @see #setBorder * @see #isBorderPainted * @see #setBorderPainted */
*** 588,607 **** /** * Returns the look-and-feel object that renders this component. * ! * @return the <code>ProgressBarUI</code> object that renders this component */ public ProgressBarUI getUI() { return (ProgressBarUI)ui; } /** * Sets the look-and-feel object that renders this component. * ! * @param ui a <code>ProgressBarUI</code> object * @see UIDefaults#getUI * @beaninfo * bound: true * hidden: true * attribute: visualUpdate true --- 588,607 ---- /** * Returns the look-and-feel object that renders this component. * ! * @return the {@code ProgressBarUI} object that renders this component */ public ProgressBarUI getUI() { return (ProgressBarUI)ui; } /** * Sets the look-and-feel object that renders this component. * ! * @param ui a {@code ProgressBarUI} object * @see UIDefaults#getUI * @beaninfo * bound: true * hidden: true * attribute: visualUpdate true
*** 644,654 **** * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") // Same-version serialization only private class ModelListener implements ChangeListener, Serializable { public void stateChanged(ChangeEvent e) { --- 644,654 ---- * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") // Same-version serialization only private class ModelListener implements ChangeListener, Serializable { public void stateChanged(ChangeEvent e) {
*** 658,668 **** /** * Subclasses that want to handle change events * from the model differently * can override this to return ! * an instance of a custom <code>ChangeListener</code> implementation. * The default {@code ChangeListener} simply calls the * {@code fireStateChanged} method to forward {@code ChangeEvent}s * to the {@code ChangeListener}s that have been added directly to the * progress bar. * --- 658,668 ---- /** * Subclasses that want to handle change events * from the model differently * can override this to return ! * an instance of a custom {@code ChangeListener} implementation. * The default {@code ChangeListener} simply calls the * {@code fireStateChanged} method to forward {@code ChangeEvent}s * to the {@code ChangeListener}s that have been added directly to the * progress bar. *
*** 675,706 **** protected ChangeListener createChangeListener() { return new ModelListener(); } /** ! * Adds the specified <code>ChangeListener</code> to the progress bar. * ! * @param l the <code>ChangeListener</code> to add */ public void addChangeListener(ChangeListener l) { listenerList.add(ChangeListener.class, l); } /** ! * Removes a <code>ChangeListener</code> from the progress bar. * ! * @param l the <code>ChangeListener</code> to remove */ public void removeChangeListener(ChangeListener l) { listenerList.remove(ChangeListener.class, l); } /** ! * Returns an array of all the <code>ChangeListener</code>s added ! * to this progress bar with <code>addChangeListener</code>. * ! * @return all of the <code>ChangeListener</code>s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return listenerList.getListeners(ChangeListener.class); --- 675,706 ---- protected ChangeListener createChangeListener() { return new ModelListener(); } /** ! * Adds the specified {@code ChangeListener} to the progress bar. * ! * @param l the {@code ChangeListener} to add */ public void addChangeListener(ChangeListener l) { listenerList.add(ChangeListener.class, l); } /** ! * Removes a {@code ChangeListener} from the progress bar. * ! * @param l the {@code ChangeListener} to remove */ public void removeChangeListener(ChangeListener l) { listenerList.remove(ChangeListener.class, l); } /** ! * Returns an array of all the {@code ChangeListener}s added ! * to this progress bar with {@code addChangeListener}. * ! * @return all of the {@code ChangeListener}s added or an empty * array if no listeners have been added * @since 1.4 */ public ChangeListener[] getChangeListeners() { return listenerList.getListeners(ChangeListener.class);
*** 736,759 **** } /** * Returns the data model used by this progress bar. * ! * @return the <code>BoundedRangeModel</code> currently in use * @see #setModel * @see BoundedRangeModel */ public BoundedRangeModel getModel() { return model; } /** ! * Sets the data model used by the <code>JProgressBar</code>. * Note that the {@code BoundedRangeModel}'s {@code extent} is not used, * and is set to {@code 0}. * ! * @param newModel the <code>BoundedRangeModel</code> to use * * @beaninfo * expert: true * description: The data model used by the JProgressBar. */ --- 736,759 ---- } /** * Returns the data model used by this progress bar. * ! * @return the {@code BoundedRangeModel} currently in use * @see #setModel * @see BoundedRangeModel */ public BoundedRangeModel getModel() { return model; } /** ! * Sets the data model used by the {@code JProgressBar}. * Note that the {@code BoundedRangeModel}'s {@code extent} is not used, * and is set to {@code 0}. * ! * @param newModel the {@code BoundedRangeModel} to use * * @beaninfo * expert: true * description: The data model used by the JProgressBar. */
*** 793,803 **** /* All of the model methods are implemented by delegation. */ /** * Returns the progress bar's current {@code value} ! * from the <code>BoundedRangeModel</code>. * The value is always between the * minimum and maximum values, inclusive. * * @return the current value of the progress bar * @see #setValue --- 793,803 ---- /* All of the model methods are implemented by delegation. */ /** * Returns the progress bar's current {@code value} ! * from the {@code BoundedRangeModel}. * The value is always between the * minimum and maximum values, inclusive. * * @return the current value of the progress bar * @see #setValue
*** 805,825 **** */ public int getValue() { return getModel().getValue(); } /** * Returns the progress bar's {@code minimum} value ! * from the <code>BoundedRangeModel</code>. * * @return the progress bar's minimum value * @see #setMinimum * @see BoundedRangeModel#getMinimum */ public int getMinimum() { return getModel().getMinimum(); } /** * Returns the progress bar's {@code maximum} value ! * from the <code>BoundedRangeModel</code>. * * @return the progress bar's maximum value * @see #setMaximum * @see BoundedRangeModel#getMaximum */ --- 805,825 ---- */ public int getValue() { return getModel().getValue(); } /** * Returns the progress bar's {@code minimum} value ! * from the {@code BoundedRangeModel}. * * @return the progress bar's minimum value * @see #setMinimum * @see BoundedRangeModel#getMinimum */ public int getMinimum() { return getModel().getMinimum(); } /** * Returns the progress bar's {@code maximum} value ! * from the {@code BoundedRangeModel}. * * @return the progress bar's maximum value * @see #setMaximum * @see BoundedRangeModel#getMaximum */
*** 858,870 **** } } /** * Sets the progress bar's minimum value ! * (stored in the progress bar's data model) to <code>n</code>. * <p> ! * The data model (a <code>BoundedRangeModel</code> instance) * handles any mathematical * issues arising from assigning faulty values. * See the {@code BoundedRangeModel} documentation for details. * <p> * If the minimum value is different from the previous minimum, --- 858,870 ---- } } /** * Sets the progress bar's minimum value ! * (stored in the progress bar's data model) to {@code n}. * <p> ! * The data model (a {@code BoundedRangeModel} instance) * handles any mathematical * issues arising from assigning faulty values. * See the {@code BoundedRangeModel} documentation for details. * <p> * If the minimum value is different from the previous minimum,
*** 880,892 **** */ public void setMinimum(int n) { getModel().setMinimum(n); } /** * Sets the progress bar's maximum value ! * (stored in the progress bar's data model) to <code>n</code>. * <p> ! * The underlying <code>BoundedRangeModel</code> handles any mathematical * issues arising from assigning faulty values. * See the {@code BoundedRangeModel} documentation for details. * <p> * If the maximum value is different from the previous maximum, * all change listeners are notified. --- 880,892 ---- */ public void setMinimum(int n) { getModel().setMinimum(n); } /** * Sets the progress bar's maximum value ! * (stored in the progress bar's data model) to {@code n}. * <p> ! * The underlying {@code BoundedRangeModel} handles any mathematical * issues arising from assigning faulty values. * See the {@code BoundedRangeModel} documentation for details. * <p> * If the maximum value is different from the previous maximum, * all change listeners are notified.
*** 900,927 **** * description: The progress bar's maximum value. */ public void setMaximum(int n) { getModel().setMaximum(n); } /** ! * Sets the <code>indeterminate</code> property of the progress bar, * which determines whether the progress bar is in determinate * or indeterminate mode. * An indeterminate progress bar continuously displays animation * indicating that an operation of unknown length is occurring. ! * By default, this property is <code>false</code>. * Some look and feels might not support indeterminate progress bars; * they will ignore this property. * * <p> * * See * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html" target="_top">How to Monitor Progress</a> * for examples of using indeterminate progress bars. * ! * @param newValue <code>true</code> if the progress bar * should change to indeterminate mode; ! * <code>false</code> if it should revert to normal. * * @see #isIndeterminate * @see javax.swing.plaf.basic.BasicProgressBarUI * * @since 1.4 --- 900,927 ---- * description: The progress bar's maximum value. */ public void setMaximum(int n) { getModel().setMaximum(n); } /** ! * Sets the {@code indeterminate} property of the progress bar, * which determines whether the progress bar is in determinate * or indeterminate mode. * An indeterminate progress bar continuously displays animation * indicating that an operation of unknown length is occurring. ! * By default, this property is {@code false}. * Some look and feels might not support indeterminate progress bars; * they will ignore this property. * * <p> * * See * <a href="http://docs.oracle.com/javase/tutorial/uiswing/components/progress.html" target="_top">How to Monitor Progress</a> * for examples of using indeterminate progress bars. * ! * @param newValue {@code true} if the progress bar * should change to indeterminate mode; ! * {@code false} if it should revert to normal. * * @see #isIndeterminate * @see javax.swing.plaf.basic.BasicProgressBarUI * * @since 1.4
*** 937,949 **** indeterminate = newValue; firePropertyChange("indeterminate", oldValue, indeterminate); } /** ! * Returns the value of the <code>indeterminate</code> property. * ! * @return the value of the <code>indeterminate</code> property * @see #setIndeterminate * * @since 1.4 * * @beaninfo --- 937,949 ---- indeterminate = newValue; firePropertyChange("indeterminate", oldValue, indeterminate); } /** ! * Returns the value of the {@code indeterminate} property. * ! * @return the value of the {@code indeterminate} property * @see #setIndeterminate * * @since 1.4 * * @beaninfo
*** 970,986 **** } } /** ! * Returns a string representation of this <code>JProgressBar</code>. * This method is intended to be used only for debugging purposes. The * content and format of the returned string may vary between * implementations. The returned string may be empty but may not ! * be <code>null</code>. * ! * @return a string representation of this <code>JProgressBar</code> */ protected String paramString() { String orientationString = (orientation == HORIZONTAL ? "HORIZONTAL" : "VERTICAL"); String paintBorderString = (paintBorder ? --- 970,986 ---- } } /** ! * Returns a string representation of this {@code JProgressBar}. * This method is intended to be used only for debugging purposes. The * content and format of the returned string may vary between * implementations. The returned string may be empty but may not ! * be {@code null}. * ! * @return a string representation of this {@code JProgressBar} */ protected String paramString() { String orientationString = (orientation == HORIZONTAL ? "HORIZONTAL" : "VERTICAL"); String paintBorderString = (paintBorder ?
*** 1003,1020 **** ///////////////// // Accessibility support //////////////// /** ! * Gets the <code>AccessibleContext</code> associated with this ! * <code>JProgressBar</code>. For progress bars, the ! * <code>AccessibleContext</code> takes the form of an ! * <code>AccessibleJProgressBar</code>. ! * A new <code>AccessibleJProgressBar</code> instance is created if necessary. * ! * @return an <code>AccessibleJProgressBar</code> that serves as the ! * <code>AccessibleContext</code> of this <code>JProgressBar</code> * @beaninfo * expert: true * description: The AccessibleContext associated with this ProgressBar. */ public AccessibleContext getAccessibleContext() { --- 1003,1020 ---- ///////////////// // Accessibility support //////////////// /** ! * Gets the {@code AccessibleContext} associated with this ! * {@code JProgressBar}. For progress bars, the ! * {@code AccessibleContext} takes the form of an ! * {@code AccessibleJProgressBar}. ! * A new {@code AccessibleJProgressBar} instance is created if necessary. * ! * @return an {@code AccessibleJProgressBar} that serves as the ! * {@code AccessibleContext} of this {@code JProgressBar} * @beaninfo * expert: true * description: The AccessibleContext associated with this ProgressBar. */ public AccessibleContext getAccessibleContext() {
*** 1024,1044 **** return accessibleContext; } /** * This class implements accessibility support for the ! * <code>JProgressBar</code> class. It provides an implementation of the * Java Accessibility API appropriate to progress bar user-interface * elements. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the <code>java.beans</code> package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") // Same-version serialization only protected class AccessibleJProgressBar extends AccessibleJComponent implements AccessibleValue { --- 1024,1044 ---- return accessibleContext; } /** * This class implements accessibility support for the ! * {@code JProgressBar} class. It provides an implementation of the * Java Accessibility API appropriate to progress bar user-interface * elements. * <p> * <strong>Warning:</strong> * Serialized objects of this class will not be compatible with * future Swing releases. The current serialization support is * appropriate for short term storage or RMI between applications running * the same version of Swing. As of 1.4, support for long term storage * of all JavaBeans&trade; ! * has been added to the {@code java.beans} package. * Please see {@link java.beans.XMLEncoder}. */ @SuppressWarnings("serial") // Same-version serialization only protected class AccessibleJProgressBar extends AccessibleJComponent implements AccessibleValue {
*** 1072,1085 **** public AccessibleRole getAccessibleRole() { return AccessibleRole.PROGRESS_BAR; } /** ! * Gets the <code>AccessibleValue</code> associated with this object. In the * implementation of the Java Accessibility API for this class, * returns this object, which is responsible for implementing the ! * <code>AccessibleValue</code> interface on behalf of itself. * * @return this object */ public AccessibleValue getAccessibleValue() { return this; --- 1072,1085 ---- public AccessibleRole getAccessibleRole() { return AccessibleRole.PROGRESS_BAR; } /** ! * Gets the {@code AccessibleValue} associated with this object. In the * implementation of the Java Accessibility API for this class, * returns this object, which is responsible for implementing the ! * {@code AccessibleValue} interface on behalf of itself. * * @return this object */ public AccessibleValue getAccessibleValue() { return this;
*** 1093,1105 **** public Number getCurrentAccessibleValue() { return Integer.valueOf(getValue()); } /** ! * Sets the value of this object as a <code>Number</code>. * ! * @return <code>true</code> if the value was set */ public boolean setCurrentAccessibleValue(Number n) { // TIGER- 4422535 if (n == null) { return false; --- 1093,1105 ---- public Number getCurrentAccessibleValue() { return Integer.valueOf(getValue()); } /** ! * Sets the value of this object as a {@code Number}. * ! * @return {@code true} if the value was set */ public boolean setCurrentAccessibleValue(Number n) { // TIGER- 4422535 if (n == null) { return false;
< prev index next >