com.imagero.swing.icons
Class ActionIcon
java.lang.Object
com.imagero.swing.icons.ActionIcon
- All Implemented Interfaces:
- javax.swing.Icon
- public class ActionIcon
- extends java.lang.Object
- implements javax.swing.Icon
ActionIcon.
Using ActionIcon we can change Action of AbstractButton silently (=without evant generation).
|
Constructor Summary |
ActionIcon(javax.swing.Action action)
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
STATE_PROPERTY
public static final java.lang.String STATE_PROPERTY
- See Also:
- Constant Field Values
ACTION_PROPERTY
public static final java.lang.String ACTION_PROPERTY
- See Also:
- Constant Field Values
ActionIcon
public ActionIcon(javax.swing.Action action)
paintIcon
public void paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
- Specified by:
paintIcon in interface javax.swing.Icon
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidth in interface javax.swing.Icon
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeight in interface javax.swing.Icon
getState
public java.lang.String getState()
- get current ActionIcon state
- Returns:
- String
setState
public void setState(java.lang.String state)
- set ActionIcon state.
Since Action is not restricted to some set of value/key paars,
it is possible to define own states.
- Parameters:
state - usual values are SMALL_ICON, OVER_ICON or PRESSED_ICON.- See Also:
com.imagero.swing.tabbedpane.GTabbedPane#DEFAULT_ICON,
com.imagero.swing.tabbedpane.GTabbedPane#OVER_ICON,
com.imagero.swing.tabbedpane.GTabbedPane#PRESSED_ICON,
com.imagero.swing.tabbedpane.GTabbedPane#DISABLED_ICON
getAction
public javax.swing.Action getAction()
setAction
public void setAction(javax.swing.Action action)
getIcon
protected javax.swing.Icon getIcon()
getDefaultIcon
protected javax.swing.Icon getDefaultIcon()
equals
public boolean equals(java.lang.Object obj)
- two ActionIcon are equals
a) if they contains same Action (which is not null)
b) they are same object.
- Parameters:
obj - Object to compare
- Returns:
- boolean
hashCode
public int hashCode()
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener l)
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener l)