public class AdjustmentEvent extends AWTEvent
Scrollbar和ScrollPane 。
当用户更改滚动组件的值时,它会接收一个AdjustmentEvent的实例。
如果未指定的行为将引起id任何特定的参数AdjustmentEvent实例不在范围从ADJUSTMENT_FIRST到ADJUSTMENT_LAST 。
该type任何AdjustmentEvent例如采用下列值之一:
UNIT_INCREMENT UNIT_DECREMENT BLOCK_INCREMENT BLOCK_DECREMENT TRACK Adjustable , AdjustmentListener , Serialized Form
| Modifier and Type | Field and Description |
|---|---|
static int |
ADJUSTMENT_FIRST
标记调整事件ID范围的第一个整数ID。
|
static int |
ADJUSTMENT_LAST
标记调整事件ID的范围的最后整数ID。
|
static int |
ADJUSTMENT_VALUE_CHANGED
调整值改变事件。
|
static int |
BLOCK_DECREMENT
块减量调整类型。
|
static int |
BLOCK_INCREMENT
块增量调整类型。
|
static int |
TRACK
绝对跟踪调整类型。
|
static int |
UNIT_DECREMENT
单位减量调整类型。
|
static int |
UNIT_INCREMENT
单位增量调整类型。
|
ACTION_EVENT_MASK, ADJUSTMENT_EVENT_MASK, COMPONENT_EVENT_MASK, consumed, CONTAINER_EVENT_MASK, FOCUS_EVENT_MASK, HIERARCHY_BOUNDS_EVENT_MASK, HIERARCHY_EVENT_MASK, id, INPUT_METHOD_EVENT_MASK, INVOCATION_EVENT_MASK, ITEM_EVENT_MASK, KEY_EVENT_MASK, MOUSE_EVENT_MASK, MOUSE_MOTION_EVENT_MASK, MOUSE_WHEEL_EVENT_MASK, PAINT_EVENT_MASK, RESERVED_ID_MAX, TEXT_EVENT_MASK, WINDOW_EVENT_MASK, WINDOW_FOCUS_EVENT_MASK, WINDOW_STATE_EVENT_MASKsource| Constructor and Description |
|---|
AdjustmentEvent(Adjustable source, int id, int type, int value)
构造一个
AdjustmentEvent与指定对象
Adjustable源,事件类型,调整类型和值。
|
AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)
构造具有
AdjustmentEvent的可调源,事件类型,调整类型和值的
AdjustmentEvent对象。
|
| Modifier and Type | Method and Description |
|---|---|
Adjustable |
getAdjustable()
返回此事件发生的
Adjustable对象。
|
int |
getAdjustmentType()
返回导致值更改事件的调整类型。
|
int |
getValue()
返回调整事件中的当前值。
|
boolean |
getValueIsAdjusting()
如果这是多个调整事件之一,则返回
true 。
|
String |
paramString()
返回表示此
Event的状态的字符串。
|
getSourcepublic static final int ADJUSTMENT_FIRST
public static final int ADJUSTMENT_LAST
public static final int ADJUSTMENT_VALUE_CHANGED
@Native public static final int UNIT_INCREMENT
@Native public static final int UNIT_DECREMENT
@Native public static final int BLOCK_DECREMENT
@Native public static final int BLOCK_INCREMENT
@Native public static final int TRACK
public AdjustmentEvent(Adjustable source, int id, int type, int value)
AdjustmentEvent与指定对象Adjustable源,事件类型,调整类型和值。
此方法抛出IllegalArgumentException如果source是null 。
source - 发生事件的
Adjustable对象
id - 表示事件类型的整数。
有关允许值的信息,请参阅AdjustmentEvent的类说明
type - 指示调整类型的整数。
有关允许值的信息,请参阅AdjustmentEvent的类描述
value - 调整的当前值
IllegalArgumentException - 如果
source为空
EventObject.getSource() ,
AWTEvent.getID() ,
getAdjustmentType() ,
getValue()
public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting)
AdjustmentEvent的可调源,事件类型,调整类型和值的AdjustmentEvent对象。
此方法抛出IllegalArgumentException如果source是null 。
source - 发生事件的
Adjustable对象
id - 表示事件类型的整数。
有关允许值的信息,请参阅AdjustmentEvent的类说明
type - 指示调整类型的整数。
有关允许值的信息,请参阅AdjustmentEvent的类说明
value - 调整的当前值
isAdjusting - 一个布尔值等于
true如果事件是一系列多个调整事件之一,否则
false
IllegalArgumentException - 如果
source为空
EventObject.getSource() ,
AWTEvent.getID() ,
getAdjustmentType() ,
getValue() ,
getValueIsAdjusting()
public Adjustable getAdjustable()
Adjustable对象。
Adjustable对象
public int getValue()
public int getAdjustmentType()
public boolean getValueIsAdjusting()
true 。
true如果这是多个调整事件之一,否则返回
false
public String paramString()
AWTEvent复制
Event状态的字符串。
该方法仅用于调试目的,并且返回的字符串的内容和格式可能因实现而异。
返回的字符串可能为空,但可能不是null 。
paramString在类别
AWTEvent
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.