~ubuntu-branches/ubuntu/precise/classpath/precise

« back to all changes in this revision

Viewing changes to javax/swing/JSlider.java

  • Committer: Bazaar Package Importer
  • Author(s): Michael Koch
  • Date: 2006-05-27 16:11:15 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060527161115-h6e39eposdt5snb6
Tags: 2:0.91-3
* Install header files to /usr/include/classpath.
* debian/control: classpath: Conflict with jamvm < 1.4.3 and
  cacao < 0.96 (Closes: #368172).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* JSlider.java --
2
 
   Copyright (C) 2002, 2004, 2005  Free Software Foundation, Inc.
 
2
   Copyright (C) 2002, 2004, 2005, 2006,  Free Software Foundation, Inc.
3
3
 
4
4
This file is part of GNU Classpath.
5
5
 
50
50
import javax.accessibility.Accessible;
51
51
import javax.accessibility.AccessibleContext;
52
52
import javax.accessibility.AccessibleRole;
 
53
import javax.accessibility.AccessibleState;
53
54
import javax.accessibility.AccessibleStateSet;
54
55
import javax.accessibility.AccessibleValue;
55
56
import javax.swing.event.ChangeEvent;
57
58
import javax.swing.plaf.SliderUI;
58
59
 
59
60
/**
60
 
 * The JSlider is a Swing component that allows selection of a value within a
 
61
 * A visual component that allows selection of a value within a
61
62
 * range by adjusting a thumb in a track. The values for the minimum,
62
63
 * maximum, extent and value are stored in a {@link
63
64
 * DefaultBoundedRangeModel}.
64
 
 * 
65
65
 * <p>
66
 
 * JSliders have the following properties:
 
66
 * A <code>JSlider</code> component has the following properties:
67
67
 * </p>
68
68
 * 
69
69
 * <table>
72
72
 * <tr><td> inverted         </td><td> slider    </td><td> yes    </td></tr>
73
73
 * <tr><td> labelTable       </td><td> slider    </td><td> yes    </td></tr>
74
74
 * <tr><td> majorTickSpacing </td><td> slider    </td><td> yes    </td></tr> 
75
 
 * <tr><td> maximum          </td><td> model     </td><td> no     </td></tr>
76
 
 * <tr><td> minimum          </td><td> model     </td><td> no     </td></tr>
 
75
 * <tr><td> maximum          </td><td> model     </td><td> yes     </td></tr>
 
76
 * <tr><td> minimum          </td><td> model     </td><td> yes     </td></tr>
77
77
 * <tr><td> minorTickSpacing </td><td> slider    </td><td> yes    </td></tr>
78
78
 * <tr><td> model            </td><td> slider    </td><td> yes    </td></tr> 
79
79
 * <tr><td> orientation      </td><td> slider    </td><td> yes    </td></tr>
80
80
 * <tr><td> paintLabels      </td><td> slider    </td><td> yes    </td></tr>
81
81
 * <tr><td> paintTicks       </td><td> slider    </td><td> yes    </td></tr>
82
 
 * <tr><td> snapToTicks      </td><td> slider    </td><td> no     </td></tr>
 
82
 * <tr><td> snapToTicks      </td><td> slider    </td><td> yes     </td></tr>
83
83
 * <tr><td> value            </td><td> model     </td><td> no     </td></tr>
84
84
 * <tr><td> valueIsAdjusting </td><td> model     </td><td> no     </td></tr>
85
85
 * </table>
86
86
 * 
87
87
 * <p>
88
 
 * The various behavioral aspects of these properties follows:
 
88
 * The various behavioural aspects of these properties follows:
89
89
 * </p>
90
90
 * 
91
91
 * <ul>
92
92
 * <li>
93
 
 * When non-bound properties stored in the slider change, the slider fires
94
 
 * ChangeEvents to its ChangeListeners.
95
 
 * </li>
96
 
 * <li>
97
 
 * When bound properties stored in the slider change, the slider fires
98
 
 * PropertyChangeEvents to its PropertyChangeListeners
99
 
 * </li>
100
 
 * <li>
101
 
 * If any of the model's properties change, it fires a ChangeEvent to its
102
 
 * ChangeListeners, which include the slider.
103
 
 * </li>
104
 
 * <li>
105
 
 * If the slider receives a ChangeEvent from its model, it will propagate the
106
 
 * ChangeEvent to its ChangeListeners, with the ChangeEvent's "source"
 
93
 * When a non-bound property stored in the slider changes, the slider fires
 
94
 * a {@link ChangeEvent} to its change listeners.
 
95
 * </li>
 
96
 * <li>
 
97
 * When a bound property stored in the slider changes, the slider fires a
 
98
 * {@link PropertyChangeEvent} to its property change listeners.
 
99
 * </li>
 
100
 * <li>
 
101
 * If any of the model's properties change, it fires a {@link ChangeEvent} to 
 
102
 * its listeners, which include the slider.
 
103
 * </li>
 
104
 * <li>
 
105
 * If the slider receives a {@link ChangeEvent} from its model, it will 
 
106
 * propagate the event to its own change listeners, with the event's "source"
107
107
 * property set to refer to the slider, rather than the model.
108
108
 * </li>
109
109
 * </ul>
112
112
                                                   ImageObserver,
113
113
                                                   MenuContainer, Serializable
114
114
{
115
 
  /** DOCUMENT ME! */
116
115
  private static final long serialVersionUID = -1441275936141218479L;
117
116
 
118
117
  /**
119
 
   * DOCUMENT ME!
 
118
   * Provides the accessibility features for the <code>JSlider</code>
 
119
   * component.
120
120
   */
121
 
  // FIXME: This inner class is a complete stub and needs to be implemented
122
 
  // properly.
123
121
  protected class AccessibleJSlider extends JComponent.AccessibleJComponent
124
122
    implements AccessibleValue
125
123
  {
126
124
    private static final long serialVersionUID = -6301740148041106789L;
127
125
  
128
126
    /**
129
 
     * Creates a new AccessibleJSlider object.
 
127
     * Creates a new <code>AccessibleJSlider</code> instance.
130
128
     */
131
129
    protected AccessibleJSlider()
132
130
    {
134
132
    }
135
133
 
136
134
    /**
137
 
     * DOCUMENT ME!
 
135
     * Returns a set containing the current state of the {@link JSlider} 
 
136
     * component.
138
137
     *
139
 
     * @return DOCUMENT ME!
 
138
     * @return The accessible state set.
140
139
     */
141
140
    public AccessibleStateSet getAccessibleStateSet()
142
141
    {
143
 
      return null;
 
142
      AccessibleStateSet result = super.getAccessibleStateSet();
 
143
      if (orientation == JSlider.HORIZONTAL)
 
144
        result.add(AccessibleState.HORIZONTAL);
 
145
      else if (orientation == JSlider.VERTICAL)
 
146
        result.add(AccessibleState.VERTICAL);
 
147
      return result;
144
148
    }
145
149
 
146
150
    /**
147
 
     * DOCUMENT ME!
 
151
     * Returns the accessible role for the <code>JSlider</code> component.
148
152
     *
149
 
     * @return DOCUMENT ME!
 
153
     * @return {@link AccessibleRole#SLIDER}.
150
154
     */
151
155
    public AccessibleRole getAccessibleRole()
152
156
    {
153
 
      return null;
 
157
      return AccessibleRole.SLIDER;
154
158
    }
155
159
 
156
160
    /**
157
 
     * DOCUMENT ME!
 
161
     * Returns an object that provides access to the current, minimum and 
 
162
     * maximum values for the {@link JSlider}.  Since this class implements 
 
163
     * {@link AccessibleValue}, it returns itself.
158
164
     *
159
 
     * @return DOCUMENT ME!
 
165
     * @return The accessible value.
160
166
     */
161
167
    public AccessibleValue getAccessibleValue()
162
168
    {
163
 
      return null;
 
169
      return this;
164
170
    }
165
171
 
166
172
    /**
167
 
     * DOCUMENT ME!
 
173
     * Returns the current value of the {@link JSlider} component, as an
 
174
     * {@link Integer}.
168
175
     *
169
 
     * @return DOCUMENT ME!
 
176
     * @return The current value of the {@link JSlider} component.
170
177
     */
171
178
    public Number getCurrentAccessibleValue()
172
179
    {
173
 
      return null;
 
180
      return new Integer(getValue());
174
181
    }
175
182
 
176
183
    /**
177
 
     * setCurrentAccessibleValue
178
 
     *
179
 
     * @param value0 TODO
180
 
     *
181
 
     * @return boolean
 
184
     * Sets the current value of the {@link JSlider} component and sends a
 
185
     * {@link PropertyChangeEvent} (with the property name 
 
186
     * {@link AccessibleContext#ACCESSIBLE_VALUE_PROPERTY}) to all registered
 
187
     * listeners.  If the supplied value is <code>null</code>, this method 
 
188
     * does nothing and returns <code>false</code>.
 
189
     *
 
190
     * @param value  the new slider value (<code>null</code> permitted).
 
191
     *
 
192
     * @return <code>true</code> if the slider value is updated, and 
 
193
     *     <code>false</code> otherwise.
182
194
     */
183
 
    public boolean setCurrentAccessibleValue(Number value0)
 
195
    public boolean setCurrentAccessibleValue(Number value)
184
196
    {
185
 
      return false;
 
197
      if (value == null)
 
198
        return false;
 
199
      Number oldValue = getCurrentAccessibleValue();
 
200
      setValue(value.intValue());
 
201
      firePropertyChange(AccessibleContext.ACCESSIBLE_VALUE_PROPERTY, oldValue, 
 
202
                         new Integer(getValue()));
 
203
      return true;
186
204
    }
187
205
 
188
206
    /**
189
 
     * getMinimumAccessibleValue
 
207
     * Returns the minimum value of the {@link JSlider} component, as an
 
208
     * {@link Integer}.
190
209
     *
191
 
     * @return Number
 
210
     * @return The minimum value of the {@link JSlider} component.
192
211
     */
193
212
    public Number getMinimumAccessibleValue()
194
213
    {
195
 
      return null;
 
214
      return new Integer(getMinimum());
196
215
    }
197
216
 
198
217
    /**
199
 
     * getMaximumAccessibleValue
 
218
     * Returns the maximum value of the {@link JSlider} component, as an
 
219
     * {@link Integer}.
200
220
     *
201
 
     * @return Number
 
221
     * @return The maximum value of the {@link JSlider} component.
202
222
     */
203
223
    public Number getMaximumAccessibleValue()
204
224
    {
205
 
      return null;
 
225
      return new Integer(getMaximum());
206
226
    }
207
227
  }
208
228
 
221
241
   */
222
242
  private transient Dictionary labelTable;
223
243
 
224
 
  /** The model used to describe the slider. */
 
244
  /** The model used to store the slider's range and current value. */
225
245
  protected BoundedRangeModel sliderModel;
226
246
 
227
 
  /** The space between major ticks. */
 
247
  /** The space/distance between major ticks. */
228
248
  protected int majorTickSpacing;
229
249
 
230
 
  /** The space between minor ticks. */
 
250
  /** The space/distance between minor ticks. */
231
251
  protected int minorTickSpacing;
232
252
 
233
253
  /** Whether the slider snaps its values to ticks. */
234
254
  protected boolean snapToTicks = false;
235
255
 
236
 
  /** The orientation of the slider. */
 
256
  /** The orientation (horizontal or vertical) of the slider. */
237
257
  protected int orientation = HORIZONTAL;
238
258
 
239
259
  /** Whether the slider is inverted. */
240
260
  private transient boolean isInverted;
241
261
 
242
 
  /** The ChangeListener that listens to the model. */
 
262
  /** 
 
263
   * The listener that monitors the slider's model and forwards events to the
 
264
   * slider's listeners (see <code>createChangeListener()</code>). 
 
265
   */
243
266
  protected ChangeListener changeListener;
244
267
 
245
 
  /** The ChangeEvent that is passed to all listeners of this slider. */
 
268
  /** The change event that is passed to all listeners of this slider. */
246
269
  protected transient ChangeEvent changeEvent;
247
270
 
248
271
  /**
249
 
   * Creates a new horizontal JSlider object with a minimum of 0, a maximum of
250
 
   * 100, and a value of 50.
 
272
   * Creates a new horizontal <code>JSlider</code> instance with a minimum of 
 
273
   * 0, a maximum of 100, and a value of 50.
251
274
   */
252
275
  public JSlider()
253
276
  {
255
278
  }
256
279
 
257
280
  /**
258
 
   * Creates a new JSlider object with the given orientation and a minimum of
259
 
   * 0, a maximum of 100, and a value of 50.
 
281
   * Creates a new <code>JSlider</code> instance with the given orientation 
 
282
   * and a minimum of 0, a maximum of 100, and a value of 50.
260
283
   *
261
284
   * @param orientation The orientation of the slider ({@link #HORIZONTAL} or
262
285
   *                    {@link #VERTICAL}).
270
293
  }
271
294
 
272
295
  /**
273
 
   * Creates a new horizontal JSlider object with the given maximum and
274
 
   * minimum and a value that is  halfway between the minimum and the
 
296
   * Creates a new horizontal <code>JSlider</code> instance with the given 
 
297
   * maximum and minimum and a value that is halfway between the minimum and the
275
298
   * maximum.
276
299
   *
277
 
   * @param minimum The minimum value of the JSlider.
278
 
   * @param maximum The maximum value of the JSlider.
 
300
   * @param minimum The minimum value.
 
301
   * @param maximum The maximum value.
 
302
   * 
 
303
   * @throws IllegalArgumentException if <code>minimum</code> is greater than
 
304
   *     <code>maximum</code>.
279
305
   */
280
306
  public JSlider(int minimum, int maximum)
281
307
  {
283
309
  }
284
310
 
285
311
  /**
286
 
   * Creates a new horizontal JSlider object with the given minimum, maximum,
287
 
   * and value.
 
312
   * Creates a new horizontal <code>JSlider</code> instance with the given 
 
313
   * minimum, maximum, and value.
288
314
   *
289
 
   * @param minimum The minimum value of the JSlider.
290
 
   * @param maximum The maximum value of the JSlider.
291
 
   * @param value The initial value of the JSlider.
 
315
   * @param minimum The minimum value.
 
316
   * @param maximum The maximum value.
 
317
   * @param value The initial value.
 
318
   * 
 
319
   * @throws IllegalArgumentException if <code>value</code> is not in the 
 
320
   *     specified range.
 
321
   * @throws IllegalArgumentException if <code>minimum</code> is greater than
 
322
   *     <code>maximum</code>.
292
323
   */
293
324
  public JSlider(int minimum, int maximum, int value)
294
325
  {
296
327
  }
297
328
 
298
329
  /**
299
 
   * Creates a new JSlider object with the given orientation, minimum,
300
 
   * maximum, and value.
 
330
   * Creates a new <code>JSlider</code> instance with the given orientation, 
 
331
   * minimum, maximum, and value.
301
332
   *
302
333
   * @param orientation The orientation of the slider ({@link #HORIZONTAL} or
303
334
   *                    {@link #VERTICAL}).
306
337
   * @param value The initial value of the JSlider.
307
338
   * 
308
339
   * @throws IllegalArgumentException if <code>orientation</code> is not one of
309
 
   *         the specified values.
 
340
   *     the specified values.
 
341
   * @throws IllegalArgumentException if <code>value</code> is not in the 
 
342
   *     specified range.
 
343
   * @throws IllegalArgumentException if <code>minimum</code> is greater than
 
344
   *     <code>maximum</code>.
310
345
   */
311
346
  public JSlider(int orientation, int minimum, int maximum, int value)
312
347
  {
313
348
    sliderModel = new DefaultBoundedRangeModel(value, 0, minimum, maximum);
314
349
    if (orientation != HORIZONTAL && orientation != VERTICAL)
315
 
      throw new IllegalArgumentException(orientation + " is not a legal orientation");
 
350
      throw new IllegalArgumentException(orientation 
 
351
                                         + " is not a legal orientation");
316
352
    this.orientation = orientation;
317
353
    changeListener = createChangeListener();
318
354
    sliderModel.addChangeListener(changeListener);
320
356
  }
321
357
 
322
358
  /**
323
 
   * Creates a new horizontal JSlider object with the given model.
 
359
   * Creates a new horizontal <code>JSlider</code> instance with the given 
 
360
   * model.
324
361
   *
325
362
   * @param model The model (<code>null</code> not permitted).
326
363
   * 
335
372
  }
336
373
 
337
374
  /**
338
 
   * This method returns the current value of the slider.
 
375
   * Returns the slider's value (from the slider's model).
339
376
   *
340
 
   * @return The value of the slider stored in the model.
 
377
   * @return The value of the slider.
 
378
   * 
 
379
   * @see #setValue(int)
341
380
   */
342
381
  public int getValue()
343
382
  {
345
384
  }
346
385
 
347
386
  /**
348
 
   * This method sets the value of the slider.
 
387
   * Sets the slider's value and sends a {@link ChangeEvent} to all 
 
388
   * registered listeners.  Note that the model will fire a change event to all
 
389
   * of its registered listeners first (with the model as the event source) and
 
390
   * then the slider will fire another change event to all of its registered
 
391
   * listeners (this time with the slider as the event source).
349
392
   *
350
 
   * @param value The slider's new value.
 
393
   * @param value  the new value.
 
394
   * 
 
395
   * @see #getValue()
351
396
   */
352
397
  public void setValue(int value)
353
398
  {
355
400
  }
356
401
 
357
402
  /**
358
 
   * This method returns the slider's UI delegate.
 
403
   * Returns the slider's UI delegate.
359
404
   *
360
405
   * @return The slider's UI delegate.
361
406
   */
365
410
  }
