|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
edu.neu.ccs.gui.ActionSequence
An ordered collection of ActionListener objects
similar to a ;
the sequence itself is an instance of ListAbstractAction;
the actionPerformed method of the sequence executes
the actionPerformed method of each listener in its
list in order of entry into the list.
Prior to version 2.3.3, this class required that its contents
satisfy the stronger interface Action. To avoid
the inconvenience of this restriction, certain parameter and
return types were changed to require only the weaker interface
ActionListener.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.AbstractAction |
|
| Field Summary | |
protected List |
actions
The underlying list used for storage of action listeners. |
| Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
ActionSequence()
Constructs a sequence using the default underlying linear data structure. |
|
ActionSequence(List l)
Constructs a sequence using the given underlying linear data structure. |
|
| Method Summary | |
void |
actionPerformed(ActionEvent evt)
If this sequence is enabled then performs the enabled actions within the sequence in order; otherwise does nothing. |
boolean |
add(ActionListener a)
Appends the given action listener to the end of this sequence. |
void |
add(int index,
ActionListener a)
Inserts the given action listener at the given index in this sequence. |
void |
clear()
Removes all of the action listeners from this sequence. |
boolean |
contains(ActionListener a)
Returns true if the given action listener
is contained in this sequence,
or false if it is not. |
boolean |
containsAll(Collection c)
Returns true if this sequence contains
all of the elements of the specified collection. |
boolean |
equals(Object object)
Returns true if the given object is
an ActionSequence and is equal to this
sequence, and false if it is not. |
ActionListener |
get(int index)
Returns the action listener at the given index in this sequence. |
int |
hashCode()
Returns a hash code value for this sequence. |
int |
indexOf(ActionListener a)
Returns the index in this sequence of the first occurence of the given action listener, or -1 if this sequence does not contain this action listener. |
boolean |
isEmpty()
Returns true if this sequence is empty,
and false if it is not. |
Iterator |
iterator()
Returns an iterator over the action listeners in this sequence in proper order. |
int |
lastIndexOf(ActionListener a)
Returns the index in this sequence of the last occurrence of the given action listener, or -1 if this list does not contain this action listener. |
ListIterator |
listIterator()
Returns a list iterator over the action listeners in this sequence in order. |
ListIterator |
listIterator(int index)
Returns a list iterator over the action listeners in this sequence in order, starting at the given index. |
boolean |
remove(ActionListener a)
Removes the first occurrence of the given action listener in this sequence, and returns true,
or returns false
if this sequence does not contain the action listener. |
ActionListener |
remove(int index)
Removes the action listener at the given index of the sequence. |
ActionListener |
set(int index,
ActionListener a)
Replaces the action listener at the given index in this sequence with the given action listener. |
int |
size()
Returns the number of action listeners in this sequence. |
ActionSequence |
subList(int fromIndex,
int toIndex)
Returns an ActionSequence
containing the action listeners in this sequence
from the given starting index, inclusive,
to the given ending index, exclusive. |
ActionListener[] |
toArray()
Returns an array containing the action listeners in this sequence in order. |
| Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected List actions
| Constructor Detail |
public ActionSequence()
ActionSequence(List)public ActionSequence(List l)
null,
the default structure is used.
l - the data structure to be usedActionSequence()| Method Detail |
public final void actionPerformed(ActionEvent evt)
If this sequence is enabled then performs the enabled actions within the sequence in order; otherwise does nothing.
As of 2.3.3, this sequence may contain objects that implement
only the ActionListener interface in which case
there is no notion of enabled. Therefore, if the sequence
is enabled as a whole, those objects will perform their actions.
However, to maintain backward compatibility, if an object in the
sequence implements Action, then that object will
only perform its action if it is individually enabled as well.
actionPerformed in interface ActionListenerevt - the action event
public void add(int index,
ActionListener a)
add(ActionListener)public boolean add(ActionListener a)
add(int, ActionListener)public void clear()
public boolean contains(ActionListener a)
true if the given action listener
is contained in this sequence,
or false if it is not.
containsAll(Collection)public boolean containsAll(Collection c)
true if this sequence contains
all of the elements of the specified collection.
contains(ActionListener)public boolean equals(Object object)
Returns true if the given object is
an ActionSequence and is equal to this
sequence, and false if it is not.
public ActionListener get(int index)
public int hashCode()
public int indexOf(ActionListener a)
lastIndexOf(ActionListener)public boolean isEmpty()
true if this sequence is empty,
and false if it is not.
size()public Iterator iterator()
listIterator(),
listIterator(int)public int lastIndexOf(ActionListener a)
indexOf(ActionListener)public ListIterator listIterator()
listIterator(int),
iterator()public ListIterator listIterator(int index)
listIterator(),
iterator()public ActionListener remove(int index)
remove(ActionListener)public boolean remove(ActionListener a)
true,
or returns false
if this sequence does not contain the action listener.
remove(int)
public ActionListener set(int index,
ActionListener a)
public int size()
isEmpty()
public ActionSequence subList(int fromIndex,
int toIndex)
ActionSequence
containing the action listeners in this sequence
from the given starting index, inclusive,
to the given ending index, exclusive.
listIterator(int)public ActionListener[] toArray()
iterator(),
listIterator()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||