< prev index next >

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

Print this page

        

*** 44,54 **** * at the points that match integer values within the specified interval. * <p> * The slider can show both * major tick marks, and minor tick marks between the major ones. The number of * values between the tick marks is controlled with ! * <code>setMajorTickSpacing</code> and <code>setMinorTickSpacing</code>. * Painting of tick marks is controlled by {@code setPaintTicks}. * <p> * Sliders can also print text labels at regular intervals (or at * arbitrary locations) along the slider track. Painting of labels is * controlled by {@code setLabelTable} and {@code setPaintLabels}. --- 44,54 ---- * at the points that match integer values within the specified interval. * <p> * The slider can show both * major tick marks, and minor tick marks between the major ones. The number of * values between the tick marks is controlled with ! * {@code setMajorTickSpacing} and {@code setMinorTickSpacing}. * Painting of tick marks is controlled by {@code setPaintTicks}. * <p> * Sliders can also print text labels at regular intervals (or at * arbitrary locations) along the slider track. Painting of labels is * controlled by {@code setLabelTable} and {@code setPaintLabels}.
*** 67,77 **** * 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}. * * @beaninfo * attribute: isContainer false * description: A component that supports selecting a integer value from a range. --- 67,77 ---- * 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}. * * @beaninfo * attribute: isContainer false * description: A component that supports selecting a integer value from a range.
*** 156,166 **** */ protected ChangeListener changeListener = createChangeListener(); /** ! * Only one <code>ChangeEvent</code> is needed per slider instance since the * event's only (read-only) state is the source property. The source * of events generated here is always "this". The event is lazily * created the first time that an event notification is fired. * * @see #fireStateChanged --- 156,166 ---- */ protected ChangeListener changeListener = createChangeListener(); /** ! * Only one {@code ChangeEvent} is needed per slider instance since the * event's only (read-only) state is the source property. The source * of events generated here is always "this". The event is lazily * created the first time that an event notification is fired. * * @see #fireStateChanged
*** 190,201 **** /** * Creates a slider using the specified orientation with the * range {@code 0} to {@code 100} and an initial value of {@code 50}. * The orientation can be ! * either <code>SwingConstants.VERTICAL</code> or ! * <code>SwingConstants.HORIZONTAL</code>. * * @param orientation the orientation of the slider * @throws IllegalArgumentException if orientation is not one of {@code VERTICAL}, {@code HORIZONTAL} * @see #setOrientation */ --- 190,201 ---- /** * Creates a slider using the specified orientation with the * range {@code 0} to {@code 100} and an initial value of {@code 50}. * The orientation can be ! * either {@code SwingConstants.VERTICAL} or ! * {@code SwingConstants.HORIZONTAL}. * * @param orientation the orientation of the slider * @throws IllegalArgumentException if orientation is not one of {@code VERTICAL}, {@code HORIZONTAL} * @see #setOrientation */
*** 206,216 **** /** * Creates a horizontal slider using the specified min and max * with an initial value equal to the average of the min plus max. * <p> ! * The <code>BoundedRangeModel</code> that holds the slider's data * handles any issues that may arise from improperly setting the * minimum and maximum values on the slider. See the * {@code BoundedRangeModel} documentation for details. * * @param min the minimum value of the slider --- 206,216 ---- /** * Creates a horizontal slider using the specified min and max * with an initial value equal to the average of the min plus max. * <p> ! * The {@code BoundedRangeModel} that holds the slider's data * handles any issues that may arise from improperly setting the * minimum and maximum values on the slider. See the * {@code BoundedRangeModel} documentation for details. * * @param min the minimum value of the slider
*** 226,236 **** /** * Creates a horizontal slider using the specified min, max and value. * <p> ! * The <code>BoundedRangeModel</code> that holds the slider's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the slider. See the * {@code BoundedRangeModel} documentation for details. * * @param min the minimum value of the slider --- 226,236 ---- /** * Creates a horizontal slider using the specified min, max and value. * <p> ! * The {@code BoundedRangeModel} that holds the slider's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the slider. See the * {@code BoundedRangeModel} documentation for details. * * @param min the minimum value of the slider
*** 249,262 **** /** * Creates a slider with the specified orientation and the * specified minimum, maximum, and initial values. * The orientation can be ! * either <code>SwingConstants.VERTICAL</code> or ! * <code>SwingConstants.HORIZONTAL</code>. * <p> ! * The <code>BoundedRangeModel</code> that holds the slider's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the slider. See the * {@code BoundedRangeModel} documentation for details. * * @param orientation the orientation of the slider --- 249,262 ---- /** * Creates a slider with the specified orientation and the * specified minimum, maximum, and initial values. * The orientation can be ! * either {@code SwingConstants.VERTICAL} or ! * {@code SwingConstants.HORIZONTAL}. * <p> ! * The {@code BoundedRangeModel} that holds the slider's data * handles any issues that may arise from improperly setting the * minimum, initial, and maximum values on the slider. See the * {@code BoundedRangeModel} documentation for details. * * @param orientation the orientation of the slider
*** 361,371 **** /** * Subclasses that want to handle {@code ChangeEvent}s * 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 * slider. * --- 361,371 ---- /** * Subclasses that want to handle {@code ChangeEvent}s * 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 * slider. *
*** 404,417 **** listenerList.remove(ChangeListener.class, l); } /** ! * Returns an array of all the <code>ChangeListener</code>s added * to this JSlider with addChangeListener(). * ! * @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); --- 404,417 ---- listenerList.remove(ChangeListener.class, l); } /** ! * Returns an array of all the {@code ChangeListener}s added * to this JSlider with 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);
*** 462,472 **** * fundamental properties: minimum, maximum, value. *<p> * Attempts to pass a {@code null} model to this method result in * undefined behavior, and, most likely, exceptions. * ! * @param newModel the new, {@code non-null} <code>BoundedRangeModel</code> to use * * @see #getModel * @see BoundedRangeModel * @beaninfo * bound: true --- 462,472 ---- * fundamental properties: minimum, maximum, value. *<p> * Attempts to pass a {@code null} model to this method result in * undefined behavior, and, most likely, exceptions. * ! * @param newModel the new, {@code non-null BoundedRangeModel} to use * * @see #getModel * @see BoundedRangeModel * @beaninfo * bound: true
*** 548,558 **** } /** * Returns the minimum value supported by the slider ! * from the <code>BoundedRangeModel</code>. * * @return the value of the model's minimum property * @see #setMinimum * @see BoundedRangeModel#getMinimum */ --- 548,558 ---- } /** * Returns the minimum value supported by the slider ! * from the {@code BoundedRangeModel}. * * @return the value of the model's minimum property * @see #setMinimum * @see BoundedRangeModel#getMinimum */
*** 589,599 **** } /** * Returns the maximum value supported by the slider ! * from the <code>BoundedRangeModel</code>. * * @return the value of the model's maximum property * @see #setMaximum * @see BoundedRangeModel#getMaximum */ --- 589,599 ---- } /** * Returns the maximum value supported by the slider ! * from the {@code BoundedRangeModel}. * * @return the value of the model's maximum property * @see #setMaximum * @see BoundedRangeModel#getMaximum */
*** 668,678 **** } } /** ! * Returns the "extent" from the <code>BoundedRangeModel</code>. * This represents the range of values "covered" by the knob. * * @return an int representing the extent * @see #setExtent * @see BoundedRangeModel#getExtent --- 668,678 ---- } } /** ! * Returns the "extent" from the {@code BoundedRangeModel}. * This represents the range of values "covered" by the knob. * * @return an int representing the extent * @see #setExtent * @see BoundedRangeModel#getExtent
*** 795,805 **** } /** * Returns the dictionary of what labels to draw at which values. * ! * @return the <code>Dictionary</code> containing labels and * where to draw them */ @SuppressWarnings("rawtypes") public Dictionary getLabelTable() { /* --- 795,805 ---- } /** * Returns the dictionary of what labels to draw at which values. * ! * @return the {@code Dictionary} containing labels and * where to draw them */ @SuppressWarnings("rawtypes") public Dictionary getLabelTable() { /*
*** 812,822 **** /** * Used to specify what label will be drawn at any given value. * The key-value pairs are of this format: ! * <code>{ Integer value, java.swing.JComponent label }</code>. * <p> * An easy way to generate a standard table of value labels is by using the * {@code createStandardLabels} method. * <p> * Once the labels have been set, this method calls {@link #updateLabelUIs}. --- 812,822 ---- /** * Used to specify what label will be drawn at any given value. * The key-value pairs are of this format: ! * {@code { Integer value, java.swing.JComponent label }}. * <p> * An easy way to generate a standard table of value labels is by using the * {@code createStandardLabels} method. * <p> * Once the labels have been set, this method calls {@link #updateLabelUIs}.
*** 885,895 **** /** * Creates a {@code Hashtable} of numerical text labels, starting at the * slider minimum, and using the increment specified. ! * For example, if you call <code>createStandardLabels( 10 )</code> * and the slider minimum is zero, * then labels will be created for the values 0, 10, 20, 30, and so on. * <p> * For the labels to be drawn on the slider, the returned {@code Hashtable} * must be passed into {@code setLabelTable}, and {@code setPaintLabels} --- 885,895 ---- /** * Creates a {@code Hashtable} of numerical text labels, starting at the * slider minimum, and using the increment specified. ! * For example, if you call {@code createStandardLabels( 10 )} * and the slider minimum is zero, * then labels will be created for the values 0, 10, 20, 30, and so on. * <p> * For the labels to be drawn on the slider, the returned {@code Hashtable} * must be passed into {@code setLabelTable}, and {@code setPaintLabels}
*** 912,922 **** /** * Creates a {@code Hashtable} of numerical text labels, starting at the * starting point specified, and using the increment specified. * For example, if you call ! * <code>createStandardLabels( 10, 2 )</code>, * then labels will be created for the values 2, 12, 22, 32, and so on. * <p> * For the labels to be drawn on the slider, the returned {@code Hashtable} * must be passed into {@code setLabelTable}, and {@code setPaintLabels} * must be set to {@code true}. --- 912,922 ---- /** * Creates a {@code Hashtable} of numerical text labels, starting at the * starting point specified, and using the increment specified. * For example, if you call ! * {@code createStandardLabels( 10, 2 )}, * then labels will be created for the values 2, 12, 22, 32, and so on. * <p> * For the labels to be drawn on the slider, the returned {@code Hashtable} * must be passed into {@code setLabelTable}, and {@code setPaintLabels} * must be set to {@code true}.
*** 1049,1063 **** /** * Specify true to reverse the value-range shown for the slider and false to * put the value range in the normal order. The order depends on the ! * slider's <code>ComponentOrientation</code> property. Normal (non-inverted) ! * horizontal sliders with a <code>ComponentOrientation</code> value of ! * <code>LEFT_TO_RIGHT</code> have their maximum on the right. ! * Normal horizontal sliders with a <code>ComponentOrientation</code> value of ! * <code>RIGHT_TO_LEFT</code> have their maximum on the left. Normal vertical * sliders have their maximum on the top. These labels are reversed when the * slider is inverted. * <p> * By default, the value of this property is {@code false}. * --- 1049,1063 ---- /** * Specify true to reverse the value-range shown for the slider and false to * put the value range in the normal order. The order depends on the ! * slider's {@code ComponentOrientation} property. Normal (non-inverted) ! * horizontal sliders with a {@code ComponentOrientation} value of ! * {@code LEFT_TO_RIGHT} have their maximum on the right. ! * Normal horizontal sliders with a {@code ComponentOrientation} value of ! * {@code RIGHT_TO_LEFT} have their maximum on the left. Normal vertical * sliders have their maximum on the top. These labels are reversed when the * slider is inverted. * <p> * By default, the value of this property is {@code false}. *
*** 1374,1384 **** /** * Returns a string representation of this JSlider. This method * is intended to be used only for debugging purposes, and 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 JSlider. */ protected String paramString() { String paintTicksString = (paintTicks ? --- 1374,1384 ---- /** * Returns a string representation of this JSlider. This method * is intended to be used only for debugging purposes, and 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 JSlider. */ protected String paramString() { String paintTicksString = (paintTicks ?
*** 1429,1448 **** return accessibleContext; } /** * This class implements accessibility support for the ! * <code>JSlider</code> class. It provides an implementation of the * Java Accessibility API appropriate to slider 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 AccessibleJSlider extends AccessibleJComponent implements AccessibleValue { --- 1429,1448 ---- return accessibleContext; } /** * This class implements accessibility support for the ! * {@code JSlider} class. It provides an implementation of the * Java Accessibility API appropriate to slider 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 AccessibleJSlider extends AccessibleJComponent implements AccessibleValue {
< prev index next >