366
411
 
367
412
  /**
368
 
   * This method sets the slider's UI delegate.
 
413
   * Sets the slider's UI delegate.
369
414
   *
370
 
   * @param ui A SliderUI object to use with this slider.
 
415
   * @param ui  the UI delegate.
371
416
   */
372
417
  public void setUI(SliderUI ui)
373
418
  {
375
420
  }
376
421
 
377
422
  /**
378
 
   * This method sets this slider's UI to the UIManager's default for the
379
 
   * current look and feel.
 
423
   * Sets this slider's UI delegate to the default (obtained from the
 
424
   * {@link UIManager}) for the current look and feel.
380
425
   */
381
426
  public void updateUI()
382
427
  {
383
428
    setUI((SliderUI) UIManager.getUI(this));
384
 
    invalidate();
385
 
    repaint();
386
429
  }
387
430
 
388
431
  /**
389
 
   * This method returns a name to identify which look and feel class will be
390
 
   * the UI delegate for the slider.
 
432
   * Returns the suffix (<code>"SliderUI"</code> in this case) used to 
 
433
   * determine the class name for a UI delegate that can provide the look and 
 
434
   * feel for a <code>JSlider</code>.
391
435
   *
392
 
   * @return The Look and Feel classID. "SliderUI"
 
436
   * @return <code>"SliderUI"</code>.
393
437
   */
