java.awt.event

Class AdjustmentEvent

public class AdjustmentEvent extends AWTEvent

This class represents an event that is generated when an adjustable value is changed.

Since: 1.1

See Also: Adjustable AdjustmentListener

UNKNOWN: updated to 1.4

Field Summary
static intADJUSTMENT_FIRST
This is the first id in the range of ids used by adjustment events.
static intADJUSTMENT_LAST
This is the last id in the range of ids used by adjustment events.
static intADJUSTMENT_VALUE_CHANGED
This is the id indicating an adjustment value changed.
static intBLOCK_DECREMENT
Adjustment type for block decrements.
static intBLOCK_INCREMENT
Adjustment type for block increments.
static intTRACK
Adjustment type for tracking adjustments.
static intUNIT_DECREMENT
Adjustment type for unit decrements.
static intUNIT_INCREMENT
Adjustment type for unit increments.
Constructor Summary
AdjustmentEvent(Adjustable source, int id, int type, int value)
Initializes an instance of AdjustmentEvent with the specified source, id, type, and value.
AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)
Initializes an instance of AdjustmentEvent with the specified source, id, type, and value.
Method Summary
AdjustablegetAdjustable()
This method returns the source of the event as an Adjustable.
intgetAdjustmentType()
Returns the type of the event, which will be one of {@link #UNIT_INCREMENT}, {@link #UNIT_DECREMENT}, {@link #BLOCK_INCREMENT}, {@link #BLOCK_DECREMENT}, or {@link #TRACK}.
intgetValue()
Returns the new value of the adjustable object.
booleangetValueIsAdjusting()
Test if this event is part of a sequence of multiple adjustements.
StringparamString()
Returns a string that describes the event.

Field Detail

ADJUSTMENT_FIRST

public static final int ADJUSTMENT_FIRST
This is the first id in the range of ids used by adjustment events.

ADJUSTMENT_LAST

public static final int ADJUSTMENT_LAST
This is the last id in the range of ids used by adjustment events.

ADJUSTMENT_VALUE_CHANGED

public static final int ADJUSTMENT_VALUE_CHANGED
This is the id indicating an adjustment value changed.

BLOCK_DECREMENT

public static final int BLOCK_DECREMENT
Adjustment type for block decrements.

BLOCK_INCREMENT

public static final int BLOCK_INCREMENT
Adjustment type for block increments.

TRACK

public static final int TRACK
Adjustment type for tracking adjustments.

UNIT_DECREMENT

public static final int UNIT_DECREMENT
Adjustment type for unit decrements.

UNIT_INCREMENT

public static final int UNIT_INCREMENT
Adjustment type for unit increments.

Constructor Detail

AdjustmentEvent

public AdjustmentEvent(Adjustable source, int id, int type, int value)
Initializes an instance of AdjustmentEvent with the specified source, id, type, and value. Note that an invalid id leads to unspecified results.

Parameters: source the source of the event id the event id type the event type, one of the constants of this class value the value of the adjustment

Throws: IllegalArgumentException if source is null

AdjustmentEvent

public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)
Initializes an instance of AdjustmentEvent with the specified source, id, type, and value. Note that an invalid id leads to unspecified results.

Parameters: source the source of the event id the event id type the event type, one of the constants of this class value the value of the adjustment isAdjusting if this event is in a chain of adjustments

Throws: IllegalArgumentException if source is null

Since: 1.4

Method Detail

getAdjustable

public Adjustable getAdjustable()
This method returns the source of the event as an Adjustable.

Returns: the Adjustable source of the event

getAdjustmentType

public int getAdjustmentType()
Returns the type of the event, which will be one of {@link #UNIT_INCREMENT}, {@link #UNIT_DECREMENT}, {@link #BLOCK_INCREMENT}, {@link #BLOCK_DECREMENT}, or {@link #TRACK}.

Returns: the type of the event

getValue

public int getValue()
Returns the new value of the adjustable object.

Returns: the value of the event

getValueIsAdjusting

public boolean getValueIsAdjusting()
Test if this event is part of a sequence of multiple adjustements.

Returns: true if this is not the last adjustment

Since: 1.4

paramString

public String paramString()
Returns a string that describes the event. This is in the format "ADJUSTMENT_VALUE_CHANGED,adjType=" + <type> + ",value=" + getValue() + ",isAdjusting=" + getValueIsAdjusting(), where type is the name of the constant returned by getAdjustmentType().

Returns: a string that describes the event