public class ActionMap extends Object implements Serializable
ActionMap
提供映射
Object
s(称为密钥或动作名称)来
Action
s,
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.