394
438
  public String getUIClassID()
395
439
  {
397
441
  }
398
442
 
399
443
  /**
400
 
   * Creates a ChangeListener for this Slider.
 
444
   * Creates a {@link ChangeListener} that is added to the slider's model and
 
445
   * forwards change events generated by the model to the listeners that are
 
446
   * registered with the <code>JSlider</code> (by calling the 
 
447
   * {@link #fireStateChanged} method).
401
448
   *
402
 
   * @return A new ChangeListener.
 
449
   * @return A new listener.
403
450
   */
404
451
  protected ChangeListener createChangeListener()
405
452
  {
406
453
    return new ChangeListener()
407
454
      {
408
 
        public void stateChanged(ChangeEvent ce)
409
 
        {
410
 
          // No need to trigger a repaint since the UI listens to the model
411
 
          // as well. All we need to do is pass on the stateChanged event 
412
 
          // to our listeners.
413
 
          fireStateChanged();
414
 
        }
 
455
        public void stateChanged(ChangeEvent ce)
 
456
        {
 
457
          // No need to trigger a repaint since the UI listens to the model
 
458
          // as well. All we need to do is pass on the stateChanged event 
 
459
          // to our listeners.
 
460
          fireStateChanged();
 
461
        }
415
462
      };
416
463
  }
