public class ActionMap extends Object implements Serializable
ActionMap提供映射
Objects(称为密钥或动作名称)来
Actions,
ActionMap通常是用一个
InputMap定位特定行动当一个键被按下。作为一个
ActionMap
InputMap,可以有一个亲本是寻找在
ActionMap没有定义键。
与InputMap如果你创建了一个周期,如:
actionmap是新actionmap();actionmap BM =新actionmap():是Setparent(BM);BM Setparent(AM);一些方法会导致堆栈溢出错误被抛出。
InputMap
| Constructor and Description |
|---|
ActionMap()
创建一个没有父母,没有
ActionMap映射。
|
| Modifier and Type | Method and Description |
|---|---|
Object[] |
allKeys()
返回在这
ActionMap及其母所定义的键的数组。
|
void |
clear()
除去这
ActionMap所有映射。
|
Action |
get(Object key)
返回绑定消息
key,母
ActionMap如果结合不确定。
|
ActionMap |
getParent()
返回此
ActionMap的母。
|
Object[] |
keys()
返回被绑定在这
ActionMap的
Action名称。
|
void |
put(Object key, Action action)
添加一个绑定到
action
key。
|
void |
remove(Object key)
删除绑定从这
ActionMap
key。
|
void |
setParent(ActionMap map)
这一集
ActionMap的母。
|
int |
size()
返回在这
ActionMap绑定的号码。
|
public void setParent(ActionMap map)
ActionMap的母。
map -
ActionMap是这一母
public ActionMap getParent()
ActionMap的母。
ActionMap这一母,或null如果这
ActionMap没有父
public void put(Object key, Action action)
action
key。如果
action是null,这消除
key当前绑定的。
在大多数情况下,key将action.getValue(NAME)。
public void remove(Object key)
ActionMap
key。
public void clear()
ActionMap所有映射。
public Object[] keys()
ActionMap的
Action名称。
public int size()
ActionMap绑定的号码。
ActionMap绑定的号码
public Object[] allKeys()
ActionMap及其母所定义的键的数组。这种方法不同于
keys(),该方法包括在父所定义的键。
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.