|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.AbstractAction
com.pentec.util.AAction
public class AAction
This class implements the Action and ActionListener
interfaces and supports actions from a drop down menu bar, pop-up menus,
arbitrary hot keys, or tool buttons. This class also provides a static
method for generating action listeners with calls to specified methods with
full support of the ADAPT history tracking feature, and a static method for
executing a command string (such as from a macro definition).
| Field Summary | |
|---|---|
private java.lang.Object[] |
aoParam
An array of objects to pass to the method as parameters |
private DataFrame |
mainFrame
The ADAPT data frame to which this action belongs |
private java.lang.reflect.Method |
method
The method to call from the installed action listener |
| 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 | |
|---|---|
AAction(DataFrame aframe,
java.lang.String $Method,
java.lang.String $Menu,
javax.swing.KeyStroke hotKey)
Constructor for generating actions that will invoke a method on an ADAPT data frame. |
|
AAction(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
java.lang.String $Param,
java.lang.Object oParam)
Constructor for generating actions that call a static method with one parameter. |
|
AAction(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
java.lang.String $Param1,
java.lang.Object oParam1,
java.lang.String $Param2,
java.lang.Object oParam2)
Constructor for generating actions that call a static method with two parameters. |
|
AAction(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
java.lang.String $Param1,
java.lang.Object oParam1,
java.lang.String $Param2,
java.lang.Object oParam2,
java.lang.String $Param3,
java.lang.Object oParam3)
Constructor for generating actions that call a static method with three parameters. |
|
AAction(java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
javax.swing.KeyStroke hotKey,
java.lang.String $Param,
java.lang.Object oParam)
Constructor for generating actions that call a static method with one parameter. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Invoke a method with a saved context and optional parameters |
static void |
addActionListener(javax.swing.JMenuItem jmi,
AdaptWindow adaptWindow,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
This method creates and installs action listeners for menu commands, and works for methods with 0 or 1 parameter. |
static void |
addActionListener(javax.swing.JMenuItem jmi,
DataFrame aframe,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
This method creates and installs action listeners for menu commands, and works for methods with 0 or 1 parameter. |
private static java.awt.event.ActionListener |
getActionListener(AdaptWindow adaptWindow,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
This method creates an action listener for menu commands, and works for methods with 0 or 1 parameter. |
private static java.awt.event.ActionListener |
getActionListener(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
This method creates an action listener for menu commands, and works for methods with 0 or 1 parameter. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.Object[] aoParam
private DataFrame mainFrame
private java.lang.reflect.Method method
| Constructor Detail |
|---|
public AAction(DataFrame aframe,
java.lang.String $Method,
java.lang.String $Menu,
javax.swing.KeyStroke hotKey)
com.pentec.adapt.DataFrame with no input parameters.
aframe - the ADAPT data frame to use for loading the context$Method - the name of the method to call$Menu - a description of the action for use in drop down menushotKey - the accelerator key to associate with the action
public AAction(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
java.lang.String $Param,
java.lang.Object oParam)
dataFrame - the ADAPT data frame to which this action belongs$Class - fully qualified class name for the class containing the
target method$Method - the name of the method to call$Menu - a description of the action$Param - fully qualified class name for the parameter objectoParam - the parameter to pass to the method when it is invoked
public AAction(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
java.lang.String $Param1,
java.lang.Object oParam1,
java.lang.String $Param2,
java.lang.Object oParam2)
dataFrame - the ADAPT data frame to which this action belongs$Class - fully qualified class name for the class containing the
target method$Method - the name of the method to call$Menu - a description of the action$Param1 - fully qualified class name for the first parameteroParam1 - the first parameter$Param2 - fully qualified class name for the second parameteroParam2 - the second parameter
public AAction(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
java.lang.String $Param1,
java.lang.Object oParam1,
java.lang.String $Param2,
java.lang.Object oParam2,
java.lang.String $Param3,
java.lang.Object oParam3)
dataFrame - the ADAPT data frame to which this action belongs$Class - fully qualified class name for the class containing the
target method$Method - the name of the method to call$Menu - a description of the action$Param1 - fully qualified class name for the first parameteroParam1 - the first parameter$Param2 - fully qualified class name for the second parameteroParam2 - the second parameter$Param3 - fully qualified class name for the third parameteroParam3 - the third parameter
public AAction(java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Menu,
javax.swing.KeyStroke hotKey,
java.lang.String $Param,
java.lang.Object oParam)
$Class - fully qualified class name for the class containing the
target method$Method - the name of the method to call$Menu - a description of the action for use in drop down menushotKey - the accelerator key to associate with the action$Param - fully qualified class name for the parameter objectoParam - the parameter to pass to the method when it is invoked| Method Detail |
|---|
public void actionPerformed(java.awt.event.ActionEvent event)
public static void addActionListener(javax.swing.JMenuItem jmi,
AdaptWindow adaptWindow,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
com.pentec.adapt.afile.AFile.fileOpen is defined like this:
public void fileOpen(String $)
To create an action listener that calls fileOpen, you would
use the following code:
JMenuItem jmi = new JMenuItem("Menu Item");
AAction.addActionListener(
jmi,aframe,"com.pentec.adapt.afile.AFile","fileOpen","afile",String.class,"filename"));
jmi - the menu item to attach the action toadaptWindow - the ADAPT window on which this function is to operate$Class - the class in which the method is located$Method - the method to install as the action listener$Context - the context from which to call the methodcParamType - the class type of the method parameteroParam - the method parameter
public static void addActionListener(javax.swing.JMenuItem jmi,
DataFrame aframe,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
com.pentec.adapt.afile.AFile.fileOpen is defined like this:
public void fileOpen(String $)
To create an action listener that calls fileOpen, you would
use the following code:
JMenuItem jmi = new JMenuItem("Menu Item");
AAction.addActionListener(
jmi,aframe,"com.pentec.adapt.afile.AFile","fileOpen","afile",String.class,"filename"));
jmi - the menu item to attach the action toaframe - the ADAPT data frame on which this function is to operate$Class - the class in which the method is located$Method - the method to install as the action listener$Context - the context from which to call the methodcParamType - the class type of the method parameteroParam - the method parameter
private static java.awt.event.ActionListener getActionListener(AdaptWindow adaptWindow,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
null is returned.
adaptWindow - the ADAPT window on which this function is to operate$Class - the class in which the method is located$Method - the method to install as the action listener$Context - the context from which to call the methodcParamType - the class type of the method parameteroParam - the method parameter
private static java.awt.event.ActionListener getActionListener(DataFrame dataFrame,
java.lang.String $Class,
java.lang.String $Method,
java.lang.String $Context,
java.lang.Class cParamType,
java.lang.Object oParam)
null is returned.
dataFrame - the ADAPT data frame on which this function is to operate$Class - the class in which the method is located$Method - the method to install as the action listener$Context - the context from which to call the methodcParamType - the class type of the method parameteroParam - the method parameter
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||