417
464
 
418
465
  /**
419
 
   * This method registers a listener to this slider. The listener will be
420
 
   * informed of new ChangeEvents.
 
466
   * Registers a listener with the slider so that it will receive 
 
467
   * {@link ChangeEvent} notifications.  Note that change events generated
 
468
   * by the slider's model will be forwarded automatically to the slider's
 
469
   * listeners.
421
470
   *
422
 
   * @param listener The listener to register.
 
471
   * @param listener  the listener to register.
 
472
   * 
 
473
   * @see #removeChangeListener(ChangeListener)
423
474
   */
424
475
  public void addChangeListener(ChangeListener listener)
425
476
  {
427
478
  }
428
479
 
429
480
  /**
430
 
   * This method removes a listener from this slider.
 
481
   * Removes a listener from this slider so that it will no longer receive
 
482
   * {@link ChangeEvent} notifications from the slider.
431
483
   *
432
484
   * @param listener The listener to remove.
 
485
   * 
 
486
   * @see #addChangeListener(ChangeListener)
433
487
   */
434
488
  public void removeChangeListener(ChangeListener listener)
435
489
  {
437
491
  }
438
492
 
439
493
  /**
440
 
   * This method is called whenever the model fires a ChangeEvent. It should
441
 
   * propagate the ChangeEvent to its listeners with a new ChangeEvent that
442
 
   * identifies the slider as the source.
 
494
   * Sends a {@link ChangeEvent} to all registered listeners, with this slider 
 
495
   * as the source.
443
496
   */
444
497
  protected void fireStateChanged()
445
498
  {
448
501
      changeEvent = new ChangeEvent(this);
449
502
    for (int i = changeListeners.length - 2; i >= 0; i -= 2)
450
503
      {
451
 
        if (changeListeners[i] == ChangeListener.class)
452
 
          ((ChangeListener) changeListeners[i + 1]).stateChanged(changeEvent);
 
504
        if (changeListeners[i] == ChangeListener.class)
 
505
          ((ChangeListener) changeListeners[i + 1]).stateChanged(changeEvent);
453
506
      }
454
507
  }
455
508
 
456
509
  /**
457
 
   * This method returns an array of all ChangeListeners listening to this
458
 
   * slider.
 
510
   * Returns an array containing all the {@link ChangeListener} instances 
 
511
   * registered with this slider.  If no listeners are registered, this method
 
512
   * returns an empty array.
459
513
   *
460
 
   * @return An array of ChangeListeners listening to this slider.
 
514
   * @return An array array containing all the {@link ChangeListener} instances 
 
515
   *     registered with this slider (possibly empty, but never 
 
516
   *     <code>null</code>).
461
517
   */
462
518
  public ChangeListener[] getChangeListeners()
463
519
  {
465
521
  }
466
522
 
467
523
  /**
468
 
   * This method returns the model of the slider.
 
524
   * Returns the slider's model, which stores the minimum, maximum and current 
 
525
   * values.
469
526
   *
470
527
   * @return The slider's model.
 
528
   * 
 
529
   * @see #setModel(BoundedRangeModel)
471
530
   */
472
531
  public BoundedRangeModel getModel()
473
532
  {
475
534
  }
476
535
 
477
536
  /**
478
 
   * This method changes the "model" property. It also needs  to unregister
479
 
   * any listeners to the old model and register any listeners to the new
480
 
   * model.
 
537
   * Sets the slider's model and sends a {@link PropertyChangeEvent} (with the
 
538
   * property name "model") to all registered listeners.   The change listener
 
539
   * that the slider registered with the original model is removed and added
 
540
   * to the new model (this ensures that {@link ChangeEvent} notifications 
 
541
   * generated by the model are automatically forwarded to listeners that are
 
542
   * registered with the slider).
481
543
   *
482
544
   * @param model The model to use with the slider.
 
545
   * 
 
546
   * @see #getModel()
483
547
   */
484
548
  public void setModel(BoundedRangeModel model)
485
549
  {
488
552
    // and bork the next time it tries to access the model.
489
553
    if (model != sliderModel)
490
554
      {
491
 
        BoundedRangeModel oldModel = sliderModel;
492
 
        sliderModel = model;
493
 
        oldModel.removeChangeListener(changeListener);
494
 
        sliderModel.addChangeListener(changeListener);
495
 
        firePropertyChange("model", oldModel, sliderModel);
 
555
        BoundedRangeModel oldModel = sliderModel;
 
556
        sliderModel = model;
 
557
        oldModel.removeChangeListener(changeListener);
 
558
        sliderModel.addChangeListener(changeListener);
 
559
        firePropertyChange("model", oldModel, sliderModel);
496
560
      }
497
561
  }
498
562
 
499
563
  /**
500
 
   * This method returns the minimum value of the slider.
 
564
   * Returns the minimum value of the slider (from the slider's model).
501
565
   *
502
566
   * @return The minimum value of the slider.
 
567
   * 
 
568
   * @see #setMinimum(int)
503
569
   */
504
570
  public int getMinimum()
505
571
  {
507
573
  }
508
574
 
509
575
  /**
510
 
   * This method sets the minimum value of the slider.
511
 
   *
 
576
   * Sets the minimum value of the slider and fires a 
 
577
   * {@link PropertyChangeEvent} (with the property name "minimum") to all
 
578
   * registered listeners.  Note that:
 
579
   * <p>
 
580
   * <ul>
 
581
   * <li>the minimum value is stored in the slider's model (see 
 
582
   *     {@link #getModel()});</li>
 
583
   * <li>in addition to the property change event, the slider also fires a 
 
584
   *     {@link ChangeEvent}.</li>
 
585
   * </ul>
 
586
   * 
512
587
   * @param minimum The minimum value of the slider.
 
588
   * 
 
589
   * @see #getMinimum()
513
590
   */
514
591
  public void setMinimum(int minimum)
515
592
  {
520
597
  }
521
598
 
522
599
  /**
523
 
   * This method returns the maximum value of the slider.
 
600
   * Returns the slider's maximum value (obtained from the slider's model).
524
601
   *
525
602
   * @return The maximum value of the slider.
 
603
   * 
 
604
   * @see #setMaximum(int)
526
605
   */
527
606
  public int getMaximum()
528
607
  {
530
609
  }
531
610
 
532
611
  /**
533
 
   * This method sets the maximum value of the slider.
 
612
   * Sets the maximum value of the slider and fires a 
 
613
   * {@link PropertyChangeEvent} (with the property name "maximum") to all
 
614
   * registered listeners.  Note that:
 
615
   * <p>
 
616
   * <ul>
 
617
   * <li>the maximum value is stored in the slider's model (see 
 
618
   *     {@link #getModel()});</li>
 
619
   * <li>in addition to the property change event, the slider also fires a 
 
620
   *     {@link ChangeEvent}.</li>
 
621
   * </ul>
534
622
   *
535
623
   * @param maximum The maximum value of the slider.
 
624
   * 
 
625
   * @see #getMaximum()
536
626
   */
537
627
  public void setMaximum(int maximum)
538
628
  {
543
633
  }
544
634
 
545
635
  /**
546
 
   * This method returns this slider's isAdjusting value which is true if the
547
 
   * thumb is being dragged.
 
636
   * Returns the <code>valueIsAdjusting</code> flag from the slider's model.
548
637
   *
549
 
   * @return The slider's isAdjusting value.
 
638
   * @return The <code>valueIsAdjusting</code> flag from the slider's model.
 
639
   * 
 
640
   * @see #setValueIsAdjusting(boolean)
550
641
   */
551
642
  public boolean getValueIsAdjusting()
552
643
  {
554
645
  }
555
646
 
556
647
  /**
557
 
   * This method sets the isAdjusting value for the slider.
 
648
   * Sets the <code>valueIsAdjusting</code> flag in the slider's model, and 
 
649
   * sends a {@link ChangeEvent} to all registered listeners.
558
650
   *
559
 
   * @param adjusting The slider's isAdjusting value.
 
651
   * @param adjusting  the new flag value.
 
652
   * 
 
653
   * @see #getValueIsAdjusting()
560
654
   */
561
655
  public void setValueIsAdjusting(boolean adjusting)
562
656
  {
564
658
  }
565
659
 
566
660
  /**
567
 
   * This method returns the extent value for this slider.
 
661
   * Returns the slider's extent value, obtained from the slider's model.
568
662
   *
569
 
   * @return The extent value for this slider.
 
663
   * @return The extent value.
 
664
   * 
 
665
   * @see #setExtent(int)
570
666
   */
571
667
  public int getExtent()
572
668
  {
574
670
  }
575
671
 
576
672
  /**
577
 
   * This method sets the extent value for this slider.
 
673
   * Sets the slider's extent value and sends a {@link ChangeEvent} to all 
 
674
   * registered listeners.  Note that the model will fire a change event to all
 
675
   * of its registered listeners first (with the model as the event source) and
 
676
   * then the slider will fire another change event to all of its registered
 
677
   * listeners (this time with the slider as the event source).
578
678
   *
579
679
   * @param extent The extent value for this slider.
 
680
   * 
 
681
   * @see #getExtent()
580
682
   */
581
683
  public void setExtent(int extent)
582
684
  {
584
686
  }
585
687
 
586
688
  /**
587
 
   * This method returns the slider orientation.
 
689
   * Returns the orientation of the slider, either {@link JSlider#HORIZONTAL}
 
690
   * or {@link JSlider#VERTICAL}.
588
691
   *
589
692
   * @return The orientation of the slider.
 
693
   * 
 
694
   * @see #setOrientation(int)
590
695
   */
591
696
  public int getOrientation()
592
697
  {
594
699
  }
595
700
 
596
701
  /**
597
 
   * This method changes the "orientation" property of this slider. If the
598
 
   * orientation is not VERTICAL or HORIZONTAL, this method does nothing.
 
702
   * Sets the orientation for the slider and sends a 
 
703
   * {@link PropertyChangeEvent} (with the property name "orientation") to all
 
704
   * registered listeners.
599
705
   *
600
 
   * @param orientation The orientation of this slider.
 
706
   * @param orientation  the orientation (one of {@link JSlider#HORIZONTAL} or
 
707
   *     {@link JSlider#VERTICAL}).
 
708
   *     
 
709
   * @throws IllegalArgumentException if <code>orientation</code> is not one of
 
710
   *     the permitted values.
 
711
   *     
 
712
   * @see #getOrientation()
601
713
   */
602
714
  public void setOrientation(int orientation)
603
715
  {
604
716
    if (orientation != VERTICAL && orientation != HORIZONTAL)
605
 
      throw new IllegalArgumentException("orientation must be one of: VERTICAL, HORIZONTAL");
 
717
      throw new IllegalArgumentException(
 
718
          "orientation must be one of: VERTICAL, HORIZONTAL");
606
719
    if (orientation != this.orientation)
607
720
      {
608
 
        int oldOrientation = this.orientation;
609
 
        this.orientation = orientation;
610
 
        firePropertyChange("orientation", oldOrientation,
611
 
                           this.orientation);
 
721
        int oldOrientation = this.orientation;
 
722
        this.orientation = orientation;
 
723
        firePropertyChange("orientation", oldOrientation, this.orientation);
612
724
      }
613
725
  }
614
726
 
