org.jvnet.substance.utils.icon
Class TransitionAwareIcon

java.lang.Object
  extended by org.jvnet.substance.utils.icon.TransitionAwareIcon
All Implemented Interfaces:
javax.swing.Icon

public class TransitionAwareIcon
extends java.lang.Object
implements javax.swing.Icon

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

Author:
Kirill Grouchnikov

Nested Class Summary
static interface TransitionAwareIcon.ColorSchemeAssociationKindDelegate
           
static interface TransitionAwareIcon.Delegate
          The delegate needs to implement the method in this interface based on the provided color scheme.
 
Field Summary
protected  TransitionAwareIcon.ColorSchemeAssociationKindDelegate colorSchemeAssociationKindDelegate
           
protected  TransitionAwareIcon.Delegate delegate
          Delegate to compute the actual icons.
protected  java.lang.String uniqueIconTypeId
           
 
Constructor Summary
TransitionAwareIcon(javax.swing.AbstractButton button, TransitionAwareIcon.Delegate delegate, java.lang.String uniqueIconTypeId)
          Creates a new transition-aware icon.
TransitionAwareIcon(javax.swing.JComponent comp, javax.swing.ButtonModel model, TransitionAwareIcon.Delegate delegate, java.lang.String uniqueIconTypeId)
          Creates a new transition-aware icon.
TransitionAwareIcon(javax.swing.JComponent comp, javax.swing.ButtonModel model, TransitionAwareIcon.Delegate delegate, TransitionAwareIcon.ColorSchemeAssociationKindDelegate colorSchemeAssociationKindDelegate, java.lang.String uniqueIconTypeId)
          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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected TransitionAwareIcon.Delegate delegate
Delegate to compute the actual icons.


colorSchemeAssociationKindDelegate

protected TransitionAwareIcon.ColorSchemeAssociationKindDelegate colorSchemeAssociationKindDelegate

uniqueIconTypeId

protected java.lang.String uniqueIconTypeId
Constructor Detail

TransitionAwareIcon

public TransitionAwareIcon(javax.swing.AbstractButton button,
                           TransitionAwareIcon.Delegate delegate,
                           java.lang.String uniqueIconTypeId)
Creates a new transition-aware icon.

Parameters:
button - Associated button.
delegate - Delegate to compute the actual icons.

TransitionAwareIcon

public TransitionAwareIcon(javax.swing.JComponent comp,
                           javax.swing.ButtonModel model,
                           TransitionAwareIcon.Delegate delegate,
                           java.lang.String uniqueIconTypeId)
Creates a new transition-aware icon.

Parameters:
comp - Associated component.
model - Associated model.
delegate - Delegate to compute the actual icons.

TransitionAwareIcon

public TransitionAwareIcon(javax.swing.JComponent comp,
                           javax.swing.ButtonModel model,
                           TransitionAwareIcon.Delegate delegate,
                           TransitionAwareIcon.ColorSchemeAssociationKindDelegate colorSchemeAssociationKindDelegate,
                           java.lang.String uniqueIconTypeId)
Creates a new transition-aware icon.

Parameters:
comp - Associated component.
model - Associated model.
delegate - Delegate to compute the actual icons.
Method Detail

getIconHeight

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

getIconWidth

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

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon