jdk/src/share/classes/java/awt/event/AdjustmentEvent.java
author erikj
Thu, 07 Jun 2012 18:05:09 -0700
changeset 12813 c10ab96dcf41
parent 5506 202f599c92aa
child 16734 da1901d79073
permissions -rw-r--r--
7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI Reviewed-by: ohair, ohrstrom, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     2
 * Copyright (c) 1996, 2008, 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: 715
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: 715
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: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
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 java.awt.event;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Adjustable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.AWTEvent;
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    30
import javax.tools.annotation.GenerateNativeHeader;
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    31
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    32
import javax.tools.annotation.GenerateNativeHeader;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    35
 * The adjustment event emitted by Adjustable objects like
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    36
 * {@link java.awt.Scrollbar} and {@link java.awt.ScrollPane}.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    37
 * When the user changes the value of the scrolling component,
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    38
 * it receives an instance of {@code AdjustmentEvent}.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    39
 * <p>
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    40
 * An unspecified behavior will be caused if the {@code id} parameter
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    41
 * of any particular {@code AdjustmentEvent} instance is not
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    42
 * in the range from {@code ADJUSTMENT_FIRST} to {@code ADJUSTMENT_LAST}.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    43
 * <p>
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    44
 * The {@code type} of any {@code AdjustmentEvent} instance takes one of the following
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    45
 * values:
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    46
 *                     <ul>
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    47
 *                     <li> {@code UNIT_INCREMENT}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    48
 *                     <li> {@code UNIT_DECREMENT}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    49
 *                     <li> {@code BLOCK_INCREMENT}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    50
 *                     <li> {@code BLOCK_DECREMENT}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    51
 *                     <li> {@code TRACK}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    52
 *                     </ul>
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
    53
 * Assigning the value different from listed above will cause an unspecified behavior.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * @see java.awt.Adjustable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * @see AdjustmentListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * @author Amy Fowler
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * @since 1.1
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 */
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    60
/* No native methods here, but the constants are needed in the supporting JNI code */
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 5506
diff changeset
    61
