FileDocCategorySizeDatePackage
AdjustmentEvent.javaAPI DocJava SE 5 API6813Fri Aug 26 14:56:48 BST 2005java.awt.event

AdjustmentEvent

public class AdjustmentEvent extends AWTEvent
The adjustment event emitted by Adjustable objects.
see
java.awt.Adjustable
see
AdjustmentListener
author
Amy Fowler
version
1.27 12/19/03
since
1.1

Fields Summary
public static final int
ADJUSTMENT_FIRST
Marks the first integer id for the range of adjustment event ids.
public static final int
ADJUSTMENT_LAST
Marks the last integer id for the range of adjustment event ids.
public static final int
ADJUSTMENT_VALUE_CHANGED
The adjustment value changed event.
public static final int
UNIT_INCREMENT
The unit increment adjustment type.
public static final int
UNIT_DECREMENT
The unit decrement adjustment type.
public static final int
BLOCK_DECREMENT
The block decrement adjustment type.
public static final int
BLOCK_INCREMENT
The block increment adjustment type.
public static final int
TRACK
The absolute tracking adjustment type.
Adjustable
adjustable
The adjustable object that fired the event.
int
value
value will contain the new value of the adjustable object. This value will always be in a range associated adjustable object.
int
adjustmentType
The adjustmentType describes how the adjustable object value has changed. This value can be increased/decreased by a block or unit amount where the block is associated with page increments/decrements, and a unit is associated with line increments/decrements.
boolean
isAdjusting
The isAdjusting is true if the event is one of the series of multiple adjustment events.
private static final long
serialVersionUID
Constructors Summary
public AdjustmentEvent(Adjustable source, int id, int type, int value)
Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

Note that passing in an invalid id results in unspecified behavior. This method throws an IllegalArgumentException if source is null.

param
source the Adjustable object where the event originated
param
id the event type
param
type the adjustment type
param
value the current value of the adjustment
throws
IllegalArgumentException if source is null



                                                                                                     
             
	this(source, id, type, value, false);
    
public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)
Constructs an AdjustmentEvent object with the specified Adjustable source, event type, adjustment type, and value.

Note that passing in an invalid id results in unspecified behavior. This method throws an IllegalArgumentException if source is null.

param
source the Adjustable object where the event originated
param
id the event type
param
type the adjustment type
param
value the current value of the adjustment
param
isAdjusting true if the event is one of a series of multiple adjusting events, otherwise false
throws
IllegalArgumentException if source is null

        super(source, id);
	adjustable = source;
        this.adjustmentType = type;
	this.value = value;
	this.isAdjusting = isAdjusting;
    
Methods Summary
public java.awt.AdjustablegetAdjustable()
Returns the Adjustable object where this event originated.

return
the Adjustable object where this event originated

        return adjustable;
    
public intgetAdjustmentType()
Returns the type of adjustment which caused the value changed event. It will have one of the following values:
  • {@link #UNIT_INCREMENT}
  • {@link #UNIT_DECREMENT}
  • {@link #BLOCK_INCREMENT}
  • {@link #BLOCK_DECREMENT}
  • {@link #TRACK}

return
one of the adjustment values listed above

        return adjustmentType;
    
public intgetValue()
Returns the current value in the adjustment event.

return
the current value in the adjustment event

        return value;
    
public booleangetValueIsAdjusting()
Returns true if this is one of multiple adjustment events.

return
true if this is one of multiple adjustment events, otherwise returns false

	return isAdjusting;
    
public java.lang.StringparamString()

        String typeStr;
        switch(id) {
          case ADJUSTMENT_VALUE_CHANGED:
              typeStr = "ADJUSTMENT_VALUE_CHANGED";
              break;
          default:
              typeStr = "unknown type";
        }
        String adjTypeStr;
        switch(adjustmentType) {
          case UNIT_INCREMENT:
              adjTypeStr = "UNIT_INCREMENT";
              break;
          case UNIT_DECREMENT:
              adjTypeStr = "UNIT_DECREMENT";
              break;
          case BLOCK_INCREMENT:
              adjTypeStr = "BLOCK_INCREMENT";
              break;
          case BLOCK_DECREMENT:
              adjTypeStr = "BLOCK_DECREMENT";
              break;
          case TRACK:
              adjTypeStr = "TRACK";
              break;
          default:
              adjTypeStr = "unknown type";
        }
        return typeStr
	    + ",adjType="+adjTypeStr
	    + ",value="+value
	    + ",isAdjusting="+isAdjusting;