615
727
  /**
616
 
   * This method returns the label table for this slider.
 
728
   * Returns the label table for the slider.
617
729
   *
618
 
   * @return The label table for this slider.
 
730
   * @return The label table for the slider (possibly <code>null</code>).
 
731
   * 
 
732
   * @see #setLabelTable(Dictionary)
619
733
   */
620
734
  public Dictionary getLabelTable()
621
735
  {
623
737
  }
624
738
 
625
739
  /**
626
 
   * This method changes the "labelTable" property of this slider.
 
740
   * Sets the table of labels for the slider and sends a 
 
741
   * {@link PropertyChangeEvent} (with the property name "labelTable") to all 
 
742
   * registered listeners.
627
743
   *
628
 
   * @param table The label table for this slider.
 
744
   * @param table  the table of labels (<code>null</code> permitted).
 
745
   * 
 
746
   * @see #getLabelTable()
629
747
   */
630
748
  public void setLabelTable(Dictionary table)
631
749
  {
632
750
    if (table != labelTable)
633
751
      {
634
 
        Dictionary oldTable = labelTable;
635
 
        labelTable = table;
636
 
        firePropertyChange("labelTable", oldTable, labelTable);
 
752
        Dictionary oldTable = labelTable;
 
753
        labelTable = table;
 
754
        firePropertyChange("labelTable", oldTable, labelTable);
637
755
      }
638
756
  }
639
757
 
640
758
  /**
641
 
   * This method is called to reset UI delegates for the labels in the
642
 
   * labelTable to a default for the current look and feel.
 
759
   * Resets the UI delegates for the labels in the <code>labelTable</code> to 
 
760
   * the default for the current look and feel.
643
761
   */
644
762
  protected void updateLabelUIs()
645
763
  {
647
765
      return;
648
766
    for (Enumeration list = labelTable.elements(); list.hasMoreElements();)
649
767
      {
650
 
        JLabel label = (JLabel) list.nextElement();
651
 
        label.updateUI();
 
768
        JLabel label = (JLabel) list.nextElement();
 
769
        label.updateUI();
652
770
      }
653
771
  }
654
772
 
655
773
  /**
656
 
   * Creates a hashtable of (Integer, JLabel) pairs that can be used as a
657
 
   * label table for this slider. The labels will start from the sliders
658
 
   * minimum and increase by the increment. Each  label will have a text
659
 
   * string indicating their integer value.
 
774
   * Creates a hashtable of <code>(Integer, JLabel)</code> pairs that can be 
 
775
   * used as a label table for this slider. The labels will start from the 
 
776
   * slider's minimum and increase by the increment. Each label will have a text
 
777
   * string indicating its integer value.
660
778
   *
661
779
   * @param increment The increment between labels (must be > 0).
662
780
   *
663
 
   * @return A hashtable with the labels and their keys.
 
781
   * @return A hashtable containing the labels.
664
782
   *
665
783
   * @throws IllegalArgumentException if <code>increment</code> is not greater
666
784
   *         than zero.
671
789
  }
672
790
 
673
791
  /**
674
 
   * Creates a hashtable of (Integer, JLabel) pairs that can be used as a
675
 
   * label table for this slider. The labels will start from the given start
676
 
   * value and increase by the increment. Each  label will have a text string
677
 
   * indicating its integer value.
 
792
   * Creates a hashtable of <code>(Integer, JLabel)</code> pairs that can be 
 
793
   * used as a label table for this slider. The labels will start from the 
 
794
   * given start value and increase by the increment. Each  label will have a 
 
795
   * text string indicating its integer value.
678
796
   *
679
797
   * @param increment The increment between labels (must be > 0).
680
798
   * @param start The value to start from.
699
817
 
700
818
    for (int i = start; i <= max; i += increment)
701
819
      {
702
 
        label = new JLabel(String.valueOf(i));
703
 
        label.setVerticalAlignment(CENTER);
704
 
        label.setHorizontalAlignment(CENTER);
705
 
        
706
 
        // Make sure these labels have the width and height
707
 
        // they want.
708
 
        dim = label.getPreferredSize();
709
 
        label.setBounds(label.getX(), label.getY(),
710
 
                        (int) dim.getWidth(),
711
 
                        (int) dim.getHeight()); 
712
 
        table.put(new Integer(i), label);
 
820
        label = new JLabel(String.valueOf(i));
 
821
        label.setVerticalAlignment(CENTER);
 
822
        label.setHorizontalAlignment(CENTER);
 
823
        
 
824
        // Make sure these labels have the width and height
 
825
        // they want.
 
826
        dim = label.getPreferredSize();
 
827
        label.setBounds(label.getX(), label.getY(),
 
828
                        (int) dim.getWidth(),
 
829
                        (int) dim.getHeight()); 
 
830
        table.put(new Integer(i), label);
713
831
      }
714
832
    return table;
715
833
  }
716
834
 
717
835
  /**
718
 
   * This method returns whether the slider is inverted. Horizontal sliders
719
 
   * that are not inverted will have the minimums on the left. If they are
720
 
   * inverted, the minimums will be  on the right. Vertical sliders that are
721
 
   * not inverted will have the minimums at the bottom. If they are inverted,
722
 
   * the minimums will be at the top.
 
836
   * Returns the flag that controls whether or not the value scale for the
 
837
   * slider is inverted (the default value is <code>false</code>).
723
838
   *
724
 
   * @return Whether this slider is inverted.
 
839
   * @return The flag that controls whether or not the value scale for the
 
840
   *     slider is inverted.
 
841
   *     
 
842
   * @see #setInverted(boolean)
725
843
   */
726
844
  public boolean getInverted()
727
845
  {
729
847
  }
730
848
 
731
849
  /**
732
 
   * This method changes the "inverted" property for this slider.Horizontal
733
 
   * sliders  that are not inverted will have the minimums on the left. If
734
 
   * they are inverted, the minimums will be  on the right. Vertical sliders
735
 
   * that are not inverted will have the minimums at the bottom. If they are
736
 
   * inverted, the minimums will be at the top. However, if the slider's
737
 
   * componentOrientation is set to RIGHT_TO_LEFT, then everything gets
738
 
   * reversed again.
 
850
   * Sets the flag that controls whether or not the value scale for the
 
851
   * slider is inverted and, if the new flag value is different to the old flag
 
852
   * value, sends a {@link PropertyChangeEvent} to all registered listeners.
 
853
   * Typically, a horizontal slider will display a scale that increases from 
 
854
   * left to right, but this is reversed if the 'inverted' flag is set to 
 
855
   * <code>true</code>.  Similarly, a vertical slider will display a scale that
 
856
   * increases from bottom to top, and this is reversed if the 'inverted' flag
 
857
   * is set to <code>true</code>.
739
858
   *
740
 
   * @param inverted Whether the slider should be inverted.
 
859
   * @param inverted  the new flag value.
 
860
   * 
 
861
   * @see #getInverted()
741
862
   */
742
863
  public void setInverted(boolean inverted)
743
864
  {
744
865
    if (isInverted != inverted)
745
866
      {
746
 
        boolean oldInverted = isInverted;
747
 
        isInverted = inverted;
748
 
        firePropertyChange("inverted", oldInverted, isInverted);
 
867
        boolean oldInverted = isInverted;
 
868
        isInverted = inverted;
 
869
        firePropertyChange("inverted", oldInverted, isInverted);
749
870
      }
750
871
  }
751
872
 
752
873
  /**
753
 
   * This method returns the amount of units between each major tick mark.
 
874
   * Returns the distance between major tick marks along the slider's value 
 
875
   * scale.
754
876
   *
755
877
   * @return The amount of units between each major tick mark.
 
878
   * 
 
879
   * @see #setMajorTickSpacing(int)
756
880
   */
757
881
  public int getMajorTickSpacing()
758
882
  {
760
884
  }
761
885
 
762
886
  /**
763
 
   * This method changes the "majorTickSpacing" property for this slider. The
764
 
   * major tick spacing is the amount of units between each major tick mark.
 
887
   * Sets the distance between major tick marks along the slider's value scale, 
 
888
   * and sends a {@link PropertyChangeEvent} (with the property name 
 
889
   * "majorTickSpacing") to all registered listeners.
765
890
   *
766
 
   * @param spacing The amount of units between each major tick mark.
 
891
   * @param spacing  the distance between major tick marks.
 
892
   * 
 
893
   * @see #getMajorTickSpacing()
767
894
   */
768
895
  public void setMajorTickSpacing(int spacing)
769
896
  {
770
897
    if (majorTickSpacing != spacing)
771
898
      {
772
 
        int oldSpacing = majorTickSpacing;
773
 
        majorTickSpacing = spacing;
774
 
        firePropertyChange("majorTickSpacing", oldSpacing,
775
 
                           majorTickSpacing);
 
899
        int oldSpacing = majorTickSpacing;
 
900
        majorTickSpacing = spacing;
 
901
        firePropertyChange("majorTickSpacing", oldSpacing, majorTickSpacing);
776
902
      }
777
903
  }
778
904
 
779
905
  /**
780
 
   * This method returns the amount of units between each minor tick mark.
 
906
   * Returns the distance between minor tick marks along the slider's value 
 
907
   * scale.
781
908
   *
782
 
   * @return The amount of units between each minor tick mark.
 
909
   * @return The distance between minor tick marks along the slider's value 
 
910
   *     scale.
 
911
   *     
 
912
   * @see #setMinorTickSpacing(int)
783
913
   */
784
914
  public int getMinorTickSpacing()
785
915
  {
787
917
  }
788
918
 
789
919
  /**
790
 
   * This method changes the "minorTickSpacing" property for this slider. The
791
 
   * minor tick spacing is the amount of units between each minor tick mark.
 
920
   * Sets the distance between minor tick marks along the slider's value scale, 
 
921
   * and sends a {@link PropertyChangeEvent} (with the property name 
 
922
   * "minorTickSpacing") to all registered listeners.
792
923
   *
793
 
   * @param spacing The amount of units between each minor tick mark.
 
924
   * @param spacing  the distance between minor tick marks.
 
925
   * 
 
926
   * @see #getMinorTickSpacing()
794
927
   */
795
928
  public void setMinorTickSpacing(int spacing)
796
929
  {
797
930
    if (minorTickSpacing != spacing)
798
931
      {
799
 
        int oldSpacing = minorTickSpacing;
800
 
        minorTickSpacing = spacing;
801
 
        firePropertyChange("minorTickSpacing", oldSpacing,
802
 
                           minorTickSpacing);
 
932
        int oldSpacing = minorTickSpacing;
 
933
        minorTickSpacing = spacing;
 
934
        firePropertyChange("minorTickSpacing", oldSpacing, minorTickSpacing);
803
935
      }
804
936
  }
805
937
 
806
938
  /**
807
 
   * This method returns whether this slider is snapping to ticks.  Sliders
808
 
   * that snap to ticks will automatically move the thumb to the nearest tick
809
 
   * mark.
 
939
   * Returns the flag that controls whether the slider thumb will snap to ticks.
 
940
   * Sliders that snap to ticks will automatically move the thumb to the 
 
941
   * nearest tick mark.
810
942
   *
811
 
   * @return Whether this slider snaps to ticks.
 
943
   * @return <code>true</code> if the slider thumb automatically.
 
944
   * 
 
945
   * @see #setSnapToTicks(boolean)
812
946
   */
813
947
  public boolean getSnapToTicks()
814
948
  {
816
950
  }
817
951
 
818
952
  /**
819
 
   * This method sets whether this slider will snap to ticks. Sliders that
820
 
   * snap to ticks will automatically move the thumb to the nearest tick
821
 
   * mark.
 
953
   * Sets the flag that controls whether the slider thumb will snap to ticks 
 
954
   * and sends a {@link PropertyChangeEvent} (with the property name 
 
955
   * 'snapToTicks') to all registered listeners. Sliders that snap to ticks 
 
956
   * will automatically move the thumb to the nearest tick mark.
822
957
   *
823
 
   * @param snap Whether this slider snaps to ticks.
 
958
   * @param snap  the new flag value.
 
959
   * 
 
960
   * @see #getSnapToTicks()
824
961
   */
825
962
  public void setSnapToTicks(boolean snap)
826
963
  {
827
964
    if (snap != snapToTicks)
828
965
      {
829
 
        snapToTicks = snap;
830
 
        firePropertyChange("snapToTicks", !snap, snap);
 
966
        snapToTicks = snap;
 
967
        firePropertyChange("snapToTicks", !snap, snap);
831
968
      }
832
969
  }
833
970
 
