jdk/src/java.desktop/share/classes/javax/swing/BoundedRangeModel.java
author aghaisas
Mon, 10 Jul 2017 14:55:29 +0530
changeset 47151 362dcbee0613
parent 25859 3317bb8137f4
permissions -rw-r--r--
6919529: NPE from MultiUIDefaults.getUIError Reviewed-by: aghaisas, psadhukhan, serb Contributed-by: shashidhara.veerabhadraiah@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 20455
diff changeset
     2
 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.swing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import javax.swing.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * Defines the data model used by components like <code>Slider</code>s
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 * and <code>ProgressBar</code>s.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * Defines four interrelated integer properties: minimum, maximum, extent
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * and value.  These four integers define two nested ranges like this:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * minimum &lt;= value &lt;= value+extent &lt;= maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * The outer range is <code>minimum,maximum</code> and the inner
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * range is <code>value,value+extent</code>.  The inner range
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * must lie within the outer one, i.e. <code>value</code> must be
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * less than or equal to <code>maximum</code> and <code>value+extent</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * must greater than or equal to <code>minimum</code>, and <code>maximum</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * must be greater than or equal to <code>minimum</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * There are a few features of this model that one might find a little
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * surprising.  These quirks exist for the convenience of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * Swing BoundedRangeModel clients, such as <code>Slider</code> and
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <code>ScrollBar</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *   The minimum and maximum set methods "correct" the other
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *   three properties to accommodate their new value argument.  For
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *   example setting the model's minimum may change its maximum, value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 *   and extent properties (in that order), to maintain the constraints
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 *   specified above.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 *   The value and extent set methods "correct" their argument to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 *   fit within the limits defined by the other three properties.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *   For example if <code>value == maximum</code>, <code>setExtent(10)</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 *   would change the extent (back) to zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * <li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *   The four BoundedRangeModel values are defined as Java Beans properties
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 *   however Swing ChangeEvents are used to notify clients of changes rather
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 *   than PropertyChangeEvents. This was done to keep the overhead of monitoring
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 *   a BoundedRangeModel low. Changes are often reported at MouseDragged rates.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * For an example of specifying custom bounded range models used by sliders,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 * see <a
20455
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    74
 href="http://www.oracle.com/technetwork/java/architecture-142923.html#separable">Separable model architecture</a>
f6f9a0c2796b 8020688: Broken links in documentation at http://docs.oracle.com/javase/6/docs/api/index.
mcherkas
parents: 5506
diff changeset
    75
 * in <em>A Swing Architecture Overview.</em>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * @author Hans Muller
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * @see DefaultBoundedRangeModel
25201
4adc75e0c4e5 8046485: Add missing @since tag under javax.swing.*
henryjen
parents: 23010
diff changeset
    79
 * @since 1.2
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
public interface BoundedRangeModel
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Returns the minimum acceptable value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * @return the value of the minimum property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * @see #setMinimum
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    int getMinimum();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * Sets the model's minimum to <I>newMinimum</I>.   The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * other three properties may be changed as well, to ensure
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * that:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * minimum &lt;= value &lt;= value+extent &lt;= maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * Notifies any listeners if the model changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
     * @param newMinimum the model's new minimum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
     * @see #getMinimum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
     * @see #addChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    void setMinimum(int newMinimum);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * Returns the model's maximum.  Note that the upper
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * limit on the model's value is (maximum - extent).
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * @return the value of the maximum property.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * @see #setMaximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * @see #setExtent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    int getMaximum();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     * Sets the model's maximum to <I>newMaximum</I>. The other
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     * three properties may be changed as well, to ensure that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * minimum &lt;= value &lt;= value+extent &lt;= maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * Notifies any listeners if the model changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @param newMaximum the model's new maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @see #getMaximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     * @see #addChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    void setMaximum(int newMaximum);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * Returns the model's current value.  Note that the upper
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     * limit on the model's value is <code>maximum - extent</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * and the lower limit is <code>minimum</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * @return  the model's value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * @see     #setValue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    int getValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * Sets the model's current value to <code>newValue</code> if <code>newValue</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * satisfies the model's constraints. Those constraints are:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * <pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * minimum &lt;= value &lt;= value+extent &lt;= maximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * </pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Otherwise, if <code>newValue</code> is less than <code>minimum</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * it's set to <code>minimum</code>, if its greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * <code>maximum</code> then it's set to <code>maximum</code>, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * if it's greater than <code>value+extent</code> then it's set to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * <code>value+extent</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * When a BoundedRange model is used with a scrollbar the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * specifies the origin of the scrollbar knob (aka the "thumb" or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     * "elevator").  The value usually represents the origin of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * visible part of the object being scrolled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     * Notifies any listeners if the model changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     * @param newValue the model's new value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * @see #getValue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    void setValue(int newValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * This attribute indicates that any upcoming changes to the value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * of the model should be considered a single event. This attribute
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * will be set to true at the start of a series of changes to the value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     * and will be set to false when the value has finished changing.  Normally
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * this allows a listener to only take action when the final value change in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
     * committed, instead of having to do updates for all intermediate values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * Sliders and scrollbars use this property when a drag is underway.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * @param b true if the upcoming changes to the value property are part of a series
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    void setValueIsAdjusting(boolean b);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * Returns true if the current changes to the value property are part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * of a series of changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @return the valueIsAdjustingProperty.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * @see #setValueIsAdjusting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    boolean getValueIsAdjusting();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * Returns the model's extent, the length of the inner range that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * begins at the model's value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * @return  the value of the model's extent property
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     * @see     #setExtent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @see     #setValue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    int getExtent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * Sets the model's extent.  The <I>newExtent</I> is forced to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * be greater than or equal to zero and less than or equal to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * maximum - value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * When a BoundedRange model is used with a scrollbar the extent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * defines the length of the scrollbar knob (aka the "thumb" or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * "elevator").  The extent usually represents how much of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * object being scrolled is visible. When used with a slider,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * the extent determines how much the value can "jump", for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * example when the user presses PgUp or PgDn.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     * Notifies any listeners if the model changes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * @param  newExtent the model's new extent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * @see #getExtent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @see #setValue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    void setExtent(int newExtent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * This method sets all of the model's data with a single method call.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * The method results in a single change event being generated. This is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * convenient when you need to adjust all the model data simultaneously and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * do not want individual change events to occur.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * @param value  an int giving the current value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * @param extent an int giving the amount by which the value can "jump"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @param min    an int giving the minimum value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * @param max    an int giving the maximum value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * @param adjusting a boolean, true if a series of changes are in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     *                    progress
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * @see #setValue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * @see #setExtent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     * @see #setMinimum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
     * @see #setMaximum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
     * @see #setValueIsAdjusting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    void setRangeProperties(int value, int extent, int min, int max, boolean adjusting);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * Adds a ChangeListener to the model's listener list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * @param x the ChangeListener to add
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * @see #removeChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    void addChangeListener(ChangeListener x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * Removes a ChangeListener from the model's listener list.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * @param x the ChangeListener to remove
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * @see #addChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    void removeChangeListener(ChangeListener x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
}