public class MenuActionProxy extends Object implements Action, Serializable
MenuActionProxy proxies Actions to be used in menus. It takes care
about a proper scaling of the Action icon to a nice menu size.ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor and Description |
|---|
MenuActionProxy(Action a)
Creates a new
MenuActionProxy. |
MenuActionProxy(Action a,
Dimension dim)
Creates a new MenuActionProxy with given Icon
Dimension. |
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e) |
void |
addPropertyChangeListener(PropertyChangeListener listener) |
Dimension |
getIconDimension()
Gets the current dimension of the menu icon.
|
Object |
getValue(String key) |
boolean |
isEnabled() |
void |
putValue(String key,
Object value) |
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
setEnabled(boolean b) |
void |
setIconDimension(Dimension dim)
Sets new Icon dimensions for the menu icon.
|
public MenuActionProxy(Action a)
MenuActionProxy. The default icon dimensions (16x16) are
used.a - Actionpublic void setIconDimension(Dimension dim)
dim - New icon Dimensionpublic Dimension getIconDimension()
Dimensionpublic void setEnabled(boolean b)
setEnabled in interface Actionpublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface Actionpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface Actionpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerCopyright © 2004–2016. All rights reserved.