org.pushingpixels.substance.flamingo.common
Class TransitionAwareResizableIcon

java.lang.Object
  extended by org.pushingpixels.substance.flamingo.common.TransitionAwareResizableIcon
All Implemented Interfaces:
javax.swing.Icon, org.pushingpixels.flamingo.api.common.icon.ResizableIcon

public class TransitionAwareResizableIcon
extends java.lang.Object
implements org.pushingpixels.flamingo.api.common.icon.ResizableIcon

Icon with transition-aware capabilities. Has a delegate that does the actual painting based on the transition themes. This class is used heavily on Substance-provided icons, such as title pane button icons, arrow icons on scroll bars and combos etc.


Nested Class Summary
static interface TransitionAwareResizableIcon.Delegate
          The delegate needs to implement the method in this interface based on the provided theme.
static interface TransitionAwareResizableIcon.StateTransitionTrackerDelegate
           
 
Field Summary
protected  int height
          The height of the rendered image.
protected  int width
          The width of the rendered image.
 
Constructor Summary
TransitionAwareResizableIcon(org.pushingpixels.flamingo.api.common.AbstractCommandButton button, TransitionAwareResizableIcon.StateTransitionTrackerDelegate stateTransitionTrackerDelegate, TransitionAwareResizableIcon.Delegate delegate, java.awt.Dimension initialDim)
          Creates a new transition-aware icon.
 
Method Summary
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void setDimension(java.awt.Dimension newDimension)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected int width
The width of the rendered image.


height

protected int height
The height of the rendered image.

Constructor Detail

TransitionAwareResizableIcon

public TransitionAwareResizableIcon(org.pushingpixels.flamingo.api.common.AbstractCommandButton button,
                                    TransitionAwareResizableIcon.StateTransitionTrackerDelegate stateTransitionTrackerDelegate,
                                    TransitionAwareResizableIcon.Delegate delegate,
                                    java.awt.Dimension initialDim)
Creates a new transition-aware icon.

Parameters:
button - Associated command button.
delegate - Delegate to compute the actual icons.
initialDim - Initial icon dimension.
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

setDimension

public void setDimension(java.awt.Dimension newDimension)
Specified by:
setDimension in interface org.pushingpixels.flamingo.api.common.icon.ResizableIcon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon