AdjustmentEventpublic class AdjustmentEvent extends AWTEvent The adjustment event emitted by Adjustable objects. |
Fields Summary |
---|
public static final int | ADJUSTMENT_FIRSTMarks the first integer id for the range of adjustment event ids. | public static final int | ADJUSTMENT_LASTMarks the last integer id for the range of adjustment event ids. | public static final int | ADJUSTMENT_VALUE_CHANGEDThe adjustment value changed event. | public static final int | UNIT_INCREMENTThe unit increment adjustment type. | public static final int | UNIT_DECREMENTThe unit decrement adjustment type. | public static final int | BLOCK_DECREMENTThe block decrement adjustment type. | public static final int | BLOCK_INCREMENTThe block increment adjustment type. | public static final int | TRACKThe absolute tracking adjustment type. | Adjustable | adjustableThe adjustable object that fired the event. | int | valuevalue will contain the new value of the
adjustable object. This value will always be in a
range associated adjustable object. | int | adjustmentTypeThe 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 | isAdjustingThe 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 .
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 .
super(source, id);
adjustable = source;
this.adjustmentType = type;
this.value = value;
this.isAdjusting = isAdjusting;
|
Methods Summary |
---|
public java.awt.Adjustable | getAdjustable()Returns the Adjustable object where this event originated.
return adjustable;
| public int | getAdjustmentType()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 adjustmentType;
| public int | getValue()Returns the current value in the adjustment event.
return value;
| public boolean | getValueIsAdjusting()Returns true if this is one of multiple
adjustment events.
return isAdjusting;
| public java.lang.String | paramString()
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;
|
|