@GenerateNativeHeader
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
public class AdjustmentEvent extends AWTEvent {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * Marks the first integer id for the range of adjustment event ids.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    public static final int ADJUSTMENT_FIRST    = 601;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * Marks the last integer id for the range of adjustment event ids.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public static final int ADJUSTMENT_LAST     = 601;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * The adjustment value changed event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    public static final int ADJUSTMENT_VALUE_CHANGED = ADJUSTMENT_FIRST; //Event.SCROLL_LINE_UP
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * The unit increment adjustment type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    public static final int UNIT_INCREMENT      = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * The unit decrement adjustment type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    public static final int UNIT_DECREMENT      = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * The block decrement adjustment type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    public static final int BLOCK_DECREMENT     = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * The block increment adjustment type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static final int BLOCK_INCREMENT     = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
     * The absolute tracking adjustment type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    public static final int TRACK               = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
     * The adjustable object that fired the event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @see #getAdjustable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    Adjustable adjustable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * <code>value</code> will contain the new value of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * adjustable object.  This value will always be  in a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * range associated adjustable object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * @see #getValue
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    int value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * The <code>adjustmentType</code> describes how the adjustable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * object value has changed.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * This value can be increased/decreased by a block or unit amount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * where the block is associated with page increments/decrements,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * and a unit is associated with line increments/decrements.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     * @see #getAdjustmentType
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    int adjustmentType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     * The <code>isAdjusting</code> is true if the event is one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * of the series of multiple adjustment events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
     * @see #getValueIsAdjusting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    boolean isAdjusting;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * JDK 1.1 serialVersionUID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     private static final long serialVersionUID = 5700290645205279921L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Constructs an <code>AdjustmentEvent</code> object with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * specified <code>Adjustable</code> source, event type,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * adjustment type, and value.
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   156
     * <p> This method throws an
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * <code>IllegalArgumentException</code> if <code>source</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   160
     * @param source The <code>Adjustable</code> object where the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *               event originated
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   162
     * @param id     An integer indicating the type of event.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   163
     *                     For information on allowable values, see
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   164
     *                     the class description for {@link AdjustmentEvent}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   165
     * @param type   An integer indicating the adjustment type.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   166
     *                     For information on allowable values, see
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   167
     *                     the class description for {@link AdjustmentEvent}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   168
     * @param value  The current value of the adjustment
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * @throws IllegalArgumentException if <code>source</code> is null
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   170
     * @see #getSource()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   171
     * @see #getID()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   172
     * @see #getAdjustmentType()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   173
     * @see #getValue()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    public AdjustmentEvent(Adjustable source, int id, int type, int value) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        this(source, id, type, value, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * Constructs an <code>AdjustmentEvent</code> object with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * specified Adjustable source, event type, adjustment type, and value.
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   182
     * <p> This method throws an
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * <code>IllegalArgumentException</code> if <code>source</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * is <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   186
     * @param source The <code>Adjustable</code> object where the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *               event originated
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   188
     * @param id     An integer indicating the type of event.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   189
     *                     For information on allowable values, see
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   190
     *                     the class description for {@link AdjustmentEvent}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   191
     * @param type   An integer indicating the adjustment type.
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   192
     *                     For information on allowable values, see
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   193
     *                     the class description for {@link AdjustmentEvent}
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   194
     * @param value  The current value of the adjustment
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   195
     * @param isAdjusting A boolean that equals <code>true</code> if the event is one
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     *               of a series of multiple adjusting events,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     *               otherwise <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * @throws IllegalArgumentException if <code>source</code> is null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * @since 1.4
440
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   200
     * @see #getSource()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   201
     * @see #getID()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   202
     * @see #getAdjustmentType()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   203
     * @see #getValue()
a3dac373f62d 6520716: event classes lack info about parameters
dav
parents: 2
diff changeset
   204
     * @see #getValueIsAdjusting()
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        super(source, id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        adjustable = source;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        this.adjustmentType = type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        this.value = value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        this.isAdjusting = isAdjusting;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * Returns the <code>Adjustable</code> object where this event originated.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * @return the <code>Adjustable</code> object where this event originated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public Adjustable getAdjustable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        return adjustable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * Returns the current value in the adjustment event.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * @return the current value in the adjustment event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public int getValue() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        return value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * Returns the type of adjustment which caused the value changed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * event.  It will have one of the following values:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * <ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * <li>{@link #UNIT_INCREMENT}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * <li>{@link #UNIT_DECREMENT}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * <li>{@link #BLOCK_INCREMENT}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * <li>{@link #BLOCK_DECREMENT}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     * <li>{@link #TRACK}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     * </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     * @return one of the adjustment values listed above
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public int getAdjustmentType() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        return adjustmentType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     * Returns <code>true</code> if this is one of multiple
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * adjustment events.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * @return <code>true</code> if this is one of multiple
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     *         adjustment events, otherwise returns <code>false</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * @since 1.4
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    public boolean getValueIsAdjusting() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        return isAdjusting;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    public String paramString() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
        String typeStr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        switch(id) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
          case ADJUSTMENT_VALUE_CHANGED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
              typeStr = "ADJUSTMENT_VALUE_CHANGED";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
          default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
              typeStr = "unknown type";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        String adjTypeStr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        switch(adjustmentType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
          case UNIT_INCREMENT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
              adjTypeStr = "UNIT_INCREMENT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
          case UNIT_DECREMENT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
              adjTypeStr = "UNIT_DECREMENT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
          case BLOCK_INCREMENT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
              adjTypeStr = "BLOCK_INCREMENT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
          case BLOCK_DECREMENT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
              adjTypeStr = "BLOCK_DECREMENT";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
          case TRACK:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
              adjTypeStr = "TRACK";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
              break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
          default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
              adjTypeStr = "unknown type";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
        return typeStr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
            + ",adjType="+adjTypeStr
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
            + ",value="+value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
            + ",isAdjusting="+isAdjusting;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
}