Package org.jfree.ui.action
Class DowngradeActionMap
java.lang.Object
org.jfree.ui.action.DowngradeActionMap
An actionmap, which is JDK 1.2.2 compatible.
This implementation does not implement the ActionMap interface of JDK 1.3 or higher to maintain the compatibility with JDK 1.2 which does not know this interface.
The usage is still the same.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArrayList
A list containing the actionkeys in their order of addition.private final HashMap
A map containing the key to action mapping.private DowngradeActionMap
The parent of this action map. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[]
allKeys()
Returns an array of the keys defined in thisActionMap
and its parent.void
clear()
Removes all the mappings from thisActionMap
.Returns the binding forkey
, messaging the parentActionMap
if the binding is not locally defined.Returns thisActionMap
's parent.Object[]
keys()
Returns theAction
names that are bound in thisActionMap
.void
Adds a binding forkey
toaction
.void
Removes the binding forkey
from thisActionMap
.void
Sets thisActionMap
's parent.int
size()
Returns the number of bindings.
-
Field Details
-
actionMap
A map containing the key to action mapping. -
actionList
A list containing the actionkeys in their order of addition. -
parent
The parent of this action map.
-
-
Constructor Details
-
DowngradeActionMap
public DowngradeActionMap()Default Constructor. Creates a new empty map.
-
-
Method Details
-
setParent
Sets thisActionMap
's parent.- Parameters:
map
- theActionMap
that is the parent of this one
-
getParent
Returns thisActionMap
's parent.- Returns:
- the
ActionMap
that is the parent of this one, or null if thisActionMap
has no parent
-
put
Adds a binding forkey
toaction
. Ifaction
is null, this removes the current binding forkey
.In most instances,
key
will beaction.getValue(NAME)
.- Parameters:
key
- the key for the action.action
- the action to be added.
-
get
Returns the binding forkey
, messaging the parentActionMap
if the binding is not locally defined.- Parameters:
key
- the key to be queried.- Returns:
- the action for this key, or null if there is no such action.
-
remove
Removes the binding forkey
from thisActionMap
.- Parameters:
key
- the key to be removed.
-
clear
public void clear()Removes all the mappings from thisActionMap
. -
keys
Returns theAction
names that are bound in thisActionMap
.- Returns:
- the keys which are directly bound to this map.
-
size
public int size()Returns the number of bindings.- Returns:
- the number of entries in this map.
-
allKeys
Returns an array of the keys defined in thisActionMap
and its parent. This method differs fromkeys()
in that this method includes the keys defined in the parent.- Returns:
- all keys of this map and all parents.
-