|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.models.NodeActionEvent
public class NodeActionEvent
NodeActionEvent is fired from a viewer that performs an action on a
NodeView object. The action command value of the event indicates
which type of action has occurred.
The different action commands that a NodeActionEvent may
contain are as follows:
NodeActionEvent is a subclass of java.awt.event.ActionEvent.
Therefore classes which want to listen for NodeActionEvent
events should implement java.awt.event.ActionListener and check
the incoming event object to see if it is an instance of NodeActionEvent.
Here's a sample NodeActionEvent handler:
public void actionPerformed(java.awt.event.ActionEvent event)
{
if (event instanceof NodeActionEvent)
{
NodeActionEvent naEvent = (NodeActionEvent)event;
NodeView node = naEvent.getNode();
if (naEvent.getActionCommand() == NodeActionEvent.EXPANDED)
{
System.out.println("node expanded: "+node.getNodeText());
}
else if (naEvent.getActionCommand() == NodeActionEvent.COLLAPSED)
{
System.out.println("node collapsed: "+node.getNodeText());
}
}
}
ActionListener,
NodeView,
TreeView,
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
COLLAPSE_ALL_ENDING
Collapse all ending action command. |
static java.lang.String |
COLLAPSE_ALL_STARTING
Collapse all starting action command. |
static java.lang.String |
COLLAPSED
Collapsed action command. |
static java.lang.String |
COLLAPSING
Collapsing action command. |
static java.lang.String |
DEFAULT_ACTION
Default action action command. |
static java.lang.String |
EXPAND_ALL_ENDING
Expand all ending action command. |
static java.lang.String |
EXPAND_ALL_STARTING
Expand all starting action command. |
static java.lang.String |
EXPANDED
Expanded action command. |
static java.lang.String |
EXPANDING
Expanding action command. |
| Constructor Summary | |
|---|---|
NodeActionEvent(java.lang.Object source,
int id,
java.lang.String command,
int modifiers,
NodeView node)
Constructs a NodeActionEvent object. |
|
NodeActionEvent(java.lang.Object source,
int id,
java.lang.String command,
NodeView node)
Constructs an NodeActionEvent object. |
|
| Method Summary | |
|---|---|
void |
consume()
Called to consume the event. |
NodeView |
getNode()
Returns the NodeView object on which the action occurred. |
boolean |
isConsumed()
Indicates whether or not the event has been consumed. |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_ACTION
TreeView assigns this
action command for the event fired for the node that is either double-clicked
or that has the enter key pressed on it.
TreeView,
Constant Field Valuespublic static final java.lang.String EXPANDING
public static final java.lang.String EXPANDED
public static final java.lang.String EXPAND_ALL_STARTING
public static final java.lang.String EXPAND_ALL_ENDING
public static final java.lang.String COLLAPSING
public static final java.lang.String COLLAPSED
public static final java.lang.String COLLAPSE_ALL_STARTING
public static final java.lang.String COLLAPSE_ALL_ENDING
| Constructor Detail |
|---|
public NodeActionEvent(java.lang.Object source,
int id,
java.lang.String command,
NodeView node)
source - the object where the event originatedid - the type of eventcommand - the command string for this action eventnode - the node on which the action occurred
public NodeActionEvent(java.lang.Object source,
int id,
java.lang.String command,
int modifiers,
NodeView node)
source - the object where the event originatedid - the type of eventcommand - the command string for this action eventmodifiers - the modifiers held down during this actionnode - the node on which the action occurred| Method Detail |
|---|
public NodeView getNode()
public boolean isConsumed()
isConsumed in class java.awt.AWTEventpublic void consume()
consume in class java.awt.AWTEvent
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||