public abstract class AbstractAction extends AbstractAction implements Extension
![]() |
![]() |
Modifier and Type | Field and Description |
---|---|
private String |
barGroup
The bar group.
|
private boolean |
barItem
The bar item.
|
protected static String |
DEFAULT_LABEL_GROUP
The Constant DEFAULT_LABEL_GROUP.
|
private String |
id
The id.
|
private Image |
imageIcon
original Immage
|
private String |
menuGroup
The menu group.
|
private boolean |
menuItem
The menu item.
|
private static long |
serialVersionUID
The Constant serialVersionUID.
|
private String |
shortcutKey
The shortcut key.
|
changeSupport, enabled
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 |
---|
AbstractAction(String uniqueId)
Instantiates a new action.
|
AbstractAction(String uniqueId,
String name)
Instantiates a new action.
|
AbstractAction(String id,
String name,
Icon icon,
String menuGroup,
String barGroup)
Instantiates a new action.
|
Modifier and Type | Method and Description |
---|---|
String |
getBarGroup()
Gets the bar group.
|
String |
getId()
Gets the id.
|
String |
getMenuGroup()
Gets the menu group.
|
String |
getShortcutKey()
Gets the shortcut key.
|
boolean |
isBarItem()
Checks if is bar item.
|
boolean |
isMenuItem()
Checks if is menu item.
|
void |
setBarGroup(String barGroup)
Sets the bar group.
|
void |
setBarItem(boolean barItem)
Sets the bar item.
|
void |
setIcon(Icon icon)
Sets the icon.
|
void |
setMenuGroup(String menuGroup)
Sets the menu group.
|
void |
setMenuItem(boolean menuItem)
Sets the menu item.
|
void |
setName(String name)
Sets the name.
|
void |
setShortcutKey(char keyChar,
boolean altPressed,
boolean shiftPressed)
Sets the shortcut key.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
private static final long serialVersionUID
protected static final String DEFAULT_LABEL_GROUP
private boolean menuItem
private boolean barItem
private String menuGroup
private String barGroup
private String id
private String shortcutKey
private Image imageIcon
public AbstractAction(String id, String name, Icon icon, String menuGroup, String barGroup)
id
- the idname
- the nameicon
- the iconmenuGroup
- the menu groupbarGroup
- the bar grouppublic AbstractAction(String uniqueId)
uniqueId
- the unique idpublic void setShortcutKey(char keyChar, boolean altPressed, boolean shiftPressed)
keyChar
- the key charaltPressedprivate
- Image iconToImage(Icon icon)
{
if(icon instanceof ImageIcon)
{
return ((ImageIcon) icon).getImage();
}
else
{
BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_RGB);
icon.paintIcon(null, image.getGraphics(), 0, 0);
return image;
}
}
the alt pressedshiftPressed
- the shift pressedpublic final boolean isMenuItem()
public final void setMenuItem(boolean menuItem)
menuItem
- the new menu itempublic final boolean isBarItem()
public final void setBarItem(boolean barItem)
barItem
- the new bar itempublic final String getMenuGroup()
public final void setMenuGroup(String menuGroup)
menuGroup
- the new menu groupthis.setIcon(icon);public final String getBarGroup()
public final void setBarGroup(String barGroup)
barGroup
- the new bar grouppublic final String getId()
public void setIcon(Icon icon)
icon
- the new iconpublic void setName(String name)
name
- the new namepublic String getShortcutKey()
Copyright © 2014 www.staniscia.net. All Rights Reserved.