com.imagero.swing.icons
Class ActionIcon

java.lang.Object
  extended bycom.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).


Field Summary
static java.lang.String ACTION_PROPERTY
           
static java.lang.String STATE_PROPERTY
           
 
Constructor Summary
ActionIcon(javax.swing.Action action)
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
           
 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.
 javax.swing.Action getAction()
           
protected  javax.swing.Icon getDefaultIcon()
           
protected  javax.swing.Icon getIcon()
           
 int getIconHeight()
           
 int getIconWidth()
           
 java.lang.String getState()
          get current ActionIcon state
 int hashCode()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
           
 void setAction(javax.swing.Action action)
           
 void setState(java.lang.String state)
          set ActionIcon state.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

ActionIcon

public ActionIcon(javax.swing.Action action)
Method Detail

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)