834
971
  /**
835
 
   * This method returns whether the slider will paint its tick marks. In
836
 
   * addition to setting this property to true, one of minor tick spacing  or
837
 
   * major tick spacing must be set to a value greater than 0 in order for
838
 
   * ticks to be painted.
 
972
   * Returns the flag that controls whether or not tick marks are painted along
 
973
   * the slider's value scale.
839
974
   *
840
 
   * @return Whether ticks will be painted.
 
975
   * @return <code>true</code> if tick marks should be painted, and 
 
976
   *     <code>false</code> if tick marks should not be painted.
 
977
   *     
 
978
   * @see #setPaintTicks(boolean)
841
979
   */
842
980
  public boolean getPaintTicks()
843
981
  {
845
983
  }
846
984
 
847
985
  /**
848
 
   * This method changes the "paintTicks" property for this slider. In
849
 
   * addition to setting this property to true, one of minor tick spacing  or
850
 
   * major tick spacing must be set to a value greater than 0 in order for
851
 
   * ticks to be painted.
 
986
   * Sets the flag that controls whether or not tick marks are painted along
 
987
   * the slider's value scale, and sends a {@link PropertyChangeEvent} (with 
 
988
   * the property name "paintTicks") to all registered listeners. In
 
989
   * addition to setting this property to <code>true</code>, one or both of the
 
990
   * minor tick spacing and major tick spacing attributes must be set to a 
 
991
   * value greater than 0 in order for ticks to be painted.
852
992
   *
853
993
   * @param paint Whether ticks will be painted.
 
994
   * 
 
995
   * @see #getPaintTicks()
854
996
   */
855
997
  public void setPaintTicks(boolean paint)
856
998
  {
857
999
    if (paint != paintTicks)
858
1000
      {
859
 
        boolean oldPaintTicks = paintTicks;
860
 
        paintTicks = paint;
861
 
        firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
 
1001
        boolean oldPaintTicks = paintTicks;
 
1002
        paintTicks = paint;
 
1003
        firePropertyChange("paintTicks", oldPaintTicks, paintTicks);
862
1004
      }
863
1005
  }
864
1006
 
865
1007
  /**
866
 
   * This method returns whether the track will be painted.
 
1008
   * Returns the flag that controls whether or not the track is painted.
867
1009
   *
868
1010
   * @return Whether the track will be painted.
 
1011
   * 
 
1012
   * @see #setPaintTrack(boolean)
869
1013
   */
870
1014
  public boolean getPaintTrack()
871
1015
  {
878
1022
   * registered listeners.
879
1023
   *
880
1024
   * @param paint Whether the track will be painted.
 
1025
   * 
 
1026
   * @see #getPaintTrack()
881
1027
   */
882
1028
  public void setPaintTrack(boolean paint)
883
1029
  {
889
1035
  }
890
1036
 
891
1037
  /**
892
 
   * This method returns whether labels will be painted.
 
1038
   * Returns the flag that controls whether or not labels are painted for the
 
1039
   * tick marks along the slider.
893
1040
   *
894
1041
   * @return Whether labels will be painted.
 
1042
   * 
 
1043
   * @see #setPaintLabels(boolean)
895
1044
   */
896
1045
  public boolean getPaintLabels()
897
1046
  {
899
1048
  }
900
1049
 
901
1050
  /**
902
 
   * This method changes the "paintLabels" property.
 
1051
   * Sets the flag that controls whether or not labels are painted for the
 
1052
   * tick marks along the slider and sends a {@link PropertyChangeEvent} (with 
 
1053
   * the property name "paintLabels") to all registered listeners.
903
1054
   *
904
1055
   * @param paint Whether labels will be painted.
 
1056
   * 
 
1057
   * @see #getPaintLabels()
905
1058
   */
906
1059
  public void setPaintLabels(boolean paint)
907
1060
  {
908
1061
    if (paint != paintLabels)
909
1062
      {
910
 
        paintLabels = paint;
911
 
        if (paint && majorTickSpacing > 0)
 
1063
        paintLabels = paint;
 
1064
        if (paint && majorTickSpacing > 0 && labelTable == null)
912
1065
          labelTable = createStandardLabels(majorTickSpacing);
913
 
        firePropertyChange("paintLabels", !paint, paint);
 
1066
        firePropertyChange("paintLabels", !paint, paint);
914
1067
      }
915
1068
  }
916
1069
 
917
1070
  /**
918
 
   * This method is used primarily for debugging purposes and returns a string
919
 
   * that can be used to represent this slider.
 
1071
   * Returns an implementation-dependent string describing the attributes of
 
1072
   * this <code>JSlider</code>.
920
1073
   *
921
 
   * @return A string representing this slider.
 
1074
   * @return A string describing the attributes of this <code>JSlider</code>
 
1075
   *         (never <code>null</code>).
922
1076
   */
923
1077
  protected String paramString()
924
1078
  {
925
 
    return "JSlider";
 
1079
    String superParamStr = super.paramString();
 
1080
    StringBuffer sb = new StringBuffer();
 
1081
    sb.append(",isInverted=").append(getInverted());
 
1082
    sb.append(",majorTickSpacing=").append(getMajorTickSpacing());
 
1083
    sb.append(",minorTickSpacing=").append(getMinorTickSpacing());
 
1084
    sb.append(",orientation=");
 
1085
    if (orientation == HORIZONTAL)
 
1086
      sb.append("HORIZONTAL");
 
1087
    else
 
1088
      sb.append("VERTICAL");
 
1089
    sb.append(",paintLabels=").append(getPaintLabels());
 
1090
    sb.append(",paintTicks=").append(getPaintTicks());
 
1091
    sb.append(",paintTrack=").append(getPaintTrack());
 
1092
    sb.append(",snapToTicks=").append(getSnapToTicks());
 
1093
    
 
1094
    // the following is output by the reference implementation.  We don't
 
1095
    // strictly need to replicate this. Perhaps it has some meaning, but
 
1096
    // I couldn't determine it yet...
 
1097
    sb.append(",snapToValue=true");
 
1098
 
 
1099
    return superParamStr + sb.toString();
926
1100
  }
927
1101
 
928
1102
  /**
929
 
   * DOCUMENT ME!
 
1103
   * Returns the object that provides accessibility features for this
 
1104
   * <code>JSlider</code> component.
930
1105
   *
931
 
   * @return DOCUMENT ME!
 
1106
   * @return The accessible context (an instance of {@link AccessibleJSlider}).
932
1107
   */
933
1108
  public AccessibleContext getAccessibleContext()
934
1109
  {